mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-24 03:00:11 -04:00
30 lines
1004 B
JavaScript
30 lines
1004 B
JavaScript
(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});
|
|
}
|
|
}
|
|
})(); |