Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been working on an internet mapping site to include Esri basemap layers, and in-house map services broken out by layer.

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("",{id:'PAT',opacity:.6});
    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 map service e.g.opacity?

share|improve this question
up vote 2 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

Your Answer


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