-
Notifications
You must be signed in to change notification settings - Fork 919
Map.isAvailable()
###Description
The Map.isAvailable() is a static method. You can check the availability of Google Maps Android API version 2 on the device.
Some Android OS (such as Amazon Kindle, Android Emulator, etc) do not contain the Google Play Services Framework and the Google Maps libraries. Google Maps Android API version 2 uses these libraries. It means the OS do not have the library, Google Maps Android API do not work, thus this plugin do not work.
###code
document.addEventListener("deviceready", function() {
// Check the availability of Google Maps Android API v2.
// Return always true in iOS.
plugin.google.maps.Map.isAvailable(function(isAvailable, message) {
if (isAvailable) {
var map = plugin.google.maps.Map.getMap();
map.addEventListener(plugin.google.maps.event.MAP_READY, onMapInit);
} else {
alert(message);
}
});
});
function onMapInit(map) {
map.showDialog();
}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.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md
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.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md