Check out these threads: http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/101a166f99d7620c/9d3bdb27d40780e8 http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/9e27106745d7836f/f410b58f4bcde00d
One other way would be to implement a custom control. Chris On Wed, Jan 5, 2011 at 3:08 PM, sam <[email protected]> wrote: > 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]<google-maps-js-api-v3%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > -- 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.
