forked from phonegap/phonegap-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPGMapLauncher.js
30 lines (27 loc) · 1004 Bytes
/
PGMapLauncher.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(function() {
var LabeledLocation = function(label,lat,lon)
{
this.label = label;
if(lat && lon)
{
this.coordinates = {"latitude":lat,"longitude":lon};
}
};
navigator.plugins.pgMapLauncher =
{
// searchText is required.
// If nearToCoords is null, the map will search near to the current location
searchNear:function(searchTerm, nearToCoords )
{
var options = {"searchTerm":searchTerm,"center":nearToCoords};
cordova.exec(null,null,"PGMapLauncher","searchNear",options);
},
// toLabeledLocation is required
// if toLabeledLocation.
// if fromLabeledLocation is null, the current location will be used
getDirections:function(toLabeledLocation,fromLabeledLocation)
{
cordova.exec(null,null,"PGMapLauncher","getDirections", {"startPosition":fromLabeledLocation,"endPosition":toLabeledLocation});
}
}
})();