i need to get the area of a polygon in my map, i looked for a example of new google.maps.geometry.spherical.computeArea, but i cant do it work and i dont know why..
function dibuV(area){
var i;
var a = new Array();
for(i=0; i<area.length; i++){
var uno = area[i].split(",");
a[i] = new google.maps.LatLng(uno[0],uno[1]);
}
poligon = new google.maps.Polygon({
paths: a,
strokeColor: "#22B14C",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#22B14C",
fillOpacity: 0.35
})
poligon.setMap(map);//until here is ok
var z = new google.maps.geometry.spherical.computeArea(poligon.getPath());
alert(z); //this is not working
}