featureLayer.queryFeatures doing client query when a server one is needed

698
4
12-28-2017 11:44 AM
SamuelAbati
New Contributor III

According to featureLayer.queryFeatures documentation FeatureLayer (legacy) | API Reference | ArcGIS API for JavaScript 3.23 

It will somestimes do a client query when possible, problem is I need it to do a server query.

I'm doing a query using objectids instead of wheres, and I'm changing the spatialReference of the query.

But instead it gives me the cache'd one that has another spatialReference (webMercator), different from the one specified in the query object.

How can I force it to make a server query? Or solve the issue in any other way.

I don't even understand why it gives me mercator by default when the server specifies another SRID.

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Samuel,

   What query properties are you using? Have you tried to add a where 1=1 as well as the OIDs? If all else fails you can do a QueryTask using the FeatureLayers URL instead.

SamuelAbati
New Contributor III

Hey, the only properties I set where the objectIds and outFields, even with adding where 1=1 still defaults to outSR 102100 when my service specifies another one.

Also it is changing the maxallowableoffset without me setting it, so some small lines we have on the server are coming as points.

This only started happened when I deployed our application in our enviroment, so do you know if its possible someone else set default configurations for queries? Can you even configure this using the API? I haven't found anyting about it

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Samuel,

The FeatureLayer queryFeatures as three restrictions. one is this:

  • The outSpatialReference set by the query object is ignored and the map's spatial reference is used.
SamuelAbati
New Contributor III

Ah I think I figured it out, it got the default values from the FeatureLayer that got from the Map, that has to be it.

0 Kudos