Apply a renderer to a sublayer.
A layer showing animal populations contains sublayers for different species. A renderer could be applied which gives each sublayer a different color, so that populations of each species can be compared visually.
Wait for the map image layer to load. Tap the button to apply a unique value renderer to see different population ranges in the counties sub-layer data.
- Create an
ArcGISMapImageLayer
from its URL. - After it is done loading, get its
SublayerList
withimageLayer.Sublayers
. - Cast the sublayer you want to change to the appropriate type:
(ArcGISMapImageSublayer) sublayers[0]
. - Create a
ClassBreaksRenderer
with a collection ofClassBreak
s for different population ranges. - Set the renderer of the sublayer with
sublayer.Renderer = renderer
.
- ArcGISMapImageLayer
- ArcGISMapImageSubLayer
- ClassBreaksRenderer
- ClassBreaksRenderer.ClassBreak
This application displays census data from an ArcGIS Server map service. It contains various population statistics, including total population for each county in 2007.
The service hosting the layer must support dynamic layers to be able to change the rendering of sublayers.
class breaks, dynamic layer, dynamic rendering, renderer, sublayer, symbology, visualization