Google Maps API v3 doesn't get rendered in IE9

2019-06-13 03:09发布

We're updating from Google Map API v2 to v3 and I've been able to implement all required functions so far. At least in regard to the newest versions of IE, Firefox and Chrome. We've but also got the requirement that the API has to work on IE9. Sadly it doesn't even appear there.

Related Code (simplified, I commented the code which afterwards jumps to another location and places markers out for the results):

@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();

While IE10 contains

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

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

at the same location.

1条回答
萌系小妹纸
2楼-- · 2019-06-13 03:59

(Answered by the OP in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )

The OP wrote:

There was indeed a JS error which pointed out that the API was loaded multiple times.

After removing the first of the following lines in the -.gwt.xml file, IE9 was able to load the API and works as intended.

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

It baffles me though that neither of the other browsers had a problem with it.

查看更多
登录 后发表回答