How to remove layer from map in Web AppBuilder

371
3
Jump to solution
05-17-2020 12:37 AM
Shalineemishra
New Contributor II

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

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

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 

View solution in original post

3 Replies
DavidPike
MVP Regular Contributor

If you want to remove layers you will need to remove them from the WebMap which the app is based on.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

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 

View solution in original post

Shalineemishra
New Contributor II

Thank you so much

0 Kudos