Bing 地图控件无法在 IE7 中正确呈现 - SharePoint 2010

发布于 2024-09-27 15:44:05 字数 1377 浏览 0 评论 0原文

我创建了一个 SharePoint 2010 WebPart,它从列表中提取纬度/经度信息并在地图中显示图钉。我遇到了地图在 IE7 中无法正确渲染的问题。即使我没有使用任何图钉并且只显示基本地图。这是屏幕截图:屏幕截图

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

<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 都可以正常工作。

有什么想法吗?

I've created a SharePoint 2010 WebPart that pulls lat/long info from a list and displays pins in a map. I'm having a problem where the map does not render properly in IE7. Even when I'm not using any pins and just showing a basic map. Here's a screenshot: Screenshot

I've simplified the code as much as possible and am still getting the error. here's my sample code:

<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>

This is being added to the page as a visual webpart.

I know it's not my version of ie7, because this demo works when loaded in a second tab: http://www.microsoft.com/maps/isdk/ajax/

Again, firefox, chrome, ie8, ie9 all work properly.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水晶透心 2024-10-04 15:44:06

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

 setTimeout("GetMap()", 50); 

我尝试使用 window.onload 方法,但它覆盖了一些必要的 sharepoint javascript。幸运的是,即使超时很短,它仍然有效。

I figured out a workaround. It seems that the problem is that the getmap() function runs before the page finishes loading, so adding a timeout solves the problem:

 setTimeout("GetMap()", 50); 

I tried using the window.onload method, but it overwrote some necessary sharepoint javascript. Luckily the timeout works even when it is very short.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文