AnsweredAssumed Answered

Design Question - Feature Layer Queries on Client-Side?

Question asked by djrpascu on Mar 16, 2017
Latest reply on Mar 17, 2017 by djrpascu

I've been using a feature service URL off ArcGIS Online and have a Feature Layer based on that endpoint in my JSAPI 4.2 web application.

I see that anytime I update the definition expression or create a query object it makes a network call to the service.

I wanted to minimize server calls and work with the data on the client so I created a FeatureLayer based on graphics imported from a geojson file (based on one of the examples). Then I learned that query objects off a feature layer does not support where, out fields, etc. Per documentation, only the geometry, objectIDs, and spatialreference should be defined. Similar to using a FeatureLayerView.

I'd like to do things like filtering the features, running queries to produce popups, running statistic queries, etc. on the client, and prevent the server-side call. My question then is, does the API support client-side queries? Am I using the wrong layer, should I be using a GraphicsLayer or some other layer? Or do I need to write my own methods for doing the filtering/querying on client?

Much Thanks!

Outcomes