Displays a composite layer of all the subtype values in a feature class.
Use case
This is useful for controlling labeling, visibility, and symbology of a given subtype as though they are distinct layers on the map.
How to use the sample
The sample loads with the sublayer visible on the map. Change the sublayer's visibiliy, renderer, and minimum scale using the on screen controls. Setting the minimum scale will change its value to that of the current map scale. Zoom in and out to see the sublayer become visible based on its new scale range.
How it works
Create a SubtypeFeatureLayer from a ServiceFeatureTable that defines a subtype, and add it to the Map.
Get a SubtypeSublayer from the subtype feature using its name.
Enable the sublayer's labels and define them with a LabelDefinition.
Set the visibility status using this sublayer's IsVisible property.
Change the sublayer's symbology using this sublayer's Renderer property.
Update the sublayer's minimum scale value using the using the mapview's current scale.
Relevant API
LabelDefinition
ServiceFeatureTable
SimpleLabelExpression
SubtypeFeatureLayer
SubtypeSublayer
About the data
The feature service layer in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices.