You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Shared/Samples/Trace utility network/README.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,22 +14,23 @@ Tap "Start a new trace" to select the type of trace using the confirmation dialo
14
14
15
15
## How it works
16
16
17
-
1. Create a `MapView` with a `Map` that contains one more utility networks.
17
+
1. Create a `MapView` with a `Map` that contains utility networks.
18
18
2. Add a `GraphicsOverlay` to hold symbology that distinguishes starting locations from barriers.
19
19
3. Get and load the first `UtilityNetwork` from the web map.
20
-
4. Allow users to choose a trace type from the set of `UtilityTraceParameters.TraceType`(s).
21
-
5. Create `UtilityTraceParameters` with the selected trace type.
22
-
6. Set the `UtilityTraceConfiguration` with the utility tier's `defaultTraceConfiguration` property.
23
-
7. Use the `onSingleTapGesture` modifier to listen for tap events on the map view.
24
-
8. Identify tapped features on the map and add a `Graphic` that represents its purpose (starting point or barrier) at the tapped location.
25
-
9. Create a `UtilityElement` for the identified feature.
26
-
10. Determine the type of the identified feature using `UtilityNetworkSource.sourceType`.
27
-
11. If the type is `junction`, display a terminal picker when more than one terminal is found.
28
-
12. If the type is `edge`, compute how far along the edge the user tapped using `GeometryEngine.polyline(_:fractionalLengthClosestTo:tolerance:)`.
29
-
13. Add any created `UtilityElement`(s) to the collection of starting locations or barriers in the `UtilityTraceParameters`.
30
-
14. Run `UtilityNetwork.trace(using:)` using the `UtilityTraceParameters`.
31
-
15. Group the `UtilityElementTraceResult.elements` by their `networkSource.name`.
32
-
16. For every `FeatureLayer` in this map with trace result elements, select features by converting `UtilityElement`(s) to `ArcGISFeature`(s) using `UtilityNetwork.features(for:)`.
20
+
4. Get the `ServiceGeodatabase` from the utility network and fetch the line `FeatureLayer` from the `ServiceGeodatabase`'s tables for customized renderer.
21
+
5. Allow users to choose a trace type from the set of `UtilityTraceParameters.TraceType`(s).
22
+
6. Create `UtilityTraceParameters` with the selected trace type.
23
+
7. Set the `UtilityTraceConfiguration` with the utility tier's `defaultTraceConfiguration` property.
24
+
8. Use the `onSingleTapGesture` modifier to listen for tap events on the map view.
25
+
9. Identify tapped features on the map and add a `Graphic` that represents its purpose (starting point or barrier) at the tapped location.
26
+
10. Create a `UtilityElement` for the identified feature.
27
+
11. Determine the type of the identified feature using `UtilityNetworkSource.sourceType`.
28
+
12. If the type is `junction`, display a terminal picker when more than one terminal is found.
29
+
13. If the type is `edge`, compute how far along the edge the user tapped using `GeometryEngine.polyline(_:fractionalLengthClosestTo:tolerance:)`.
30
+
14. Add any created `UtilityElement`(s) to the collection of starting locations or barriers in the `UtilityTraceParameters`.
31
+
15. Run `UtilityNetwork.trace(using:)` using the `UtilityTraceParameters`.
32
+
16. Group the `UtilityElementTraceResult.elements` by their `networkSource.name`.
33
+
17. For every `FeatureLayer` in this map with trace result elements, select features by converting `UtilityElement`(s) to `ArcGISFeature`(s) using `UtilityNetwork.features(for:)`.
0 commit comments