Define Opacity to some layers from ArcGISDynamicMapServiceLayer

2015
4
09-02-2013 03:08 PM
DavidMendoza
New Contributor
Hi again

I'm working with a Rest Service as ArcGISDynamicMapServiceLayer. It is posible to set opacity to this ArcGISDynamicMapServiceLayer by the code servicioRest.setOpacity(value/100) ,  but it does to all layers on the Rest Service, and I want to set opacity to only some layers from the Service. Is it posible? I've been looking for a solution on the API (https://developers.arcgis.com/en/javascript/jsapi/arcgisdynamicmapservicelayer-amd.html) without results.


Thanks for help 🙂
0 Kudos
4 Replies
VinayBansal
Occasional Contributor II
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.

One solution could be :
If you have some particular layer in map service for which you want to add transparency, add it as a feature layer. Since you can control the transparency of feature layer.
0 Kudos
DavidMendoza
New Contributor
Vinay Bansal, effectively I tried adding a feature layer, but I wanted to know if it was possible to make it by other way.

It would be great to make it possible, how ever, Thanks for answer 😄

See you!

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.

One solution could be :
If you have some particular layer in map service for which you want to add transparency, add it as a feature layer. Since you can control the transparency of feature layer.
0 Kudos
JohnGravois
Frequent Contributor
vinay is not actually correct here.  at ArcGIS Server 10.1, it is possible to publish a dynamic layers capable map service which allows you to manipulate the renderer for individual layers from the client when asking for a dynamic map service tile to be drawn.

see this sample and the api reference for more information
0 Kudos
DavidMendoza
New Contributor
John Gravois, Thanks for answer, I'll view the example, actually I don't have access to ArcGIS Server 10.1, but soon I will have it.:)

vinay is not actually correct here.  at ArcGIS Server 10.1, it is possible to publish a dynamic layers capable map service which allows you to manipulate the renderer for individual layers from the client when asking for a dynamic map service tile to be drawn.

see this sample and the api reference for more information
0 Kudos