AnsweredAssumed Answered

Layer List Widget nodes not synchronizing for dynamic layer

Question asked by epuriarun on Nov 30, 2018
Latest reply on Dec 4, 2018 by epuriarun

Hi All,

 

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': dynamicData[key].visible,
'opacity': dynamicData[key].opacity
});
dynamicLayer.setVisibleLayers([-1,-1,20,21,23]);

map.addLayer(dynamicLayer);

 

Please suggest, if I am missing any code/ property which needs to set.

 

Thanks,

Arun E

Outcomes