Reputation: 1876
i am doing the tutorial for displaying the map in a web browser https://developers.arcgis.com/javascript/3/jshelp/intro_agstemplate_amd.html
now I have the code, what if I don't want to display all the layers, and want to turn off the first layer?
i can do it by index of the layer, or can i use the layer name?
trying to understand i got to https://developers.arcgis.com/javascript/3/jsapi/arcgisdynamicmapservicelayer-amd.html but not sure how to use javascript
thanks guys.
Upvotes: 0
Views: 406
Reputation: 326
If you want to turn off and on layers manually, I would use the layerlist widget script LayerList widget
or if you need the option to reorder the layers with the ability to turn layers on or off manually I would use the Reorder layers in map service
Upvotes: 1