views:

347

answers:

3

Hi,

I was just playing around a bit with google maps and wanted to add a marker to the map after clicking somewhere.

This works fine, except in IE8 (the locations don't show up where i click, but a bit to the left or the right.. can't see a pattern) This is the code:

            GEvent.addListener(map, "click", function(overlay, latlng) {
                map.clearOverlays();
                var marker = new GMarker(latlng);
                map.addOverlay(marker);
            });

The code can be found online at this location: http://sp2hari.com/gmap/event-showinfowindow.html

if i set IE to compatilble mode, it works fine. Anyone now hot to fix this?

A: 

Apparently Google Maps is not currently supported in IE8. Are you able to use the meta tag to put your page in IE7 (compatibility mode)?

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">

You can find the Google Maps API issue here.

Cannonade
Yeah, that's the same i found in other resources.. Oh well, i'll make the specific page with that property then. Thanx
Jeroen
A: 

This tag did not work quite well for me:

Im still getting errors when executing addOverlay ( GMarker ).

Any Ideas? :)

GattusoMatrazzi
A: 

It seems that somewhere in some windows update it was fixed, because if i open the url from the opening post, it works fine, i'm not running in compatible mode, and there is no meta tag in the source.

Jeroen