how can i put an alert after loading google map

淺唱寂寞╮ 提交于 2019-12-11 13:43:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!