Select to view content in your preferred language

Hiding the eyeball icon (visibility toggle) for just one of the GroupLayers in a LayerList

468
4
08-12-2024 01:38 PM
andrewc213
Emerging Contributor

andrewc213_0-1723494869091.png

Is it possible to hide just one of the eyeball icons in a LayerList? For example, the Base layer GroupLayer object's visibilityMode attribute is set to "exclusive", meaning exactly one child layer will always be active, but I want to take it one step further and ensure that the sole active child Base layer is always visible. To do that, I want to get rid of the eyeball icon that the screenshot shows. But I want to hide only that eyeball icon, and not the eyeball icon of "Reference layers". Is this possible?

 

4 Replies
Sage_Wall
Esri Regular Contributor

I don't know of any way to remove the eyeball from the single layer but you could remove that layer from the list with Layer.listMode set to hide.  This would remove the entire Reference layers group layer from the list but it would still be on the map.

0 Kudos
andrewc213
Emerging Contributor

Hmm, okay. Then I'll just leave the LayerList as is. I need to keep the Reference layers GroupLayer in the LayerList, but I think, for my situation, it's fine the way it is, then.

0 Kudos
Forestkane
New Contributor

Did you find an Answer to this it seems bad that is in just default. I want to add the layer list into custom Widgets as a selection menu and have visibility is not important.  

0 Kudos
Sage_Wall
Esri Regular Contributor

Hi @Forestkane ,

You might consider using a Calcite Select, List or something like it and simply populate the options or list items from the Map.layers collection. On the the primary uses of the Layer List is to control the visibility of layers, but we can consider making displaying the visibility button optional with a property with the design team. 

0 Kudos