为什么我的OpenLayers 3地图不显示在Internet Explorer 11中? [英] Why does my OpenLayers 3 map not show in Internet Explorer 11?

查看:1139
本文介绍了为什么我的OpenLayers 3地图不显示在Internet Explorer 11中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Internet Explorer中提供一个在Firefox或Chrome中正常工作的地图。在调试时,我注意到,当我试图提出在IE中的地图时,缺少的东西。这是使用工作地图的Firefox中的html:

I am trying to serve up a map in Internet Explorer that works fine in Firefox or Chrome. While debugging I noticed that something was missing when I tried to bring up the map in IE. This is the html that is in Firefox with the working map:

这是缺少地图基本元素的html:

This is the html that is missing essential elements for the map:

这发生在我绘制边界框并提交搜索后,搜索应该找到以及在边界框中的结果。然后绘制每个结果覆盖的整个区域。当地图未显示在Internet Explorer 11中时,应显示结果。仍显示空白地图面板,但它缺少地图图块。当你放大到地图时,我得到这个错误:无法获取未定义或null引用的属性样式。

This occurs after I draw a bounding box and submit a search, the search is supposed to find and results that are in the bounding box. Then draw the whole area that each result covers. When the results are supposed to be displayed is when the map does not appear in Internet Explorer 11. A blank map-panel is still displayed but it is missing the map tiles. When you "zoom in" to the map I get this error: Unable to get property 'style' of undefined or null reference.

任何人都可以帮助我找出为什么IE

Can anyone help me figure out why IE leaves these elements out?

推荐答案

经过多次尝试和错误(谷歌上的时间),我设法弄清楚IE似乎忘记如何渲染你的地图,如果你从页面中删除它,然后尝试绘制向量/范围,并带回它。最终工作的解决方案是,我不得不重新初始化地图每次我想要它显示。

After much trial and error (and hours on google) I managed to figure out that IE seems to forget how to render your map if you remove it from the page then try to draw vectors/extents on it and bring it back. The solution that ended up working was that I had to reinitialize the map every time I wanted it displayed.

这篇关于为什么我的OpenLayers 3地图不显示在Internet Explorer 11中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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