IE中的Google Maps API v3不显示地图或标记 [英] Google Maps API v3 in IE Not Displaying Map or Markers

查看:179
本文介绍了IE中的Google Maps API v3不显示地图或标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近从Google Maps v2升级到v3,现在标记和地图不会在任何版本的IE中显示。它适用于所有其他浏览器。



控制台显示堆栈溢出错误,我们认为它与标记和/或标记创建有关。我们禁用了fitbounds命令,并且在IE中显示了地图但没有标记。然而,Firefox和Chrome中的相同地图有令我们困惑的标记。

我一直在试图找出解决这个问题的几个小时, IE浏览器和在Google上进行搜索,但还没有发现任何类似于我们问题的内容。



我是Google Map API的新手,刚刚发现了stackoverflow,所以我想也许有人可能会发现我缺少的东西?



示例地图: http ://tinyurl.com/bt7tvj3

解决方案

安装IE9,先在普通模式下试试。 p>

如果可行,试试兼容模式。



原因是:IE9拥有更好的JS支持,更好的调试器比以前的版本更好。



另外,通过jshint.com或jslint.org运行你的代码 - 这总是有帮助的。



通常,IE在分号丢失方面存在问题,并且在数组和对象,如

  var arr = [1,2,3,]; 
var obj = {a:1,b:2,};

jslint和jshint会为您处理额外的逗号。如果你的代码通过了jshint,但它仍然无法在IE7 +中使用,那么回过头来看看还有什么可以丢失的。


We recently upgraded from Google Maps v2 to v3 and now the Markers and Map will not display in any version of IE. It works in every other browser.

The console is showing Stack Overflow errors, and we think it has something to do with the markers and/or creation of markers. We disabled the fitbounds command, and the map displayed but with no markers in IE. However, the same map in Firefox and Chrome has markers which puzzled us.

I've been trying to figure out a solution to this issue for a few hours, debugging in IE and doing searches on Google, but have yet to find anything that resembles our issue.

I am new to the Google Map API, and just discovered stackoverflow, so I thought maybe somebody here could spot something I am missing?

Example map: http://tinyurl.com/bt7tvj3

解决方案

Install IE9, try it out in normal mode first.

If that works, try out compatibility mode.

The reason is: IE9 has far better JS support and a far better debugger than the previous versions.

Also, run your code through jshint.com or jslint.org - that always helps.

Usually IE has problems with missing semicolons and , in the end of arrays and objects, like

var arr = [1,2,3,];
var obj = {a:1, b:2,};

jslint and jshint will take care of additional commas for you. If your code passes jshint, and it still doesn't work in IE7+, come back, let's see what else can be missing.

这篇关于IE中的Google Maps API v3不显示地图或标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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