【问题标题】:Bing maps control not rendering properly in IE7 - SharePoint 2010Bing 地图控件无法在 IE7 中正确呈现 - SharePoint 2010
【发布时间】:2010-10-15 02:39:43
【问题描述】:

我创建了一个 SharePoint 2010 WebPart,它从列表中提取纬度/经度信息并在地图中显示图钉。我遇到了地图在 IE7 中无法正确呈现的问题。即使我不使用任何图钉而只显示基本地图。截图如下:Screenshot

我已尽可能简化了代码,但仍然出现错误。这是我的示例代码:

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
<div id='rowanMap' style="position:relative; width:100%; height:400px; float:none;"></div>
<script type="text/javascript">
 function GetMap() {
  var map = null;
  map = new VEMap('rowanMap');
  map.SetCredentials("[Redacted]");

// pins added programatically here if they exist, but problem occurs without them as well.

  map.LoadMap();
 }

 GetMap();
</script>

这是作为可视化 Web 部件添加到页面中的。

我知道这不是我的 ie7 版本,因为这个演示在加载到第二个选项卡时可以工作:http://www.microsoft.com/maps/isdk/ajax/

同样,firefox、chrome、ie8、ie9 都可以正常工作。

有什么想法吗?

【问题讨论】:

    标签: internet-explorer-7 sharepoint-2010 bing-maps


    【解决方案1】:

    我想出了一个解决方法。看来问题是getmap()函数在页面加载完成之前就运行了,所以加个超时就解决了问题:

     setTimeout("GetMap()", 50); 
    

    我尝试使用 window.onload 方法,但它覆盖了一些必要的共享点 javascript。幸运的是,即使超时很短,它也能正常工作。

    【讨论】:

      猜你喜欢
      • 2014-11-14
      • 1970-01-01
      • 1970-01-01
      • 2012-02-12
      • 2012-01-27
      • 1970-01-01
      • 1970-01-01
      • 2011-10-28
      • 1970-01-01
      相关资源
      最近更新 更多