Disabling visibility of a sublayer on the layerlist

1099
2
Jump to solution
06-14-2019 07:45 AM
bobongubza
New Contributor II

I created a legend for features on the map in arcgis javascript 4.10. The issue I have is that I can only disable a sublayer's visibility by disabling all the layers within the parent layer on the layerlist.

I was wondering is there a way to just disable the visibility of a sublayer without disabling all the sublayers when displaying the legend on a layerlist.

0 Kudos
1 Solution

Accepted Solutions
DavidWilson3
Occasional Contributor

you can set visibilityMode in the GroupLayer to "exclusive" so only one child layer is visible at a time, then you should be able to select which layers are visible.

View solution in original post

0 Kudos
2 Replies
DavidWilson3
Occasional Contributor

you can set visibilityMode in the GroupLayer to "exclusive" so only one child layer is visible at a time, then you should be able to select which layers are visible.

0 Kudos
bobongubza
New Contributor II

Thanks for the response. I tried what you suggested and it works. Thanks a lot.