I have a an application with a feature that I'm running a selectFeatures command on. When I created the feature layer, I put it in MODE_SNAPSHOT which should make everything available via the client.
According to the documentation, https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#selectfeatures, the query should run on the client, but when I look as the NET tab in the browser I can clearly see the features getting fetched from the server.
Here is jsFiddle that should illustrate the problem: http://jsfiddle.net/nawm78kp/1/
Am I missing something?
Solved! Go to Solution.
Figured it out by digging into the "_canDoClientSideQuery" function associated with the feature layer. It appears as though the Query has to be of a very specific type for it to work.
The Query spatialRelationship must be set to "SPATIAL_REL_INTERSECTS" and the geometry type must be an extent. This seems overly restrictive and does not appear to be documented anywhere.
Here is a working fiddle: http://jsfiddle.net/nawm78kp/2/
Figured it out by digging into the "_canDoClientSideQuery" function associated with the feature layer. It appears as though the Query has to be of a very specific type for it to work.
The Query spatialRelationship must be set to "SPATIAL_REL_INTERSECTS" and the geometry type must be an extent. This seems overly restrictive and does not appear to be documented anywhere.
Here is a working fiddle: http://jsfiddle.net/nawm78kp/2/