在iframe nyromodal图层中,Google地图无法在IE8中正确呈现 [英] Google Maps does not render correctly in IE8 within iframe nyromodal layer

查看:187
本文介绍了在iframe nyromodal图层中,Google地图无法在IE8中正确呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在nyromodal iframe层中渲染谷歌地图。

I try to render a google map within a nyromodal iframe layer.

它在Chrome和Firefox中运行良好,但在IE8中有一个奇怪的问题:首先加载,它工作正常。然而,当我关闭图层并在同一页面上重新打开它之后,地图将呈现错误:仅显示灰色图块并且并且其所有内容将随机地喷溅,例如,像这样:

It works fine in Chrome and Firefox, but in IE8 there is a strange issue: On first load, it works fine. Yet after I close the layer and reopen it on the same page, the map will render false: only mostly showing grey tiles and and and all its content will be splattered randomly, e.g. like so:

如果我清除缓存并重新加载,地图将再次运行但只有一次。

If I clear the cache and reload, the map will work again but only one time.

推荐答案

问题很可能在于,nyromodal需要时间才能完全打开,而谷歌API已经尝试渲染地图。因此它在清除缓存时起作用,因为在加载所有资源之前存在超时,允许nyromodal完全打开选项。

The problem most likely lies within the fact that nyromodal needs time to fully open, while the google API already tries to render the map. Hence it works when clearing the cache, as there is a timeout before all resources are loaded, allowing nyromodal the option to completely open.

因此,为了强制执行超时通过

So in order to enforce a timeout to fully load the nyromodal, initalize your map in your iframe via

$(document).ready(function () {

 /* set up your map */

 setTimeout(
   function() {
     initalizeYourMap();
 },
 1000);

});

这篇关于在iframe nyromodal图层中,Google地图无法在IE8中正确呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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