Change Dynamic layer visibility

Discussion created by weideccan on Jul 11, 2012
Latest reply on Jul 11, 2012 by weideccan

Suppose I have a dynamic map service with multiple layers, is there a way to control which layer to show/hide from javascript api? For example,

var dLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/map1/MapServer");

And MapServer dLayer has 3 layers:

  • School (0)

  • CityHall (1)

  • River (2)

And I want the web client to control which layer to show. Is this possible with javascript API?