Hello,
I have a web application that provides the user with several different options to subset the visible features on the map. Most of the subset criteria is applied using a layer's definition expression. One way I would like to allow the user to subset the visible features is to allow the user to draw a polygon on the map and only the features that are within the polygon get displayed. What is the best way to achieve this behavior?
I am currently using ArcGIS Flex API and the layer type is an ArcGISDynamicMapServiceLayer.
Maybe u can do this.
Select Graphics within Extent—ArcGIS API for Flex | ArcGIS for Developers
Evelyn,
Thanks for the quick response! Looking at the example, it appears that it is changing the renderer of each feature based on if it falls within the extent. However, the functionality that I am looking for is basically the exact same functionality as a definition expression, meaning that only the features that match the criteria are considered to be part of the layer (displayed on the map, visible in an attribute table, etc.)
Evelyn,
Do you know if there is a way to include spatial criteria within a definition expression? In my case, I have line features and want to show all line features that are fully contained within a polygon.
Maybe u can make a mix with this and the other link that i just showed u, adding the extent based on user interaction.
Find features in Map Layers—ArcGIS API for Flex | ArcGIS for Developers
Evelyn,
Thanks! I'll check it out and see if I can get it working. I appreciate your suggestions very much!
After just a little more digging, it looks like this is what I am looking for
https://developers.arcgis.com/flex/sample-code/query-result-on-map.htm
It sets the graphicProvider to the results of the query and I think I can put both spatial and attribute criteria in a single query. Thanks again, Evelyn! I wouldn't have stumbled across this without your suggestions!
Ur welcome . It will be useful if u write some code and show us how u solve ur problem cuz anyone else can have the same question.