On Apr 14, 7:39 am, captain_torche <[email protected]> wrote: > Hello all, > I'm trying to add a listener on a polygon loaded with a kml file. I > tried to do like this : > > map = new GMap2(document.getElementById("map_canvas")); > geoXml = new GGeoXml("http://www.my-domain/my_file.kml"); > map.addOverlay(geoXml); > GEvent.addListener(geoXml, "click", function() { > alert('test'); > } > ); > > but it doesn't seem to work. How could I do to make it work ?
You need to get access to the polygon. GGeoXml makes that difficult, although you might be able to use Mike Williams' interceptor trick: Part 36 Tricks with GGeoXml http://econym.org.uk/gmap/interceptor.htm If not, you will need to use a third party kml parser: EGeoXml: http://econym.org.uk/gmap/egeoxml.htm or GeoXml: http://www.dyasdesigns.com/geoxml -- Larry --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
