IE and metadata_change event

80 views
Skip to first unread message

Enrico

unread,
Oct 1, 2010, 7:36:29 AM10/1/10
to Google Maps JavaScript API v3
Hi all,

i have a problem with IE (strange thing)
I have a map with a kml layer and a overlayView with a lot of polygon.

I do the setMap of kmlLayer before that the overlayLayer but the kml
is painted over the other.
To change this i do something like this:

isKlmLoading = true;
kmlLayer.setMap(map);
var listener = g.event.addListener(kmlLayer, 'metadata_changed',
function(){
isKlmLoading = false;
showOverlay(map, zoom);
g.event.removeListener(listener);
});

In showOverlay
if (!isKlmLoading)
overlay.setMap(map);


It work with every browser but IE seem that sometimes is not firing
the metadata_changed event.
In every zoom change I need to change the kmllayer and the
overlaylayer. On load it work, and the the first time that i go to a
zoom, the kml is loaded but the event is not fired, the second time
that i go to the same zoom, the event is fired...
What can I do (forgettin IE is not a solution ;) )?

Chad Killingsworth

unread,
Oct 1, 2010, 10:59:46 AM10/1/10
to Google Maps JavaScript API v3
First thing you can do is post a link to the your map - as stripped
down as possible and yet still exhibiting the behavior. Then you'll
have other people verify your findings and go from there.

Chad Killingsworth

Rossko

unread,
Oct 1, 2010, 11:56:59 AM10/1/10
to Google Maps JavaScript API v3
> kmlLayer.setMap(map);
> var listener = g.event.addListener(kmlLayer, 'metadata_changed',

You're hoping the browser will find time to register the listener
before it has completed the setMap. I think it would be smart to set
the listener up first.

Enrico

unread,
Oct 4, 2010, 4:06:45 AM10/4/10
to Google Maps JavaScript API v3
Hi,
it seems the problem... a novice error :P
Thank you very much!
Reply all
Reply to author
Forward
0 new messages