import "@arcgis/map-components/components/arcgis-utility-network-trace-analysis";- Inheritance:
- ArcgisUtilityNetworkTraceAnalysis→
PublicLitElement
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Overview
The Utility Network Trace Analysis component allows users to run traces and view trace results in a utility network.
- The component supports selecting a utility network and a named trace configuration in that utility network. Both the utility network and trace configuration must be stored in the map.
- Trace locations (starting points and barriers) are set by selecting features on the view.
- When a subnetwork-based trace is selected, the component displays the domain, tier, and target tier specified by the selected named trace configuration.
- If the user selects a subnetwork trace with a specified subnetwork name, the component provides an option to choose a subnetwork name instead of starting location(s) to run the trace with.
Supported trace types are: connected, upstream, downstream, shortest-path, subnetwork, subnetwork-controller, loops, and isolation.
The component can display the following from a trace result: elements (as features), aggregated geometries, and function results.
If the trace result includes elements that originate from a feature layer
that is not included in the map, the Results tab displays an Unknown layer with a count of those elements.
The component's traceResultFeatures property also does not include these elements.
The Utility Network Trace Analysis component does not support proxied feature services or feature services that utilize stored credentials.
This component also does not support path and circuit trace types or the paths and circuits result types.
Working with nonspatial objects
The Utility Network Trace Analysis component supports selecting nonspatial objects as trace locations by traversing associations.
When selecting a trace location or viewing a trace result feature, information about the feature is displayed according to the PopupTemplate of the layer that the feature belongs to. If the feature's layer has no PopupTemplate, a default template is used to display the feature's attributes.
To select a nonspatial object as a trace location, first select a spatial feature on the map that is associated with the target nonspatial object. The spatial feature's layer must have a PopupTemplate that includes a UtilityNetworkAssociationsContent. Navigate through the spatial feature's associations to the target nonspatial object, then add the object as a trace location.
Examples
This component can be used slotted into an arcgis-map:
<arcgis-map item-id="471eb0bf37074b1fbb972b1da70fb310"> <arcgis-utility-network-trace-analysis slot="bottom-left"></arcgis-utility-network-trace-analysis></arcgis-map>Alternatively, this component can be used outside of a map by providing a referenceElement:
<calcite-shell> <calcite-shell-panel slot="panel-start" position="start" width-scale="l"> <arcgis-utility-network-trace-analysis reference-element="#map-element"></arcgis-utility-network-trace-analysis> </calcite-shell-panel> <arcgis-map id="map-element" item-id="471eb0bf37074b1fbb972b1da70fb310"></arcgis-map></calcite-shell>Note: Sign in to access the data in this demo, U/P: viewer01/I68VGU^nMurF
Demo
Properties
| Property | Attribute | Type |
|---|---|---|
| ||
auto-destroy-disabled | ||
disable-highlight-feature-results | ||
hide-feature-results | ||
label reflected | label | |
| ||
reference-element | ||
state readonly | | |
traceResultFeatures readonly | | Graphic[] |
|
aggregatedGeometryGraphicsColor
- Type
- Color
The color used to render graphics for aggregated geometries in trace results, specified as a Color object.
Aggregated geometry is only rendered if the trace configuration specifies aggregated geometry as a result type.
Default color is #FFFF00.
- See also
autoDestroyDisabled
- Type
- boolean
If 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
disableHighlightFeatureResults
- Type
- boolean
Whether to disable highlighting trace result features on the map.
If true, the features returned by a trace will not be highlighted on the map.
- Attribute
- disable-highlight-feature-results
- Default value
- false
Example
Disable highlighting trace result features.
<arcgis-map item-id="471eb0bf37074b1fbb972b1da70fb310"> <arcgis-utility-network-trace-analysis disable-highlight-feature-results slot="top-right"/></arcgis-map> hideFeatureResults
- Type
- boolean
Whether to hide feature results in the results tab.
If true, when features are returned by a trace, they will not be visible in the results tab.
A message will be displayed in its place indicating that features were returned by the trace, but are not visible in the results pane.
This string can be overridden with the messageOverrides property.
- Attribute
- hide-feature-results
- Default value
- false
Examples
Do not show features in the results tab.
<arcgis-map item-id="471eb0bf37074b1fbb972b1da70fb310"> <arcgis-utility-network-trace-analysis hide-feature-results slot="top-right"/></arcgis-map>Override the message displayed in the results tab when features are hidden.
const traceElement = document.querySelector("arcgis-utility-network-trace-analysis");traceElement.messageOverrides = { resultFeaturesAreHidden: "Feature results were sent to the results window." }; referenceElement
- Type
- ArcgisReferenceElement | string | undefined
By 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
traceResultFeatures
- Type
- Graphic[]
An array of features returned by the trace result.
This array is populated if the trace returned element results.
When @arcgisTraceResultFeaturesReady is raised, trace result features are available. When a new trace has been run, or the trace results are cleared, this array is cleared.
view
The 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 arcgis-utility-network-trace-analysis component will be associated with a map or scene component rather than using theviewproperty.
Methods
| Method | Signature |
|---|---|
componentOnReady inherited | componentOnReady(): Promise<this> |
destroy(): Promise<void> |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
Example
const arcgisUtilityNetworkTraceAnalysis = document.querySelector("arcgis-utility-network-trace-analysis");document.body.append(arcgisUtilityNetworkTraceAnalysis);await arcgisUtilityNetworkTraceAnalysis.componentOnReady();console.log("arcgis-utility-network-trace-analysis is ready to go!");Events
arcgisHideGraphicsChange
arcgisHideGraphicsChange: CustomEvent<boolean> Fires when the user toggles displaying aggregated geometry results in the result pane. Event payload contains a boolean representing whether the aggregated geometry graphics are hidden. If true, the aggregated geometry graphics are hidden on the view.
Example
const traceElement = document.querySelector("arcgis-utility-network-trace-analysis");traceElement.addEventListener("arcgisHideGraphicsChange", (event) => { const hideGraphics = event.detail; console.log(hideGraphics);}); arcgisReady
arcgisReady: CustomEvent<void> Emitted when the component associated with a map or scene view is ready to be interacted with.
arcgisTraceResultClear
arcgisTraceResultClear: CustomEvent<void> Fires when the trace result is cleared from the results tab.
Example
const traceElement = document.querySelector("arcgis-utility-network-trace-analysis");traceElement.addEventListener("arcgisTraceResultClear", (event) => { console.log("Trace result was cleared.");}); arcgisTraceResultFeaturesReady
arcgisTraceResultFeaturesReady: CustomEvent<void> Fires when the trace result features are ready. Check property traceResultFeatures for the trace result features.
Example
const traceElement = document.querySelector("arcgis-utility-network-trace-analysis");traceElement.addEventListener("arcgisTraceResultFeaturesReady", (event) => { const resultFeatures = traceElement.traceResultFeatures; console.log(resultFeatures);});