2 Mar 2009

Obrysowanie granic Polygonu

polygon = new GPolygon(points, "#00A000", 1, 1, "#00ff00", 0.1, {clickable: true});

var bounds = polygon.getBounds()
//for(var i=0;i<points.length;i++){bounds.extend(points[i])}

var pSW = bounds.getSouthWest();
var pNE = bounds.getNorthEast();

var pNW = new GLatLng(pSW.lat(), pNE.lng());
var pSE = new GLatLng(pNE.lat(), pSW.lng());

var points2 = [];
points2.push(pSW);
points2.push(pNW);
points2.push(pNE);
points2.push(pSE);
points2.push(pSW);
polygon2 = new GPolygon(points2, "#00A000", 1, 1, "#00ff00", 0.1, {clickable: true});