MAP_READY event

April 20, 2019 ยท View on GitHub

:warning: This document is aim for older versions (from 2.3.0 to 2.5.3). Document for new version is https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.6.0/README.md

MAP_READY event

This event is fired when the map is created using the map.getMap() method.

Demo code

<div id="map_canvas"></div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);

// At this time, the map instance is not ready yet.
// So don't do anything.
//
// map.getVisibleRegion();  <--- This is bad timing.

// After the MAP_READY event, you can modify the map.
map.one(plugin.google.maps.event.MAP_READY, function() {

});