working for Bluefields
google.maps.event.addListener(map, 'idle', function() { ... });
Your code should be upgraded, because it fires every time you load the map, drag the map, zoom, etc... google.maps.event.addListener(GMap, 'idle', function(){ if(!mapLoaded){ $('#google_map').trigger('mapLoaded'); mapLoaded = true; //do my stuff }});$('#map_canvas').bind('mapLoaded', function(){console.log('The mapLoaded event has occurred!!!');});
You can use the addListenerOnce event handler, so that it will trigger the event only once. https://developers.google.com/maps/documentation/javascript/reference?hl=en#MapsEventListener
Your code should be upgraded, because it fires every time you load the map, drag the map, zoom, etc...
ReplyDeletegoogle.maps.event.addListener(GMap, 'idle', function(){
if(!mapLoaded){
$('#google_map').trigger('mapLoaded');
mapLoaded = true;
//do my stuff
}
});$('#map_canvas').bind('mapLoaded', function(){console.log('The mapLoaded event has occurred!!!');});
You can use the addListenerOnce event handler, so that it will trigger the event only once. https://developers.google.com/maps/documentation/javascript/reference?hl=en#MapsEventListener
ReplyDelete