A utility network container allows a dense collection of features to be represented by a single feature, which can be used to reduce map clutter.

Use case
Offering a container view for features aids in the review for valid, structural attachment, and containment relationships. It also helps determine if a dataset has an association role set. Container views often model a cluster of electrical devices on a pole top or inside a cabinet or vault.
How to use the sample
Tap a container feature to show all features inside the container. The container is shown as a polygon graphic with the content features contained within. The viewpoint and scale of the map are also changed to the container’s extent. Connectivity and attachment associations inside the container are shown as dotted lines.
How it works
- Create and load a web map that includes ArcGIS Pro Subtype Group Layers with only container features visible (i.e. fuse bank, switch bank, transformer bank, hand hole, and junction box).
- Create a
MapViewand add theonSingleTapGesture(perform:)modifier to detect tap events. - Get and load the first
UtilityNetworkfrom the web map. - Add a
GraphicsOverlayfor displaying a container view. - Identify the tapped feature and create an
UtilityElementfrom it. - Get the associations for this element using
UtilityNetwork.associations(for:ofKind:). - Turn-off the visibility of all of the map’s
operationalLayers. - Get the features for the
UtilityElement(s) from the associations usingUtilityNetwork.features(for:). - Add a
Graphicwith the same geometry and symbol as these features. - Add another
Graphicthat represents this extent and zoom to this extent with some buffer. - Get associations for this extent using
UtilityNetwork.associations(forExtent:ofKind:). - Add a
Graphicto represent the association geometry between them using a symbol that distinguishes betweenattachmentandconnectivityassociation type. - Turn-on the visibility of all
operationalLayers, clear theGraphicobjects, and zoom out to previous extent to exit container view.
Relevant API
- SubtypeFeatureLayer
- UtilityAssociation
- UtilityAssociation.Kind
- UtilityElement
- UtilityNetwork
About the data
The Naperville Electric SubtypeGroupLayers with Containers web map contains a utility network used to find associations shown in this sample. Authentication is required and handled within the sample code.
Tags
associations, connectivity association, containment association, structural attachment associations, utility network