Calculer l'aire d'un polygone

J'ai besoin d'obtenir l'aire d'un polygone dans ma carte. J'ai cherché un exemple de new google.maps.geometry.spherical.computeArea, mais je ne peux pas le faire fonctionner, et je ne sais pas pourquoi.

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
}
InformationsquelleAutor Hyper | 2012-05-26