Query Attributes from AGSShapefileFeatureTable | swift

463
1
05-14-2020 01:39 PM
Starboy84
New Contributor

I need help regarding an issue. I have an AGSShapefileFeatureTable loaded from shapefile. I want to search for attributes from this feature table.

When the specific attribute is searched only it should be showing on Map.

0 Kudos
1 Reply
Nicholas-Furness
Esri Regular Contributor

There are a few approaches to this (you've asked for option 3, but I figured I'd present some other commonly used approaches too):

  1. Select the feature. This will keep all features visible but will highlight the one you want.
  2. Use an AGSGraphicsOverlay to draw a copy of the feature as an AGSGraphic (perhaps with different styling). This is similar to selecting the feature but gives you more control over what and how to display. You could also consider hiding the original feature layer (using the visible property) while the graphics overlay is displayed.
  3. Use the definitionExpression on the AGSFeatureLayer. You can either provide the attribute search used the query, or if you have the feature's ID, you can set the SQL expression to reference that ID.

Hope this helps.

0 Kudos