import "@arcgis/map-components/components/arcgis-utility-network-trace";Utility Network Trace component provides a way to run traces in a Utility Network based on connectivity or traversability from set input flags. Input flags (starting points and barriers) can be set by clicking the view.
The Utility Network Trace component does not support proxied feature services or feature services that utilize stored credentials.
Note: Sign in to access the data in this sample, U/P: viewer01/I68VGU^nMurF
Demo
Properties
| Property | Attribute | Type | 
|---|---|---|
autoDestroyDisabled | auto-destroy-disabled | boolean | 
defaultGraphicColor |  | GraphicColor | 
disabledreflected  | disabled | boolean | 
enableResultArea | enable-result-area | boolean | 
flags |  | Array<FlagProperty> | 
icon | icon | string | 
inputSettings |  | Array<InputSetting> | 
label | label | string | 
positiondeprecated  | position | "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing" | 
referenceElement | reference-element | HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | string | 
resultAreaProperties |  | ResultAreaPropertiesExtend | 
selectedTraces |  | Array<string> | 
selectOnCompleteDisabled | select-on-complete-disabled | boolean | 
showGraphicsOnCompleteDisabled | show-graphics-on-complete-disabled | boolean | 
showSelectionAttributesDisabled | show-selection-attributes-disabled | boolean | 
statereadonlyreflected  | state | "loading" | "ready" | 
traceResultsreadonly  |  | Array<TraceResultExtend> | 
view |  | MapView | 
autoDestroyDisabled
autoDestroyDisabled: booleanIf true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy method when you are done to prevent memory leaks.
- Attribute
 - auto-destroy-disabled
 - Default value
 - false
 
defaultGraphicColor
defaultGraphicColor: GraphicColorThe default color to assign the aggregated geometry of a trace result.
- Default value
 - { color: [255, 255, 0, 0.6], haloOpacity: 0.9, fillOpacity: 0.2, hex: "#FFFF00" }
 
disabled
disabled: booleanWhen true, the widget is visually withdrawn and cannot be interacted with.
- Attribute
 - disabled
 - Default value
 - true
 
enableResultArea
enableResultArea: booleanWhen true, provides the ability to show the convex hull or buffer.
- Attribute
 - enable-result-area
 - Default value
 - false
 
flags
flags: Array<FlagProperty>An array of map points to load into the widget to lookup flags.
- Default value
 - []
 
icon
icon: stringIcon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component).
- See also
 
- Attribute
 - icon
 - Default value
 - "utility-network-trace"
 
inputSettings
inputSettings: Array<InputSetting>Custom labels, descriptions, and symbol for the input flags.
- Default value
 - []
 
position
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"slot instead.- Attribute
 - position
 
referenceElement
referenceElement: HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | stringBy assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.
- Attribute
 - reference-element
 
resultAreaProperties
resultAreaProperties: ResultAreaPropertiesExtendThe properties to determine the size and color of the result area convex hull or buffer, and determines if it displays on the map when the trace completes.
- Default value
 - { type: "convexhull", distance: 10, unit: "meters", areaUnit: "square-meters", color: { color: [255, 165, 0, 0.5], haloOpacity: 0.9, fillOpacity: 0.2, hex: "#ffa500" }, show: false }
 
selectedTraces
selectedTraces: Array<string>A list of global Ids of traces to select on load.
- Default value
 - []
 
selectOnCompleteDisabled
selectOnCompleteDisabled: booleanWhen true, the utility network elements are selected in the view when traces are completed.
- Attribute
 - select-on-complete-disabled
 - Default value
 - true
 
showGraphicsOnCompleteDisabled
showGraphicsOnCompleteDisabled: booleanWhen true, a graphic layer is added to the view to highlight the utility network elements when traces are completed.
- Attribute
 - show-graphics-on-complete-disabled
 - Default value
 - true
 
showSelectionAttributesDisabled
showSelectionAttributesDisabled: booleanDetermines whether to show list of selection attributes.
- Attribute
 - show-selection-attributes-disabled
 - Default value
 - true
 
state
state: "loading" | "ready"The current state of the component.
- Attribute
 - state
 - Default value
 - "ready"
 
traceResults
traceResults: Array<TraceResultExtend>Stores the result of completed traces.
view
view: MapViewThe view associated with the component.
Note: The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this
viewproperty which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the Utility Network Trace component will be associated with a map or scene component rather than using theviewproperty.
Methods
| Method | Signature | 
|---|---|
checkCanTrace | checkCanTrace(): Promise<void> | 
componentOnReady | componentOnReady(): Promise<void> | 
confirmReset | confirmReset(): Promise<void> | 
destroy | destroy(): Promise<void> | 
componentOnReady
componentOnReady(): Promise<void>Create a promise that resolves once component is fully loaded.
Example
const arcgisUtilityNetworkTrace = document.querySelector("arcgis-utility-network-trace");
document.body.append(arcgisUtilityNetworkTrace);
await arcgisUtilityNetworkTrace.componentOnReady();
console.log("arcgis-utility-network-trace is ready to go!");- Returns
 - Promise<void>
 
Events
| Event | Type | 
|---|---|
arcgisAddFlag | CustomEvent<UtilityNetworkTraceAddFlagEvent> | 
arcgisAddFlagComplete | CustomEvent<UtilityNetworkTraceAddFlagCompleteEvent> | 
arcgisAddFlagError | CustomEvent<UtilityNetworkTraceAddFlagErrorEvent> | 
arcgisAddResultArea | CustomEvent<UtilityNetworkTraceAddResultAreaEvent> | 
arcgisPropertyChange | CustomEvent<{ name: "state"; }> | 
arcgisReady | CustomEvent<void> | 
arcgisRemoveResultArea | CustomEvent<UtilityNetworkTraceRemoveResultAreaEvent> | 
arcgisAddFlag
arcgisAddFlag: CustomEvent<UtilityNetworkTraceAddFlagEvent>arcgisAddFlagComplete
arcgisAddFlagComplete: CustomEvent<UtilityNetworkTraceAddFlagCompleteEvent>arcgisAddFlagError
arcgisAddFlagError: CustomEvent<UtilityNetworkTraceAddFlagErrorEvent>arcgisAddResultArea
arcgisAddResultArea: CustomEvent<UtilityNetworkTraceAddResultAreaEvent>arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state"; }>Emitted when the value of a property is changed. Use this to listen to changes to properties.
arcgisReady
arcgisReady: CustomEvent<void>Emitted when the component associated with a map or scene view is ready to be interacted with.
arcgisRemoveResultArea
arcgisRemoveResultArea: CustomEvent<UtilityNetworkTraceRemoveResultAreaEvent>