views:

283

answers:

2

I am using google maps API v3 and have created several polygons on the map. I want the functionality that when the user hovers over a given area (polygon) the individual polygon changes color. Is there any way to do this? (Later I'd like to be able to register mouse events on the given area as well). thanks.

+1  A: 

I managed to figure this out in case anybody else has this issue..

Simply attach an event listener to the polygon object, i.e. mouseover and mouseout events. In the listener simply invoke the setOptions() method on the polygon to set the desired properties.

es11
Please accept an answer so that this is marked as closed.
plexer
A: 

@es11

All I'm getting for an argument within the callback is a MouseOver object, which only contains a latLng object as its only property.

Where are you getting a Polygon object from within the callback?

mattalexx