I have a map with a KML layer that displays a simple crosshair in the center
of the screen. As it stands the crosshair blocks clicks from registering on
the map. My attempt to forward clicks on the KmlLayer to the map looks like
this:
// Init crosshairs
var crosshairsLayer = new
google.maps.KmlLayer('http://madan.org/treksee/crosshairs.kml', {
map: g_map,
preserveViewport: true,
suppressInfoWindows: true
});
// Forward click events on the crosshairs to the map (except it doesn't
work)
google.maps.event.addListener(crosshairsLayer, 'click',
function(kmlEvent) {
alert('Why did you click on the crosshairs?');
google.maps.event.trigger(g_map, 'click', kmlEvent.latLng);
});
But this doesn't work. You can see it in action (inaction?) here:
http://madan.org/treksee
Clicking on the map will draw a marker. Clicking on the crosshair should
show an alert and draw a marker, but it currently does nothing.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.