AnsweredAssumed Answered

Area and length of result features returned by query task

Question asked by fayaz_esri on Jun 30, 2018
Latest reply on Jul 3, 2018 by fayaz_esri

Hello,

 

How can i get the total Area of the result features returned by a query task?

 

 

function showStatistics() {

if (document.getElementById("selQueryLayer").value == 1 && document.getElementById("correspondingLayer").value == 1) {
//dom.byId('amanaList').style.display = 'none';
dom.byId('amanaLabel').style.display = 'none';

var qTask = new QueryTask("http://000.000.000.000:6080/arcgis/rest/services/MDIS/FeatureServer/5");
var query = new Query();
query.where = "1=1";
query.outFields = [""];
query.returnGeometry = true;
qTask.execute(query, showResult);

function showResult(result) {
var resultItems = [];
var resultCount = result.features.length;


var resultArea = ????????????


dom.byId("statisticAll").innerHTML = "Number of Parcels" + resultCount;
dom.byId("AreaTotal").innerHTML = "Total Area" + resultArea;

dom.byId("statisticAll").style.display = 'block';
}
}

Outcomes