我怎么能加载谷歌地图后警报 [英] how can i put an alert after loading google map

查看:142
本文介绍了我怎么能加载谷歌地图后警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

加载谷歌地图后有没有办法执行一个函数?
我的网站上有一个谷歌地图



在此网站中,Google地图通过Google API使用以下网址执行:http://maps.googleapis.com/maps/api/js?sensor = true& libraries = places

我想在本网站加载Google地图后放置一个警告框。



有什么方法可以识别地图何时完全加载?



请帮助我

解决方案

对于地图,当可见图块加载完成时会触发:

  google.maps.event 
.addListenerOnce( mapinstance,'tilesloaded',function(){alert('map is ready');});


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

解决方案

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');});

这篇关于我怎么能加载谷歌地图后警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆