【问题标题】:Google Maps API v3 doesn't get rendered in IE9 (IE10, Firefox and Chrome render it smoothly)Google Maps API v3 无法在 IE9 中呈现(IE10、Firefox 和 Chrome 呈现流畅)
【发布时间】:2013-11-07 17:23:29
【问题描述】:

我们正在从 Google Map API v2 更新到 v3,到目前为止,我已经能够实现所有必需的功能。至少在 IE、Firefox 和 Chrome 的最新版本方面。我们还要求 API 必须在 IE9 上运行。遗憾的是它甚至没有出现在那里。

相关代码(简化,我注释了之后跳转到另一个位置并为结果放置标记的代码):

@UiField
SimplePanel mapWrapper;

[...]
MapOptions options = MapOptions.create();
options.setCenter(LatLng.create(46.81819, 8.22751));
options.setZoom(5);
options.setMapTypeId(MapTypeId.ROADMAP);
options.setDraggable(true);
options.setMapTypeControl(true);
options.setPanControl(true);
options.setScaleControl(true);
options.setScrollwheel(true);
options.setStreetViewControl(true);
mapWrapper.setSize("350px", "350px");
m_Map = GoogleMap.create(mapWrapper.getElement(), options);
m_Map.triggerCenterChanged();
m_Map.triggerResize();

而 IE10 包含

<div style="width: 350px; height: 350px; overflow: hidden; position: relative; background-color: rgb(229, 227, 223);">
    <div style="left: 0px; top: 0px; width: 100%; height: 100%; overflow: hidden; position: absolute; z-index: 0;">
        [...] // all the tags which make up the api and its content
    </div>
</div>

IE9只有

<div style="width: 350px; height: 350px;">
    <div style="overflow: hidden;">
    </div>
</div>

在同一个位置。

【问题讨论】:

  • 以前在 SO 上被问过很多次。建议的解决方案 hereherehere 是否有帮助?
  • 我已经看到了这些建议,但它们似乎不适用于我的问题。 1. 文档模式已经设置为&lt;meta http-equiv="X-UA-Compatible" content="IE=9;"&gt; 2. 我不直接使用Javascript 来构建地图(尽管这是我考虑的解决方法)。无论如何,谢谢你的帮助。

标签: internet-explorer gwt google-maps-api-3 internet-explorer-9 rendering


【解决方案1】:

(由 OP 在问题编辑中回答。转换为社区 wiki 答案。请参阅Question with no answers, but issue solved in the comments (or extended in chat)

OP 写道:

确实有一个JS错误指出API被多次加载。

在 -.gwt.xml 文件中删除以下第一行后,IE9 能够加载 API 并按预期工作。

<script src="http://maps.google.com/maps/api/js?sensor=false" />
<script src="http://maps.google.com/maps/api/js?sensor=false&amp;v=3&amp;libraries=geometry" />

虽然其他浏览器都没有问题,但让我感到困惑。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-03
    • 2013-01-01
    • 2019-04-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多