JavaScript Google map polygon not rendering correctly in IE (9 and 10)

I hope this question is not confusing or too complex. but here we go: I'm creating a custom google map that renders some US states as polygon overlays with the "google.map.Polygon' method. Everything seems to work in all browsers as shown in the picture below, Polygons in Chrome,Firefox,Safari and Opera

When I say "all browsers", they are Chrome,Firefox,Safari and Opera. But when it comes to IE (9-10) the Polygon shapes seem to brake in half and also shrinks as shown here:

Polygons in IE (9-10)

Like I said before, I'm using the google polygon method :

 var obj = new google.maps.Polygon({
    paths: coords,
    strokeColor: sColor,
    strokeOpacity: sOpacity,
    strokeWeight: sWeight,
    fillColor: fColor,
    fillOpacity: fOpacity,
    lat:cLat,
    lng:cLng,
    north_bound:cNorthBound,
    south_bound:cSouthBound,
    name:name
    });

and the shape coordinates points come from a XML file like this : //I'm just placing the code to give a better idea how the whole thing is put together

<state name="Louisiana" strokeColor="#D6D1CB" strokeOpacity="1" strokeWeight="2" fillColor="#004E98" fillOpacity="1" lat="31.2448234" lng="-92.1450245" north_bound="33.019544,-88.8162401" south_bound="28.9254296,-94.043352">
   <point lat="33.0225" lng="-94.0430"/>
   <point lat="33.0179" lng="-93.0048"/>
   <point lat="33.0087" lng="-91.1646"/>
   <point lat="32.9269" lng="-91.2209"/>
   <point lat="32.8773" lng="-91.1220"/>
   ..... etc

The problem is not passing the data or creating the shape, but rather the way it renders in IE 9&10. I have googled and tried several alternatives for days on how to fix this issue, but none of them worked, this is what I have tried so far:

  • using IE compatibility mode ()
  • using IE backwards compatibility ()
  • using a prefixer in case it was a css/html5 issue ( used prefixer.js)
  • using excanvas for IE compatibility
  • using modernizer (but it shows that IE supports canvas, but don't know how extensive the support may be.
  • using html5shiv, in case IE had issues with html5 elements
  • changing all the css to display as block (including the canvas tag)
  • checking in both Firebug and IE tools console for bugs, but none detected.
  • Check all functions for errors, but none detected

If I click on the IE's compatibility button

IE compatibility button

the code changes from:

standard IE source code rendering

to:

compatibility source code

Which is the view for compatibility for old browsers, so I suppose the google map renders differently ( without the canvas ) and then it shows the polygons correctly but brakes the rest of the html5 element and css in the page. Besides this is controlled by the user, not the site.

enter image description here like you can see in the in the picture above.

So my questions (possible solutions/thoughts) are:

  • Is there a way to force the google map to render without the canvas for IE browsers only?
  • Is this related with the any css attribute that I'm not aware of?(it doesn't use css to create the states shapes, but just in case)
  • Is there any JS to fix this type of issue?
  • Is there anything I'm missing when it comes to google maps and IE?
  • Any other thoughts you guys may have?

Thanks in advance for any input/help :)

Answer:1

I did take the whole thing apart as Michael Geary suggested, and it turns out that for google maps in IE the css inheritance might affect how the Polygon is render on screen. The individual polygon layers where inheriting the css "height:auto" from one of it's parents and it seems that IE9&10 are very delicate with this. So the answer was removing "height:auto" from the css file in the parent element (container box).

Answer:2

I'm looking for a way to, from a backbone collection, retrieve some kind of array of one specific attribute. var SomeModel = Backbone.Model.extend({ defaults: function() { return { ...

I'm looking for a way to, from a backbone collection, retrieve some kind of array of one specific attribute. var SomeModel = Backbone.Model.extend({ defaults: function() { return { ...

To see the result, open console in Google Chrome, do the following: obj = new Boolean(false) "obj && true: " + (obj && true) "obj || true: " + (obj || false) and: (obj && ...

To see the result, open console in Google Chrome, do the following: obj = new Boolean(false) "obj && true: " + (obj && true) "obj || true: " + (obj || false) and: (obj && ...

  1. javascript snake
  2. javascript foreach
  3. javascript map
  4. javascript for loop
  5. javascript array
  6. javascript substring
  7. javascript switch
  8. javascript reduce

I have the following HTML: <ul> <li></li> <li></li> <li></li> </ul> and the following jQuery code: $('> ul li', body).each(function() { $('...

I have the following HTML: <ul> <li></li> <li></li> <li></li> </ul> and the following jQuery code: $('> ul li', body).each(function() { $('...

  1. jquery swap tag
  2. jquery switch tag

I have a datepicker, and I need to be able to enter a date manually in multiple different formats. For example, for May 7, 2015, I need to be able to enter: 05/07/2015 05072015 050715 5715 I ...

I have a datepicker, and I need to be able to enter a date manually in multiple different formats. For example, for May 7, 2015, I need to be able to enter: 05/07/2015 05072015 050715 5715 I ...