On Oct 13, 4:34 am, ramasaig <[EMAIL PROTECTED]> wrote:
> I have four polygons on my map.  I want to be able to make each appear/
> disappear separately when I click in the area of the required
> polygon.  So far I have only managed to attach an EventListener to the
> 'map' object, and at the moment one polygon responds to a click
> anywhere on the map (and duly hides and reappears).  See example,
> click map for the red polygon to appear:
>
> http://www.holidaymullandiona.co.uk/maps/firstmap.html
>
> How do I make the individual polygons respond to a click, please ?
You probably want to use the arguments of the map "click" listener:
http://code.google.com/apis/maps/documentation/reference.html#GMap2.Events

click
overlay, latlng, overlaylatlng
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.

  -- 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to