Adding click event to KMLLayer Placemarks and Markers
问题 How do i attach an onclick event to Placemarks specified in the KML file. Can event listeners be added to both google maps and google earth plugin? How would I go about this? 回答1: In the Google Earth plugin... google.earth.fetchKml(ge, href, function(kmlObject) {}); google.earth.addEventListener(kmlObject, 'click', function(event) { event.preventDefault(); var kmlPlacemark = event.getTarget(); alert(kmlPlacemark.getName()); }); In Google Maps API var ctaLayer = new google.maps.KmlLayer('http: