I am wondering if there's a queryTask for an entire Feature Service (not just layers within a Feature Service)? I am trying to duplicate the functionality located at this site: ArcGIS REST API The main component is that I need to setup the layerDefs parameters. I cannot see anything located in the ArcGIS JavaScript API for this, with the exception of executing an esriRequest. Am I missing something?
Solved! Go to Solution.
Karen,
No you are seeing the same as me there is nothing to indicate the JS API supports querying the whole Feature Service.
Karen,
No you are seeing the same as me there is nothing to indicate the JS API supports querying the whole Feature Service.
If the feature service has an accompanying map service, you could run an identify task on the map service and get results back for every layer.
Hi Bill,
Yes, but you must list lout all layerIds in IdentifyParameters | API Reference | ArcGIS API for JavaScript
Here is a sample that shows how identify tasks run a maplayer with multiple layerIds Display identify results in popup | ArcGIS API for JavaScript
Hope this can help
Hello Bill and Yue:
I am not using the Feature Service for the purpose of performing an Identify. I am wishing to send a query directly to the Feature Service and have it query several of the layers within the Feature Service (each with unique where clauses), and provide back some results. The beauty of this method is that all of the work is done on the server-side, and does not require multiple "deferred" QueryTask requests to the server to capture the data I require. I realize that I could send these asynchronous requests to each layer individually to obtain my results, but this method is much slower then the intended request.
I would think something like this would be quite helpful in the API, no?
Karen