Skip to content

Commit 94aced6

Browse files
committed
Release 3.7.0
1 parent cf699f1 commit 94aced6

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*Copyright 2016 Pitney Bowes Inc.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
4+
except in compliance with the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the
9+
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and limitations under the License. */
11+
12+
/**
13+
* A geoLocation object
14+
* @namespace
15+
*/
16+
GEOAPIS_V1.geoLocation = function(accessToken){
17+
GEOAPIS_V1.baseService.call(this, accessToken);
18+
};
19+
/**
20+
* geoLocation inherits baseService
21+
* @namespace
22+
*/
23+
GEOAPIS_V1_INHERIT(GEOAPIS_V1.baseService, GEOAPIS_V1.geoLocation);
24+
/**
25+
* Location By Fixed Line Network.
26+
* This service accepts a fixed line phone number and returns the location coordinates corresponding to that phone number.
27+
* @param deviceId This is the fixed line phone number (US only). This is a mandatory parameter. (required)
28+
* @return GeoLocation
29+
*
30+
*/
31+
GEOAPIS_V1.geoLocation.prototype.getLocationByFixedLine = function(params, callback){
32+
var apiUrl = '/geolocation/v1/location/byfixedline?deviceId='+encodeURIComponent(params.deviceId);
33+
if(callback !== undefined){
34+
this.callApiAsync(apiUrl, callback);
35+
}
36+
else{
37+
this.callApi(apiUrl);
38+
return this.response;
39+
}
40+
};
41+
/**
42+
* Location By IP Address.
43+
* This service accepts an IP address and returns the location coordinates corresponding to that IP address.
44+
* @param ipAddress This is the ip address of network connected device. It must be a standard IPv4 octet and a valid external address. (required)
45+
* @return GeoLocation
46+
*
47+
*/
48+
GEOAPIS_V1.geoLocation.prototype.getLocationByIPAddress = function(params, callback){
49+
var apiUrl = '/geolocation/v1/location/byipaddress?ipAddress='+encodeURIComponent(params.ipAddress);
50+
if(callback !== undefined){
51+
this.callApiAsync(apiUrl, callback);
52+
}
53+
else{
54+
this.callApi(apiUrl);
55+
return this.response;
56+
}
57+
};
58+
59+
/**
60+
* Location by WiFi Access Point.
61+
* This service accepts a WiFi access point MAC address and returns the location coordinates corresponding to that access point.
62+
* @param mac This should be the 48 bit mac address (or BSSID) of wireless access point. Accepted format is Six groups of two hexadecimal digits, separated by hyphens (-) or colons. (required)
63+
* @param ssid The service set identifier for wi-fi access point. It should be alphanumeric with maximum 32 characters. (optional)
64+
* @param rsid This is the received signal strength indicator from particular wi-fi access point. It should be a number from -113 to 0 and the unit of this strength is dBm. (optional)
65+
* @param speed This is the connection speed for wi-fi. It should be a number from 0 to 6930 and the unit should be Mbps. (optional)
66+
* @param accessPoint This is the JSON based list of wifi access points in the vicinity of device to be located. This parameter is helpful in case, multiple wifi points are visible and we want to make sure that the location of device is best calculated considering all the access points location. (optional)
67+
* @return GeoLocation
68+
*
69+
*/
70+
GEOAPIS_V1.geoLocation.prototype.getLocationByWiFiAccessPoint = function(params, callback){
71+
var apiUrl = '/geolocation/v1/location/byaccesspoint?mac='+encodeURIComponent(params.mac);
72+
optionalList = ['ssid', 'rsid', 'speed', 'accessPoint'];
73+
apiUrl = this.apiGetUrl(params, optionalList, apiUrl);
74+
if(callback !== undefined){
75+
this.callApiAsync(apiUrl, callback);
76+
}
77+
else{
78+
this.callApi(apiUrl);
79+
return this.response;
80+
}
81+
};

0 commit comments

Comments
 (0)