Select to view content in your preferred language

Hiding items from layer list

3202
10
Jump to solution
12-15-2016 06:49 AM
BrianLeroux
Regular Contributor

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);

}

Tags (1)
0 Kudos
10 Replies
WilliamBailey
New Contributor II

No, I did not... but was very easy to retrofit with one folder and one config file.

I am all good now, thank you for your help.

0 Kudos