Hey there,

I'm trying to toggle the visibility of a set of Polygones. Basically I
create the Polygones and add them to an array like:

polygon1 = new google.maps.Polygon({ ... });
polygon2 = new google.maps.Polygon({ ... });
polyArr.push(polygon1);
polyArr.push(polygon2);

I'm trying to access each Polygon of the polyArr by looping through
it:

function togglePolygones() {
        for (var i = 0; i < polyArr.length; i++) {
                if(polyArr[i].getMap()) {
                        polyArr[i].setMap(null);
                } else {
                        polyArr[i].setMap(map);
                }
        }
}

It hides all Polygones corrently, but doesn't render them after
another click.

Anyone?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to