gmaps API v3 very slow loading on IE [duplicate]

2019-08-06 13:02发布

This question already has an answer here:

this is my first post, so I hope I'm in the right place. I've created a local html page with a map using google maps API v3.0. It works fine on Chrome and Firefox but not on IE. When I try to open the map, the browser remains stuck on a white page loding the maps for more than 30/40 seconds. Once the maps appears everything is ok.

The same happens with the example provided by google (https://developers.google.com/maps/documentation/javascript/examples/map-simple)

I've searched on google for hours but I didn't find any solution. Any help would be very appreciate.

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

I think it might be because of the style sheet.

According to this website,

IE needs to know the size of the map ensure that it has been set

It seems like IE might not try to determine until the page is fully loaded, which sometime takes a long time. That being said, adding the width:100%; in the css style sheet should help. At least it works for me.

I hosted a simple map with width:100%; here.

查看更多
登录 后发表回答