Try make the changes in your code for QueryLayer function: This will select the extent (which will be a rectangle area) for the buffer if it works. I could not make my code to work if I just use the code query.geometry = geometry. I am looking for a solution. function QueryLayer(geometry) { var qTask = 'qTask'; qTask = new esri.tasks.QueryTask(devPlanLayerURL); var query = new esri.tasks.Query(); query.geometry = geometry.getExtent(); query.where = "1=1"; query.outFields = ["*"]; query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS; query.returnGeometry = true; qTask.execute(query, function (featureset) { if (dojo.byId('spanParkActivityContainer')) { dojo.byId('spanParkActivityContainer').style.display = 'none'; } dojo.byId('spanParkListContainer').innerHTML = 'Found ' + featureset.features.length + ' park(s) near the address'; CreateDistance(featureset); }); } So I removed all references to the arcgis online routing task, and the buffer still selects everything. The only data in my app now is my own that all use the same spatial reference. While debugging, I was able to see the extent that is used and it seems to be correct so I am at a loss as to why it would select all the records as opposed to just the ones located in the buffer.
... View more