LayerList will show all layer from map.layers in the list.
We will add layers to map.layers programmatically and don't want to show all layer from map.layers in the list.
How to show specific layers in the list.
Solved! Go to Solution.
LayerList | API Reference | ArcGIS Maps SDK for JavaScript 4.29 | ArcGIS Developers:
To hide layers in the map from the LayerList widget, you must set the listMode property on the desired layers to hide.
Either set the layers you don't want listMode to "hide" or if you have a service with a lot of layers, like a MapImageLayer use the sublayers.
LayerList | API Reference | ArcGIS Maps SDK for JavaScript 4.29 | ArcGIS Developers:
To hide layers in the map from the LayerList widget, you must set the listMode property on the desired layers to hide.
Either set the layers you don't want listMode to "hide" or if you have a service with a lot of layers, like a MapImageLayer use the sublayers.