Select to view content in your preferred language

coloring layers of an ArcGISDynamicMapServiceLayer

2642
3
03-25-2014 09:34 AM
RolfSchleicher
New Contributor
i have a project in which in need to color each of the five layers of a service differently with a colorpicker. I have a DataGrid which generates in the first column a checkbox to switch the layer on/off (like in the samples) the second column gets the layer's name (1970, 1980,..) third column set's a colorpicker vor each layer. What happens is when i change the color of one of the colorpickers it change the color of all five layers and not only just for one! When i trace layerInfo.layerId in my change function i'll get the color i selected in the colorpicker the right ID (like 1st colorpicker = ID 0; 2nd = ID 1;...) too.

Here's my color picker change function:

public function LayerColor(color:ColorTransform, layerInfo:LayerInfo):void {
        var dynamicLayer_color:ArcGISDynamicMapServiceLayer = mapLayer as ArcGISDynamicMapServiceLayer;
        dynamicLayer_color.transform.colorTransform = color;
}


[ATTACH=CONFIG]32490[/ATTACH]

Any ideas will be appreciated!

Steve
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Steve,

   This issue you are encountering is that an ArcGISDynamicMapServiceLayer is technically just an image of all the layers that makeup the map service. If you have ArcGIS Server 10.1 or later than you do have the ability to change the rendering that the server uses for each layer. You can see this in this sample:

https://developers.arcgis.com/flex/sample-code/changelayerdrawingoptions.htm
0 Kudos
RolfSchleicher
New Contributor
Robert,

thanks for the fast reply!

Yes, we do have ArcGIS Server 10.1 but i'am only working on the client side... It's part of my bachelor thesis and i just startet...
However the service has rasterlayer and no feature layer like in the example. Is that a problem?

Steve
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Steve,

   I have not tried with rasterlayers but it might work.
0 Kudos