-
Notifications
You must be signed in to change notification settings - Fork 917
External Service
###External Service The plugin does not implement some features, such as navigation, but the external applications have one. In this case, you can launch the external application.
Recommend: Launch Navigator Cordova/Phonegap Plugin
The launchNavigation method launches the Google Maps app.
If Google Maps app is not available in iOS, Apple Maps app is launched.
You can just pass from
and to
parameters.
As of version 1.2.3, you can also specify the travelMode
parameter.
travelMode
driving
transit
bicycling
walking
###Example1
plugin.google.maps.external.launchNavigation({
"from": "Tokyo, Japan",
"to": "Kyoto, Japan"
});
###Example2
var yourLocation = null;
map.getMyLocation(function(location) {
yourLocation = location.latLng;
map.addMarker({
"position": yourLocation,
"title": "I am around here!"
}, function(marker) {
marker.showInfoWindow();
});
map.moveCamera({
"target": yourLocation,
"zoom": 12
});
});
map.on(plugin.google.maps.event.MAP_CLICK, function(latLng) {
map.addMarker({
"position": latLng,
"title": "Destination"
}, function(marker) {
marker.showInfoWindow();
setTimeout(function() {
if (confirm("Do you want to go?")) {
plugin.google.maps.external.launchNavigation({
"from": yourLocation,
"to": latLng
});
}
}, 2000);
});
});
Method | Return value | Description |
---|---|---|
launchNavigation() | void | Launch the external navigation app. |
If you get an error, feel free to ask me on the official community or the issue list.
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.
New versions will be announced through the official community. Stay tune!
Feel free to ask me on the issues tracker.
Or on the official community is also welcome!
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.