谷歌地图没有在页面上完全呈现? [英] Google Maps not rendering completely on page?

查看:33
本文介绍了谷歌地图没有在页面上完全呈现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有一个谷歌地图,其中有一个我自己构建的搜索窗格,可以随意显示和隐藏.它涵盖了一侧地图的 200 像素.问题是,当我调整地图大小时,窗格重叠的区域未渲染,即地图由于某种原因没有在那里渲染.

I have a google maps on my page with a search pane I built myself which can be displayed and hidden at will. It covers like lets say 200 pixels of the map on a side. The thing is that when I resize my map or so the area where the pane overlaps is unrendered i.e the map doesn't render there for some reason.

查看此链接

在框中输入 OMDB,这是机场的国际民航组织代码,然后按 Enter.

In the Box type in lets say OMDB which is an icao code for an airport and press enter.

结果显示出来,您会看到窗格.现在单击全屏链接,然后单击机场选项卡使面板消失 - 您现在看到地图的一部分根本没有渲染......我必须拖动地图并且只有部分渲染那个区域.我该如何解决?

The results are shown and you see the pane. Now click on the full screen link and then click on the airports tab to make the panel go away - you see now that part of the map hasn't rendered at all...I have to drag the map around and that only partially renders that area. How can I fix it?

仅供参考,我已在 Windows XP 上的 Google Chrome、Firefox 和 IE8 上运行它.有没有办法像强制完整渲染地图一样?这是一个非常不稳定的问题,它可能与我的代码有关还是主机问题?还是 Google 就是不喜欢我?:(

FYI I've run it on Google Chrome, Firefox and IE8 on Windows XP. Is there a way to like force complete rendering of a map or so? This is quite an erratic problem and could it be concerne with my code or is it a host issue? Or does Google just don't like me? :(

看到侧面那个丑陋的大补丁.它的未渲染区域也应该渲染地图.没有任何放大和平移有助于清除这一点:(

See the big ugly patch on the side. Its unrendered area where the map should have been rendered as well. No amount of zooming in and panning is helping clear this :(

推荐答案

我无法重现您遇到的问题,但它看起来与我在谷歌地图上看到的另一个问题相似.

I'm not able to reproduce the issue you are having, but it looks similar to another issue I've seen with google maps.

看起来您可能与谷歌地图确定哪些图块在视图中的方式有​​冲突.它只计算一次,当第一次将地图加载到 div 中时,如果 div 增长,那么将无法绘制足够的地图.幸运的是,这很容易处理.任何时候容器可能已经调整大小,在地图实例上使用 checkResize() 方法,剪切区域将从容器的当前大小重新计算.

It looks like you might be running afoul of the way google maps determines which tiles are in view. It calculates this only once, when the map is loaded into the div the first time, and if the div grows, then not enough map will be drawn. Fortunately, this is easy to deal with. any time the container may have resized, use the checkResize() method on the map instance, and the clipping area will be recomputed from the container's current size.

这篇关于谷歌地图没有在页面上完全呈现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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