Google Maps API V3 - Internet Explorer

2019-08-07 12:38发布

问题:

Hi I am having some problems with my javascript not working in IE. That being said I have been looking through older post such as these.

google-maps-javascript-api-error-in-internet-explorer

google-maps-api-marker-images-not-showing-in-internet-explorer

I still cant figure out what the problem is. When I debug I end up in the minifed google api code and have no idea what is going on (Similar to this post google-maps-javascript-api-error-in-internet-explorer ) . One thing that I can tell is that as I step over the errors the polygons start to to be drawn in the order that they are ( order is at the bottom of windData.js. I think the problem might have to do with the way I have windData.js setup.

I dont think the problem is with a global variable map since when you enter a address and click search it re-centers the map on that location, but then the marker is not drawn and the infowindow does not appear.

One CSS note that I saw was that the search button, and nav bar dont seem to be lining up correctly. More specifically the Nav bar doesnt line up in IE. The Search bar doesnt line up in Firefox.

For all my testing I have been using Internet Explorer 9, Firefox 7.0.1 and Chrome 15.0.874.120 m.

Thanks in advance for your help. Additionally I am new to all this and any recommendations you have on how I should do thing would be greatly appreciated thanks.

回答1:

One obvious problem is this sort of thing:

paths: [
    new google.maps.LatLng(27.32074511436256,-99.53600600398401),
    new google.maps.LatLng(27.30459798514129,-99.5366568769641),
    ...
    new google.maps.LatLng(27.32074511436256,-99.53600600398401),
    ],

The comma after the last LatLng, before the closing ] will cause errors in Internet Explorer. I think all your paths arrays leave that comma in.