Google地图加载屏幕 [英] Loading screen for Google Maps

查看:81
本文介绍了Google地图加载屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,Google地图的加载时间比平时要长,并且导致浏览器在加载之前刷新很多次。无论哪种方式,这导致我想知道如何在地图完全加载之前创建加载屏幕来显示。



有什么建议?



更新:(回复加比的代码)

  google.maps .event.addListener(map,'tilesloaded',function(){
document.getElementById('loading')。innerHTML ='';
})

是否有可能让加载PNG覆盖整个地图并在tileloaded事件之前将其删除?

另外,您可以将加载gif图像设置为地图div背景: http://jsfiddle.net/c962U/


I've noticed that Google Maps is taking longer than usual to load these days, and causes the browser to refresh many times before loading. Either way, this has led me to wonder how I can create a loading screen to display before the map fully loads.

Any suggestions?

Update: (In response to Gabi's code)

google.maps.event.addListener(map, 'tilesloaded', function(){
    document.getElementById('loading').innerHTML = '';
})

Is it possible to have a loading PNG overlay the entire map and remove it just before the tilesloaded event?

解决方案

Alternatively, you could just set a loading gif image as the map div background:

http://jsfiddle.net/c962U/

这篇关于Google地图加载屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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