AnsweredAssumed Answered

Hiding items from layer list

Question asked by Bleroux on Dec 15, 2016
Latest reply on Dec 15, 2016 by rscheitlin

I am just starting out with WAB and I am trying to figure out how to keep certain items off the layer list widget. I am dynamically loading a couple ArcGISDynamicMapServiceLayer layers upon a widget load. One of the services has a table on the service that I am trying to not show in the layer list. The other service I only want to see some layers on the layer list. Any ideas?

 

startup: function() {
this.inherited(arguments);
//this.mapIdNode.innerHTML = 'map id:' + this.map.id;
console.log('startup');
//Load wildfire layer but only show first 4 layers
geoMacLayer = new ArcGISDynamicMapServiceLayer("https://rmgsc.cr.usgs.gov/arcgis/rest/services//geomac_dyn/MapServer");
geoMacLayer.setVisibleLayers([0,1,2,3],true);
this.map.addLayer(geoMacLayer);

//Load policy layer but to not show table (layer 2) in layer list
policyLayer = new ArcGISDynamicMapServiceLayer("http://myserver/arcgis/rest/services//Policies/HOPolicies/MapServer");
policyLayer.setOpacity(0.75);
policyLayer.setVisibleLayers([0,1],true);
this.map.addLayer(policyLayer);

}

Outcomes