admin管理员组文章数量:1356135
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?
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?
Share Improve this question edited Jul 20, 2012 at 9:38 Tony 10.4k3 gold badges50 silver badges77 bronze badges asked Jun 28, 2011 at 6:32 NyxynyxNyxynyx 63.8k163 gold badges507 silver badges856 bronze badges2 Answers
Reset to default 6You can listen to the tilesloaded
event:
google.maps.event.addListener(map, 'tilesloaded', function(){
document.getElementById('loading').innerHTML = '';
})
Here is a working jsfiddle: http://jsfiddle/96WgM/2/
Alternatively, you could just set a loading gif image as the map div background:
http://jsfiddle/c962U/
本文标签: phpLoading screen for Google MapsStack Overflow
版权声明:本文标题:php - Loading screen for Google Maps - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744051417a2582494.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论