I have a dynamic Map Service published in AGS with a Transparency value set for a layer. This Transparency value doesn't seem to automatically set the Layer's Opacity property in Runtime and I can't find the layer transparency value in the ServiceInfo in order to set the Opacity using that value. Any ideas?
A map service doesn't have opacity - only the sublayers within the mapservice. See the REST spec here: http://sampleserver6.arcgisonline.com/arcgis/sdk/rest/index.html#//02ss0000006v000000
Layers inside maps can have opacity, so if you publish a map that has a layer that points to this service, that layer can have opacity, but the service itself cannot.
We have the same issue using ArcGIS Runtime SDK for .NET v10.2.7 and dynamic map services published in ArcGIS Server v10.5. The polygon layers that have a transparency value will display with muted colors but do not have any transparency. I have verified that the transparency value is saved with the map service by browsing the map service Uri and looking at the Drawing Info properties (see below).
Name: Feeder Boundaries
Display Field: FEEDERNAME
Type: Feature Layer
Geometry Type: esriGeometryPolygon
Renderer:Unique Value Renderer:
Strangely, the same MXD used to publish the map service in ArcGIS Server will display the transparency correctly when shared as an MPK using a local file geodatabase as the data source. I sure hope someone has the solution to this problem.
Morten, I agree. The transparency of the sublayer should be respected, but it isn't. Also, since the transparency property of a sublayer is read-only, it can't be changed at runtime; we can only change the transparency of the map service layer which affects all of its sublayers.
The transparency of a sublayer in a dynamic map service is applied by the server, not the runtime.
Which type of runtime layer are you using to access the mapservice? Which image format did you specify?
Thank you for participating in this discussion! In my case, my service is a Dynamic service. The sublayer in that service has a transparency value of 80. In Runtime v100.1.0, I am accessing the layer using a ArcGISMapImageLayer class. I didn't specify an ImageFormat originally, but I just tried PNG and the layer does display, but without transparency.
If I add the same service as a layer in ArcMap, the transparency of the sublayer is as expected.
Just to be clear here: The sublayer is transparent, but if there's any other sublayer behind or in front of it that isn't transparent, the generated image wouldn't have any transparency in it.
You could try and use Fiddler and see what /exportImage request is made, and what image is coming back.