Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This webmap project I keep working accesses mutilple layers within a couple different mapservices. I would like to learn how I can load the layers without them drawing. I've recently incorporated check boxes instead of links to turn each layer on and off. They work but in the reverse way I want them to.

I've not been able to figure out how to keep the layers from drawing until I select a checkbox.. Any ideas or help would be appreciated.. Thanks..

here is a link..

http://www.co.frederick.va.us/planning/newmap1copy2.html

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I use the visible parameter of the options when I create the layer:

var layer = new esri.layers.ArcGISDynamicMapServiceLayer(mapServic eUrl, { id: layerId, visible: false});

The id parameter lets you specify the name of the layer, so you can use the name to get the layer from the map's layer collection. The visible parameter set the default visibility of the layer.

See the constructor in JSAPI Reference for ArcGISDynamicMapServiceLayer .

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.