I\'m building a map using the google v3 api because it is way faster. Essentially, it\'s a map of an area with about 30 cities with polygons over the regions. When a user hovers
In Google Maps API V3, I have a rollover for a polygon with the below code. I do not like that I have to unset and reset the map each rollover, but, at this point in time, this is how I achieved a mouseover.
I am interested in any comments on how to improve this code.
var polyShape = new google.maps.Polygon({paths:polyData,strokeColor:"#aa0",strokeOpacity:0.5,strokeWeight:1,fillColor:"#cc0",fillOpacity: 0.25});
var polyShapeOver = new google.maps.Polygon({paths:polyData,strokeColor:"#cc0",strokeOpacity:0.5,strokeWeight:1,fillColor:"#ff0",fillOpacity: 0.25});
polyShape.setMap(map);
google.maps.event.addListener(polyShape,"mouseover",function(){
this.setMap(null);
polyShapeOver.setMap(map);
});
google.maps.event.addListener(polyShapeOver,"mouseout",function(){
this.setMap(null);
polyShape.setMap(map);
});