I'm trying to modify a polygon when an event is triggered outside the map control and seem to be hitting a brick wall.
i have a series of divs to the right of my map and would like to change the strokeweight property on the polygon to a heavier line when the mouseenter event is fired and reset it to the default when the mouse leave is triggered.
i would also like to be able to select the polygon when they click on this div
$( ".zonal" ).mouseenter(function() {
for (var i = 0; i < gPolygons.length; i++) {
if(gPolygons[i].id == $(this).attr('id'))
{
gPolygons[i].setOptions({strokeWeight: 6.0});
}
}
});
$( ".zonal" ).mouseleave(function() {
for (var i = 0; i < gPolygons.length; i++) {
if(gPolygons[i].id == $(this).attr('id'))
{
gPolygons[i].setOptions({strokeWeight: 2.0});
}
}
});
i have pushed the polygons out to an array and tried using the following but it doesn't work
gPolygons[i].setOptions({strokeWeight: 6.0});
Here is a visual of what im trying to do, so when they hover over zone 1 the border line of the polygon will get thicker and if the click on the div the relevant polygon will be selected.
Any help appreciated guys

I see the following javascript error in the console:
Uncaught TypeError: gPolygons[i].setOptions is not a function.The
polyobject you are pushing on to both the gPolygons and the polygons arrays is not agoogle.maps.Polygonobject, so it doesn't have asetOptionsmethod.updated fiddle
code snippet: