Friday, 8 November 2019

query - Is there a "Select by Attributes" plugin/widget for ArcGIS Server JS API?


I'm hoping to find some existing code which emulates the "Select by Attributes" dialog in ArcMap, within the ArcGIS Server JavaScript API.


Writing a hard-coded QueryTask is easy - I'm looking for some code which will automatically handle any layer on the map, forming a Query on-the-fly using any attributes, ideally returning the results into a datagrid.



Clever people have written Table of Contents and Identify widgets which handle any layers in the map. Has anyone written something similar for "select by attributes"?



Answer



A couple of years later, I was looking for exactly the same thing as the OP. This question shows up in the top results of a search engine, so I decided to leave this update here as a reference.


In the Summer of 2015, Esri has released a Select by Attributes Widget in their GitHub repository.



This widget attempts to recreate ArcMap's select by attributes tool as accurately as possible within a JavaScript application. This widget only works with feature layers and these must be passed to the widget's constructor as an array.



Live Sample


No comments:

Post a Comment