DuncanRager

Setting Default Visibility

Discussion created by DuncanRager on Jul 7, 2011
Latest reply on Jul 15, 2011 by DuncanRager
Greetings,

I'm attempting to create a list of checkboxes for the user to toggle the visibility of feature layers in a dynamic map service layer. I want to start the application with one feature layer visible, while the others remain off.

The sample shown here: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm

...uses the 'layer.layerInfos.defaultVisibility' property to determine which checkboxes are turned on from the start.

Even though I use:
layers = new esri.layers.ArcGISDynamicMapServiceLayer("http://server/ArcGIS/rest/services/features/MapServer"
  );
  layers.setVisibleLayers([0])
 }


...to set the initial visibility, that doesn't alter the default visibility property for the other feature layers, so the sample script doesn't work.

Anybody know how to adjust this property?

Thanks,

DR

Outcomes