Strange Google Map Behavior - Tiles Appear Only In Upper Left Quadrant

匿名 (未验证) 提交于 2019-12-03 02:31:01

问题:

Have used google maps dozens of times but cannot get around this one. Doing google's simple hello world for map version 3 (http://code.google.com/apis/maps/documentation/javascript/tutorial.html#ap…)

However the tiles only appear in the upper left part of the map canvas and even when dragging / scrolling they continue to stay in the upper-left. See pic: http://sandbox.thecanarycollective.com/whiteboard/2012-03-05_073019.png

I have played with the CSS on the page quite a bit to see if it was getting screwed up by something else but no luck. Anyone ever see this before?

回答1:

The individual tiles are div elements. Try turning off the css on your page and see if this problem still occurs. Then use a tool like firebug to examine the HTML of the page - see if the missing tiles appear in the HTML.

Using firebug, write this into the console:

google.maps.event.trigger(googleMap, 'resize'); 

where googleMap is the map element. This may fix things if you're resizing the map after it is created.

If none of these help, post your javascript, css and HTML - its hard to think of what to suggest when you just provide a fixed image.



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