Skip to content

Map.getMap()

Masashi Katsumata edited this page May 19, 2014 · 11 revisions

The Map.getMap() is a static method. You can grab a map instance.

###Description The Map.getMap() method returns an instance of the map class. The plugin initializes the native SDK and other thing, it takes a few second. The MAP_READY event is fired when the map is ready to go.

This plugin generates only one map instance using map.getMap() method. In general, you may want to create multiple maps, but this plugin is not possible.

###Code

var map = plugin.google.maps.Map.getMap();
map.addEventListener(plugin.google.maps.event.MAP_READY, function onMapInit(map) {
  // The map is initialized, then show a map dialog
  map.showDialog();
});

Map.getMap()

Join the official community

New versions will be announced through the official community. Stay tune!

Do you have a question or feature request?

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

Clone this wiki locally