Select to view content in your preferred language

Search all feature layers for a feature

437
4
10-12-2022 01:19 AM
Aeseir
by
Occasional Contributor

Is there a proper way to bulk search all map feature layers to find a specific feature programmatically by an Object ID or similar attribute?

currently i have to identify the right feature layer, then search that feature layer for the feature, which gets really painful once you have more than one feature layer

0 Kudos
4 Replies
BlakeTerhune
MVP Regular Contributor

Is this search initiated by clicking a point on the map or by entering a value?

0 Kudos
Aeseir
by
Occasional Contributor

Programmatically, I have an ID for the feature, so i want to programmatically get the feature from the FeatureLayer that corresponds with that ID.

0 Kudos
BlakeTerhune
MVP Regular Contributor

Is there only ever exactly one match for a given ID among all the feature layers? In the process of you getting the ID for the feature, there's never any way to determine which feature layer it's intended for? Maybe you can use a combination of fields so you know which feature layer to search?

0 Kudos
Aeseir
by
Occasional Contributor

Each feature has a unique UUID that is assigned. That UUID is applied to ID field (not ObjectID). 

My current processes i have built a workaround where I store the feature layer id with the feature as FL_ID, then i extract that feature layer id when i pull the feature data down.

I then do a find layer by FL_ID and then queryFeatures() against that feature layer to get the list, with [0] index being the feature i need.

Ideally if there was a way to say poll the entire layer list for single feature by ID, would simplify the process, thus reducing tech debt.

0 Kudos