Setting transparency on sublayers of an ArcGISDynamicMapServiceLayer?

4828
7
03-27-2012 06:02 AM
Luiza_Helenada_Silva
New Contributor
I am working on a Flex component to allow users to change a layer's transparency. This component gets what layer to use from another component that is a TOC. I want to be able to change the transparency of a sublayer in an ArcGISDynamicMapServiceLayer, but I see that the item type I get is LayerInfo (no alpha...).

Is this possible at all, or can I only change transparency on the entire map service layer (thus affecting all the sublayers)?

Any insight would be appreciated!

(Note: I am using Flex API 2.4).

Thanks,
-Luiza
Tags (2)
0 Kudos
7 Replies
FaizanTayyab
Occasional Contributor
I think at the moment it only works with the map service itself and not the sublayers.
0 Kudos
IvanBespalov
Occasional Contributor III
ihdasilva,

no, it is not possible. (The only way, if you initialize each sub layer as ArcGISDynamicMapServiceLayer :rolleyes: )

Here is important to understand how is it works.

1 - ArcGISDynamicMapServiceLayer is container for IMAGE exported from server,
parameters you set for ArcGISDynamicMapServiceLayer are IMAGE export parameters.
Not 55 images for 55 sublayers, but 1 image exported form server for 55 sublayers.

2 - Flex Map is container for all layers:
static layer (navigation, scalebar, copyright, logo ...),
map layers (each 1 is something like flex display object / container ))
The transparency you set for ArcGISDynamicMapServiceLayer is alpha parameter for flex component (for IMAGE - 1 image for 55 sublayers)

Right?

Look at this discussion. May be you do not need to change transparency in flex code, but you set layers transparency in mxd file.
0 Kudos
DasaPaddock
Esri Regular Contributor
You can control the transparency of the sublayers if you're using ArcGIS 10.1 and the 3.0 API.

See:
http://resourcesbeta.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/supportClasses/LayerDraw...
0 Kudos
YungKaiChin
Occasional Contributor
One opinion (if there really is not other way) is to romove the sublayer from the mapservicelayer in code and to bring in the same mapservicelayer again with only the sublayer.
0 Kudos
AaronBarkhurst
New Contributor
So does the same hold true for the ability to move the sublayers (children) up and down in the TOC and map drawing order? I have set the ability to drag and drop layers in the TOC, the UI allows the ability to move the sublayers, but the map/toc reorder only applies to the parent layers. Is there a way to allow users to reorder the sublayers both in the TOC and map drawing/layering?
0 Kudos
SmithaNivesh
New Contributor

Is it possible to do the same in Javascript API v31.4 arcgis 10.3 version?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Smitha,

    Questions like this should be posted to the JS API space. Here are some similar threads in the JS API Space:

Change Transparency of Layer in MapService

setLayerDrawingOptions is not changing transparency setting

0 Kudos