I am adding feature layer to the WAB programatically using "map.addLayer("layername") the layer is successfully getting added to the map but it is also adding to the LayerList widget..
and similiarly while removing i am not able to remove it using map.removeLayer as it prevails in layer list widget.
is there anyway i can resolve it and layer list widget dont get involved.
Any help on this highly appreicated
Thanks
Ash
Set 'layerObject._wabProperties.isTemporaryLayer' property to the new layer before it's added to the map.
newLayerObject._wabProperties.isTemporaryLayer = true;
map.addLayer(newLayerObject);
HI ,
May i know what do you mean by _wabProperties here ??
Hi,
I tried out this
featurelayerAdd._wabProperties = { isTemporaryLayer: true };
way its working fine.
Thanks Wang,
But still i am not able to remove layer using
this.map.removeLayer(featurelayerAdd);
I think that cannot remove the layer is not caused by the LayerList widget or WAB, is there any console errors?
No Wang, no console error ,just un-checking the checkbox and the data prevails on the map
Hey Ash:
What file do you place map.addLayer("layername") in the script? What other programming is needed to make this work?
Thanks
Brandon
Hey Xiaodong:
What file do you place map.addLayer("layername") in the script? What other programming is needed to make this work?
Thanks
Brandon