MapModel model = map.getModel();
writer.write(",polygons:[");
for(Iterator<Polygon> polygons = model.getPolygons().iterator(); polygons.hasNext();) {
Polygon polygon = (Polygon) polygons.next();
writer.write("new google.maps.Polygon({");
writer.write("id:'" + polygon.getId() + "'");
encodePaths(context, polygon.getPaths());
writer.write(",strokeOpacity:" + polygon.getStrokeOpacity());
writer.write(",strokeWeight:" + polygon.getStrokeWeight());
writer.write(",fillOpacity:" + polygon.getFillOpacity());
if(polygon.getStrokeColor() != null) writer.write(",strokeColor:'" + polygon.getStrokeColor() + "'");
if(polygon.getFillColor() != null) writer.write(",fillColor:'" + polygon.getFillColor() + "'");
if(polygon.getZindex() > Integer.MIN_VALUE) writer.write(",zIndex:" + polygon.getZindex());
writer.write("})");
if(polygons.hasNext())
writer.write(",");