How does one correctly use a query and QueryTask to retrieve features in a predefined layer that intersect a selected feature?
var queryTask = new QueryTask("http://services6.arcgis.com/3aTanasiPG0rbYg4/arcgis/rest/services/PlatBook_Test/FeatureServer/1");
var query = new Query();
query.returnGeometry = true;
query.outFields = ["SECDIVID"];
query.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
// execute query
queryTask.execute(query);
current piece of code spits out an error of faulty query arguments.
Once the query works the next task will be to output a specific field from the output into an array.
Any help is appreciated, I'm very new to writing scripts and have no idea what I'm doing.
Cheers!
Solved! Go to Solution.
That did it. I suppose when the API documentation says one thing I still need to figure out what they meant, because the two are not always the same.