var drawingOptions = []; var drawOption = new esri.layers.LayerDrawingOptions(); drawOption.transparency = value / 100; // Not working!! - the value is the value from the slider's onChange event. drawOption.showLabels = false // This test line works! drawingOptions[idxLyr] = drawOption; layer.setLayerDrawingOptions(drawingOptions, false);
So what does drawOption.transparency do for the layer?
[
{
"id": 0,
"source": {
"type": "mapLayer",
"mapLayerId": 0
},
"drawingInfo": {
"renderer": {
"type": "simple",
"label": "",
"description": "",
"symbol": {
"color": [0, 0, 0, 255],
"size": 20,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [0, 0, 0, 255],
"width": 1,
"type": "esriSLS",
"style": "esriSLSSolid"
}
}
},
"transparency": 0,
"showLabels": false
},
"minScale": 5000000,
"maxScale": 0
}
]
<svg version="1.1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="300pt" height="300pt" viewBox="0 0 300 300" xml:space="preserve" enable-background="new 0 0 300 300"> <g color-interpolation="linearRGB" transform="scale(0.75,0.75)"> <g> <rect x="0" y="0" width="400" height="400" fill="#FDFDFD" fill-opacity="1" /> </g> <g id=""> <g opacity="0.6"> <g id="LAYER">
Hi,
ArcGISDynamicMapServiceLayer's setLayerDrawingOptions is changing the transparency? I wanted to change the layer transparency for a particular layer, not the entire dynamic map service layer. I have tried the below code, but not working.
var optionsArray = [];
var drawingOptions = new LayerDrawingOptions();
drawingOptions.transparency = value; //from a slider
optionsArray[0] = drawingOptions;
myLayer.setLayerDrawingOptions(optionsArray);
Thanks
I also had to enable support for dynamic layer on the map service in ArcGIS Server as well as set the image format to PNG32 for the dynamic layer.