Hi Akshay,
I am having the same issue as you mentioned. But whatever you mentioned in the above code that is already in LayerList\Widget.js.
Can you please explain your solutions in details and from where you called this function. If possible code snippet will be helpful.
I am using WAB 2.8 default Layer List widget.
When I add any dynamic layer to the map through another custom widget as per below code.
the map is showing properly with the visible layers which are provided with a SetVisibleLayers option. But the same is not reflecting in LayerList widget and default it is considering map service Default Visibility property and showing all nodes as checked even though on the map that layers are not visible.
Code:
I added a sample water network map service
Water_Network (MapServer)
var dynamicLayer = new ArcGISDynamicMapServiceLayer(url, {
'visible': true
});
dynamicLayer.setVisibleLayers([-1,-1,20,21,23]);
map.addLayer(dynamicLayer);
Thanks
Arun E