Hi
I am trying to remove layer from map in my web application.And I have removed the layer from the LayerList widget but this layer show on my map.so please suggest how to remove or hide this layer on map using JavaScript API
Solved! Go to Solution.
If you want to remove a layer from the WAB map in JS code then you would use.
this.map.removeLayer(this.map.getLayer("incidentLayer"));
https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#removelayer
If you want to remove layers you will need to remove them from the WebMap which the app is based on.
Is this still true? I'd like to show just a couple of the webmap layers in my webmap app.
If you want to remove a layer from the WAB map in JS code then you would use.
this.map.removeLayer(this.map.getLayer("incidentLayer"));
https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#removelayer
Thank you so much