地图有时只出现在其div的左上角 [英] Map sometimes appears only on upper left corner of its div
本文介绍了地图有时只出现在其div的左上角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 Google Maps API v3 for javascript
I'm using the Google Maps API v3 for javascript. On certain cases I only see the map on the upper left corner. To see, please try going to http://telofast.com/telofun/#stationRanking and then pressing on one of the many lines.
推荐答案
当浏览器的宽度和高度设置正确时,调整大小事件。
The map works when the browser is resized as the width and height are correctly set and the resize event is raised.
解决问题的最快捷方法是在javascript之后调用resize方法(下面)。也许在 showDiv('mapDiv');
之后 showScoresAndCenterOn
?
The quickest solution to your problem would be to call the resize method (below) after the javascript which reveals it. Maybe after showDiv('mapDiv');
in showScoresAndCenterOn
?
google.maps.event.trigger(map, 'resize');
这篇关于地图有时只出现在其div的左上角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文