【问题标题】:Incompatibility with geocodezip map in internet explorer (any version)与 Internet Explorer 中的 geocodezip 地图不兼容(任何版本)
【发布时间】:2013-05-23 18:19:02
【问题描述】:

我有这张地图,作为this other question 的答案。它使用 geocodezip 并且运行良好,但在 Internet Explorer 中无法运行。你能建议我任何解决方案吗?

这是地图的链接: http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=http://www.geocodezip.com/xmlProxy060215.asp?https%3A%2F%2Fmaps.google.com%2Fmaps%2Fms%3Fhl%3Den%26ie%3DUTF8%26oe%3DUTF8%26authuser%3D0%26msa%3D0%26output%3Dkml%26msid%3D216330649072490208011.0004daf6e6bfde8dd857d

这是它在其他浏览器中的外观

这是它在 Internet Explorer 中的外观

非常感谢

【问题讨论】:

  • 你只需要缩小。找到一种将缩放编码到固定位置的方法。
  • 不,这是 IE 非标准行为的另一个问题。 geoxml3 在这一行 (new DOMParser()).parseFromString(str, 'text/xml'); 上出现语法错误,至少在某些版本中......
  • 如果它有帮助我没有在 ie10 中遇到那个错误,我只是缩小了
  • 在这种情况下(消息),您应该将以下行添加到您的文档的头部。如果您提供 text/html MIME 类型,该方法应该可以工作。 var string = 'content'; var doc = new DOMParser().parseFromString("", "text/xml");返回 doc.documentElement.localName == "y";
  • 在 IE8 中出现解析错误:reason "An invalid character was found in text content. " String, srcText " <description><![CDATA[Sucursales en la rep" String

标签: internet-explorer google-maps kml geoxml3


【解决方案1】:

这是一个示例代码:

function initialize() {
  var mapOptions = {
    zoom: 4,
    center: new google.maps.LatLng(-33, 151),
    disableDefaultUI: true,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById('map-canvas'),
                                mapOptions);
}

google.maps.event.addDomListener(window, 'load', initialize);

【讨论】:

  • 您应该提供一个显示where you got the code的链接;这显然不是你第一次这样做了。请不要抄袭。此外,这并不能真正回答问题。
【解决方案2】:

根本原因是 IE 中处理字符编码的方式不同,IE 正在检测 XML 中的无效字符。

【讨论】:

    猜你喜欢
    • 2015-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多