Hello all
Is there a way to get a reference to a feature layer within nested groups. I have built an experience and I am developing a custom widget that needs to select from one of the feature layers e.g Feature layer 1(see structure of the web map below),present the selected records on the widget so the user can use some of the selected records to drive further analysis
Group1
-Sub Group1
-Feature layer 1
-Feature layer 2
-Sub group 2
-Feature layer 3
-Feature layer 4
Group 2
-Sub group 2
- Feature layer 5
- Feature layer 6
I have followed this example here https://github.com/EsriDevEvents/arcgis-experience-builder-customizing-and-extending-2022/blob/main/ts-05-select-from-data-sources/src/runtime/widget.tsx
I can't figure out a way of getting a reference to any of the feature layers nested in groups in my Map widget
Essentially I need a reference the Feature layer in way that is similar to this
const layer = this.state.jimuMapView.view.map.layers.getItemAt(0) // as FeatureLayer
It looks like this.state.jimuMapView.view.map.layers can only access the top level groups. In my example above that will be Group 1 and Group 2.
Is there a way of getting a reference to feature layers nested in groups? Is there an alternative way to achieve this that does not necessarily follow this workflow?