AnsweredAssumed Answered

How to use Query() to pull intersecting features through a widget

Question asked by Stahly on Feb 17, 2017
Latest reply on Feb 20, 2017 by Stahly

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("");
var query = new Query();
query.returnGeometry = true;
query.outFields = ["SECDIVID"];
query.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
// 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.