Select to view content in your preferred language

How to show specific layers only in the LayerList

544
3
Jump to solution
04-24-2024 12:28 PM
ForrestLin
Frequent Contributor

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.

Tags (1)
0 Kudos
2 Solutions

Accepted Solutions
Egge-Jan_Pollé
MVP Regular Contributor

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.

View solution in original post

0 Kudos
MatthewDriscoll
MVP Alum

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.  

View solution in original post

0 Kudos
3 Replies
Egge-Jan_Pollé
MVP Regular Contributor

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.

0 Kudos
MatthewDriscoll
MVP Alum

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.  

0 Kudos
ForrestLin
Frequent Contributor

@Egge-Jan_Pollé @MatthewDriscoll 

Thank you!

Forrest

0 Kudos