Can we disable or enable layers in Layer list widget programmatically. I have a RestAPI where permissions are checked and based on that i need to disable or enable layers in Layer List Widget.
I tried adding below code in showLayers function but it dint work.
this.config.layerOptions["roads_5062"].display = false
Is there any other place i need to set this, Please guide me on this.
Thanks in Advance.
Kafil,
Here is how to hide certain layer in the LayerList widget:
https://community.esri.com/thread/228186-layerlist-widget-programatically-filter-layers
Hi Robert,
I tried to implement this code but no result. Please let me know where exactly I need to place this code to work .
I don’t want to click the button of layer widget. It should automatically disable on startup .
Sent from my iPhone
Kafil,
I do have exact directions for your workflow. I have provided a link to a method that use a button click, but that same code can be used when the widget starts based on your requirements.