I have two problems with ArcGIS Server's (10.0) dynamic layers when calling Layer.setLayerDrawingOptions from v3.2 of the JavaScript API.
1) It doesn't work. I set the layerDrawingOptions array for a dynamic layer and the resulting image is rendered the same as if I hadn't changed anything. I have verified that the layer ID is correct, and also tried several approaches to defining the LayerDrawingOptions object.
When I inspect the request that goes to my map server it contains the following dynamicLayers property:
[{"id":0,"source":{"type":"mapLayer","mapLayerId":0},"definitionExpression":"ASSET_ID IS NULL"},{"id":1,"source":{"type":"mapLayer","mapLayerId":1},"definitionExpression":"ASSET_ID IN (27)","drawingInfo":{"renderer":{"type":"simple","symbol":{"color":[255,0,0,255],"outline":{"color":[0,0,0,255],"width":1,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"}},"transparency":1,"scaleSymbols":false,"showLabels":false}},{"id":2,"source":{"type":"mapLayer","mapLayerId":2},"definitionExpression":"ASSET_ID IS NULL"},{"id":3,"source":{"type":"mapLayer","mapLayerId":3},"definitionExpression":"ASSET_ID IS NULL"}]
The feature with ASSET_ID = 27 is rendered but in its default style, however "color":[255,0,0,255] says it should be solid red. The map service referenced by this layer only contains a single polygon layer and that is ID 1. I can't see any way that I am accidentally attempting to style the wrong layer.
2) If I define multiple layerDrawingOptions in the array, one for each layer within the map service, I am forced to provide a proxy URL (even though the resulting request is nowhere near the 2000 character limit). When what should be the map request goes to the map server via the proxy, with multiple layerDrawingOptions, the map server returns a JSON string that describes an image (height, width, bbox etc.) but has an empty href ("").
Although there are no errors in my AGS log I assume this means I'm not allowed to set multiple layerDrawingOptions in a single layer. Is this actually true?
So if anyone can provide thoughts or experience on 1) why layerDrawingOptions seem to have no effect, or 2) why I am seemingly not allowed to set more than one option for a map service, I'd really love to hear it/them.
