AnsweredAssumed Answered

QueryTask return points inside and extent

Question asked by Matthew.Ryan on Jun 30, 2016
Latest reply on Jun 30, 2016 by fcbassongis

I can't figure out a way to send a query to an ArcGIS rest endpoint asking for all the points which are contained within an extent. Does anyone know how to do this? Below is some code I've tried (sensitive information removed).


var extent: esri.geometry.Extent = new esri.geometry.Extent(pointMinX, pointMinY, pointMaxX, pointMaxY, point.spatialReference);


var queryTask: esri.tasks.QueryTask = new esri.tasks.QueryTask({ArcServiceURL}, null);


var query: esri.tasks.Query = new esri.tasks.Query();

query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS; // what to use here???

query.geometry = extent;           

query.returnGeometry = true;

query.outFields = ["*"];           

query.where = "1 = 1";


map.setExtent(extent); // This works. Changes to the correct extent.



The question again -- How can I send and extent in a query so that it brings back all the points contained inside that extent?