Select to view content in your preferred language

Query Task Fails Unless I pass in exact coordinates...

607
1
02-01-2011 10:18 AM
GISAdmin1
Regular Contributor
Hi there,

I have a simple query task defined for a point layer.  When I override the xy returned from the map with the exact coordinates of the feature, the task works.  Otherwise, no features are identified.  Is there a tolerance parameter I can apply?


function executeQueryTask(evt) {
      
         query.geometry = evt.mapPoint;
                //alert (evt.mapPoint.x + " - " + evt.mapPoint.y )
        evt.mapPoint.x= 511704.446;
        evt.mapPoint.y = 5437075.128;
  queryTask.execute(query, showResults);
 
}
        
0 Kudos
1 Reply
KellyHutchins
Esri Notable Contributor
The identify task allows you to specify a tolerance but the query task does not.

http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/identifytask.htm

If you want to use the query task to query points you'll have to generate a tolerance. This blog post has some sample code that does this:

http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2009/01/15/Querying-points-and-lines-on-click-w...
0 Kudos