require(["esri/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel"], (UtilityNetworkTraceAnalysisViewModel) => { /* code goes here */ });
import UtilityNetworkTraceAnalysisViewModel from "@arcgis/core/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js";
esri/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel
Provides the logic for the UtilityNetworkTraceAnalysis component.
- See also
Constructors
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
Displays execution errors. | UtilityNetworkTraceAnalysisViewModel | ||
Displays an error if loading fails. | UtilityNetworkTraceAnalysisViewModel | ||
The viewModel's state. | UtilityNetworkTraceAnalysisViewModel | ||
Determines the utility network to use. | UtilityNetworkTraceAnalysisViewModel | ||
The view from which the widget will operate. | UtilityNetworkTraceAnalysisViewModel |
Property Details
-
Displays execution errors.
For UtilityNetworkTraceAnalysisViewModel the executionError is always "trace-error".
-
Displays an error if loading fails.
Possible Values:"no-utility-network" |"no-view" |"sceneView-not-supported"
-
state
state Stringreadonly
-
The viewModel's state.
Possible Values:"disabled" |"executing" |"failed" |"loading" |"ready"
-
utilityNetwork
utilityNetwork UtilityNetwork |null |undefined
-
Determines the utility network to use.
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Promise<TraceResult> | Method used to execute a trace using a named trace configuration. | UtilityNetworkTraceAnalysisViewModel |
Method Details
-
executeNamedTraceConfiguration
executeNamedTraceConfiguration(parameters){Promise<TraceResult>}
-
Method used to execute a trace using a named trace configuration.
Parameterparameters NamedTraceConfigurationParametersThe parameters used to execute a trace based using named trace configurations.
ReturnsType Description Promise<TraceResult> - When resolved, returns the trace results which could include elements, function results or aggregated geometries.
Exampleconst traceLocations = [ { type: "starting-point", globalId: "{699C9FDB-3B39-46DC-90D2-13553F3C6694}", percentAlong: 0.048388288199580576, }, { type: "barrier", globalId: "{8E99EB07-3BA0-4D7D-A1C0-4D69F5487470}", percentAlong: 0.57765268897410094 }, ]; const traceResult = await traceAnalysisViewModel.executeNamedTraceConfiguration({ namedTraceConfigurationGlobalId: "{E43E4D2C-E191-4547-AFB8-392860694392}", traceLocations: traceLocations });
Type Definitions
-
NamedTraceConfigurationParameters
NamedTraceConfigurationParameters Object
-
Object used to execute a trace using a named trace configuration.
- Properties
-
namedTraceConfigurationGlobalId String
The globalId of the named trace configuration.
outSpatialReference SpatialReferenceThe desired out SpatialReference of the trace.
traceLocations TraceLocation[]To perform the trace analytic, users can optionally supply a list of locations in forms of globalIds (UUID) and terminals. These locations indicate starting points and barriers. A starting point is set on network features to define the location in the network where a trace begins. Most traces require one or more starting points to be defined. Barriers are used in traces, export subnetwork operations, and update subnetwork operations to mark the locations to stop tracing. Use barriers to represent a location in the network beyond which the trace cannot travel.