2

Is it possible to set the opacity of a cached Tiled Map service using ESRI JS API?

I am using:

var layer;

layer = new ArcGISDynamicMapServiceLayer("URL",
            {"opacity": 0.5});

map.addLayer(layer);

This should work with 50% transparency being set to the layer, right?

2

That will work, but you'll be making dynamic (export) requests to the tiled service rather than using the tiled images.

This should also work:

var layer;

layer = new ArcGISTiledMapServiceLayer("URL",
            {"opacity": 0.5});

map.addLayer(layer);

See this jsfiddle for an example.

  • 1
    This did it - even though your code example was the same as mine, I noticed in my authoring code that I had an title case for "Opacity", when I changed this to a lower case "opacity", the constructor was seen by the webpage and the layer loaded with opacity applied. CASE is v. NB! – BretW Mar 12 '14 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.