Hi All,
I am trying to retrieve the country name. How can I do that? Below is my code that I use to retrieve the province, district municipality, local municipality and wards:
var query = new Query();
query.geometry = view.toMap(event);
query.distance = 0;
query.units = "meters";
query.spatialRelationship = "intersects";
query.returnGeometry = true;
query.outFields = [ "PROVINCE", "DCS12_NAME", "S12_NAME", "WARD_NO" ];
queryTask.execute(query).then(function(results){
var feat = results.features[0];
provinces = feat.attributes.PROVINCE;
wards = feat.attributes.WARD_NO;
districts = feat.attributes.DCS12_NAME;
municipalities = feat.attributes.S12_NAME
showWards.push(wards);
var xwards = showWards.toString();
console.log(provinces);
console.log(wards);
console.log(districts);
console.log(municipalities);
console.log(xwards);
I have tried using
query.outFields = [ "COUNTRY","PROVINCE", "DCS12_NAME", "S12_NAME", "WARD_NO" ];
but it is not working. Please assist
Kind Regards
Siyabonga Kubeka