问题
Is there any way to execute a function after loading google map ? There is a google map in my site
In this site the Google map is executing with the Google API using the URL :http://maps.googleapis.com/maps/api/js?sensor=true&libraries=places
I want to put an alert box after loading Google map in this site.
Is there any way to recognize when the map is fully loaded?
Please help me
回答1:
there is a tilesloaded-event for the map, it fires when the visible tiles have finished loading:
google.maps.event
.addListenerOnce(mapinstance, 'tilesloaded', function(){alert('map is ready');});
来源:https://stackoverflow.com/questions/13947566/how-can-i-put-an-alert-after-loading-google-map