Display 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. Toggle its visibility by tapping the first switch. Toggle between the sublayer’s original renderer and an alternate renderer using the second switch. Tap the “Set Current to Minimum Scale” button to set the sublayer’s minimum scale to the current map scale.
How it works
- Create a
SubtypeFeatureLayerfrom aServiceFeatureTablethat defines a subtype, and add it to theMap. - Get a
SubtypeSublayerfrom the subtype feature layer using its name. - Enable the sublayer’s labels and define them with
LabelDefinition.- Use
SimpleLabelExpressionto set the expression for label definitions.
- Use
- Make a switch to toggle the sublayer’s visibility.
- Create an alternate renderer by making a
SimpleRenderer. - Get the current map scale and make it the minimum map 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.
Additional information
Help regarding the Arcade label expression script for defining a label definition can be found on the Esri Developers website.
Tags
asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range