LayerList widget bug (arcgis js api 4.x)

810
1
Jump to solution
09-22-2020 07:36 AM
AlexanderRyzhov2
New Contributor II

LayerList widget has a documented feture:

To hide layers in the map from the LayerList widget, you must set the listMode property on the desired layers to hide.

I tried to use this feature over several layers in a loop and found strange behavior - only each "second" layer is hidden when you change listMode property of several layers in a loop.

Here is an example: https://codepen.io/alexanderryzhov/pen/OJyrPdj 

If you turn off "first half" of layers (from 0 to 4) only layers 0,2,4 are hidden actually and #1 and 3 are still here!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KristianEkenes
Esri Regular Contributor

Hi Alexander,

This bug has been fixed in a later version of the API. You can verify it on our "next" version: 

<script src="https://js.arcgis.com/next/"></script>

View solution in original post

1 Reply
KristianEkenes
Esri Regular Contributor

Hi Alexander,

This bug has been fixed in a later version of the API. You can verify it on our "next" version: 

<script src="https://js.arcgis.com/next/"></script>