Setting Definition Expressions with a Dynamic Map Service

740
1
Jump to solution
06-14-2017 01:57 PM
DaveStahl
New Contributor

I'm looking to migrate an app from 10.2.7 to 100.0.0, but I'm having trouble finding the replacement logic for the old ArcGISDynamicMapServiceLayer. It has a LayerDefinitions property where I could set the definition expression (aka where clause) for each applicable sub-layer. How do I do that in 100.0.0?

For 100.0.0, I'm using the ArcGISMapImageLayer. I simply can't find a spot to set definition expressions. I must be missing something.

Note that this is not something I can solve by using a FeatureLayer. This is a dynamic map service with a whole bunch of sub-layers, and I'm looking to get map images consisting of a subset of those layers with some definition expressions in play.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
DaveStahl
New Contributor

We found the solution in 100.1.0. After awaiting the ArcGISMapImageLayer.LoadAsync call, we are able to set layer orders, visibilities, renderers, definition expressions, etc. by working with the Sublayers property.

Note that Sublayers is a list ArcGISSublayer objects, so we did have to cast a given layer to an ArcGISMapImageSublayer to set properties like Renderer, Opacity, and DefinitionExpression.

View solution in original post

0 Kudos
1 Reply
DaveStahl
New Contributor

We found the solution in 100.1.0. After awaiting the ArcGISMapImageLayer.LoadAsync call, we are able to set layer orders, visibilities, renderers, definition expressions, etc. by working with the Sublayers property.

Note that Sublayers is a list ArcGISSublayer objects, so we did have to cast a given layer to an ArcGISMapImageSublayer to set properties like Renderer, Opacity, and DefinitionExpression.

0 Kudos