i am using below function to calculate area every time i add and delete a new polygon, It was working fine, but suddenly, i need to change the third party layer which provides polygon vertices for property and now i receive my area in negative value. so in order to co up with it, I added -ve in front of it,
But when i draw a polygon by hand using sketch view model, then i get area in +ve and my area calculated reduces for below formu;la instead of increasing.
Could anyone help me with this??
//Calculate TOtal hectares of Map Geometry
function calculateArea() {
var area = 0;
setTimeout(function() {
graphicsLayer.graphics.map(function (grap) {
area = area+(-(geometryEngine.geodesicArea(grap.geometry, "hectares")));
});
totalAreaHectare=Math.round(area);
jQuery("#hectare").html('<b>'+totalAreaHectare+' HECTARES</b>');
}, 500);
} //End calculateArea