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.

I've been working on an internet mapping site to include ESRI basemap layers, and in-house mapservices broken out by layer.. I have gotten that far..

I am also still fairly new to javascript..so, this might be a javascript question..

Here is the code for the mapservice and the layers I am accessing..

var patLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gis.co.frederick.va.us/ArcGIS/rest/services/Planning/Planning_PAT/MapServer",{id:'PAT',opacity:.6});
    patLayer.setVisibleLayers([7,6,1,2,3,4]);
    legendLayers.push({layer:patLayer,title:'Planning Layers'});

What I am not sure of is how to set the options only for specific layers and not just the entire mapservice.. such as opacity.. Any help is greatly appreciated..

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

With a dynamic map service layer, you cannot specify opacity for individual layers. You can specify visible layers and queries on individual layers but you can only set opacity for the entire map service. See the documentation for specifics: ArcGISDynamicMapServiceLayer.

share|improve this answer
    
I was afraid of that. If I wanted to do that would I have to use something other than a dyanamic mapservice layer? –  Not to be named Oct 8 '10 at 13:47
    
Yes, you can only change the opacity of an entire map service via the JS API. How many layers are you dealing with? –  Derek Swingley Oct 8 '10 at 14:05
    
Any updates or suggestions on this? I am dealing with a similar issue where I have a dynamic map service layer with 10-15 sub layers. What would be a better solution if I want to have multiple layers and control their opacities? –  snowgage Mar 7 '13 at 14:50
add comment

Your Answer

 
discard

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