【问题标题】:MarkerClusterer doesn't display icon in IE10MarkerClusterer 在 IE10 中不显示图标
【发布时间】:2013-05-10 09:18:26
【问题描述】:

如果您在 IE10 中查看以下示例 http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/examples/advanced_example.html - 它会显示点但不显示群集图标。

有人知道问题出在哪里/是否有解决办法?

【问题讨论】:

  • 遇到同样的问题 :(

标签: google-maps google-maps-api-3 internet-explorer-10 markerclusterer


【解决方案1】:

强制浏览器进入 IE9 模式是不好的做法——尤其是因为 MarkerClusterer。而是修改第 956 行 (https://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/markerclusterer/src/markerclusterer.js?r=110#956) 上的代码:

if (document.all) {
    style.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(' + 'sizingMethod=scale,src="' + this.url_ + '");');
} else {
    style.push('background:url(' + this.url_ + ');');
}

到这里:

style.push('background:url(' + this.url_ + ');');

【讨论】:

    【解决方案2】:

    我也遇到了同样的问题,你需要在页面的 head 部分中添加以下代码来强制浏览器进入 IE9 模式

    <meta http-equiv="X-UA-Compatible" content="IE=9"/>
    

    如果您在 IFRAME 内显示地图,则必须将其添加到母版页。

    n.b.您需要关闭并重新打开浏览器才能看到地图正常工作。

    欲了解更多信息,请参阅this working example

    【讨论】:

      【解决方案3】:

      我找到了解决此问题的另一个原因/解决方法。我正在使用我使用 javascript window.location.origin 引用的地图标记的图像。 Internet Explorer (IE) 10 或更低版本无权访问此对象,导致路径为“未定义”对象。

      解决方案:避免使用window.location.origin 对象。使用相对路径或以下脚本:

      if (!window.location.origin) {
            window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
          }
      

      这个脚本不是我的,我在网上找到的。希望这可以帮助。干杯

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-06-12
        • 2013-10-23
        • 1970-01-01
        • 2017-09-26
        • 2018-11-02
        • 2014-05-23
        • 1970-01-01
        相关资源
        最近更新 更多