Hi,
I am trying to calculate area of polygon using geometry service method arealenghts but it is not returning correct area infect it is returning area in negative.i am using ArcGIS API 1.3 for flex.i am using spatialReference (wkid=4326).below is code i am using
var ploy:Polygon = new Polygon();
poly.addRing(pntArray); //making polygon from mapPoints array
poly.spatialReference = new SpatialReference(4326);
var gra:Graphic = new Graphic();
gra.geometry= poly;
graphiclayer.add(gra);
geomService.addEventListener(GeometryServiceEvent.AREA_LENGHTS_COMPLETE,areaslenghtsCompleteHandler);
geomService.areasAndLenghts([gra]);
private function areaslenghtsCompleteHandler(event:GeometryServiceEvent):void
{
txtArea.label ="Area is "+numFormatter.format(event.arealenghts.areas/1000000)+ " Km2"); //here area is return from geomservice is negative.
}
Any help in this regard is very helpful and any code that can solve my problem .
Regards
Ahmed