[Google Maps API v2] Re: Keep mouse pointer as arrow pointer for GMarker hover
Look into 'event delegation'.
http://www.google.co.uk/search?x=0&y=0&q=javascript+event+delegation&ie=UTF-8&oe=UTF-8
Create your markers with clickable:false option so you have your
cursor as desired.
Now create a single event listener listening for the GMap2 'click'
event.
http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMap2.click
"This event is fired when the user clicks on the map with the mouse. A
click event passes different arguments based on the context of the
click, and whether or not the click occured on a clickable overlay. If
the click does not occur on a clickable overlay, the overlay argument
is null and the latlng argument contains the geographical coordinates
of the point that was clicked. If the user clicks on an overlay that
is clickable (such as a GMarker, GPolygon, GPolyline, or GInfoWindow),
the overlay argument contains the overlay object, while the
overlaylatlng argument contains the coordinates of the clicked
overlay. In addition, a click event is then also fired on the overlay
itself."
In that event listener you can detect if an overlay has been clicked
and if so which overlay has been clicked and then take the action
required.
That's assuming that a GMarker with it's clickable proeprty set to
false will still be treated as an overlay by the map click listener -
something you will have to test for.
Martin.
On Dec 1, 3:27 pm, Dylan Leblanc <w...@skyscraperpage.com> wrote:
> Looks like the "clickable" attribute of GMarkerOpts controls this in
> part, but these options can't be changed after the marker has been
> placed, which won't work for me. See the map I have has many markers on
> it which have a onclick to link to another webpage. With so many
> markers it interfears with the ability to double-click on the map to
> zoom-in. So I put in a control outside of the map to turn off the
> marker links (using an HTML checkbox). To get the full functionality of
> this the markers need to be set as clickable:false
--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home