import UtilityNetworkTraceAnalysisViewModel from "@arcgis/core/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js";
const UtilityNetworkTraceAnalysisViewModel = await $arcgis.import("@arcgis/core/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js");
@arcgis/core/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 |
|---|---|---|---|
The name of the class. | Accessor | ||
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-user-type-extension" |"no-utility-network" |"no-view" |"sceneView-not-supported"
-
state
Propertystate Stringreadonly -
The viewModel's state.
Possible Values:"disabled" |"executing" |"loading" |"ready"
-
utilityNetwork
PropertyutilityNetwork UtilityNetwork |null |undefined -
Determines the utility network to use.
Method Overview
| Name | Return Type | Summary | Class |
|---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Promise<TraceResult> | Method used to execute a trace using a named trace configuration. | UtilityNetworkTraceAnalysisViewModel | |
Returns true if a named group of handles exist. | Accessor | ||
Removes a group of handles owned by the object. | Accessor |
Method Details
-
Inherited from Accessor
-
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
executeNamedTraceConfiguration
MethodexecuteNamedTraceConfiguration(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.05, }, { type: "barrier", globalId: "{8E99EB07-3BA0-4D7D-A1C0-4D69F5487470}", percentAlong: 0.7 }, ]; const traceResult = await traceAnalysisViewModel.executeNamedTraceConfiguration({ namedTraceConfigurationGlobalId: "{E43E4D2C-E191-4547-AFB8-392860694392}", traceLocations: traceLocations });
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}Inherited from Accessor -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns trueif a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
Inherited from Accessor
-
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
Type Definitions
-
NamedTraceConfigurationParameters
Type DefinitionNamedTraceConfigurationParameters Object -
Object used to execute a trace using a named trace configuration.
- Properties
-
namedTraceConfigurationGlobalId String
The globalId of the named trace configuration.
optionaloutSpatialReference SpatialReferenceThe desired out SpatialReference of the trace.
optionaltraceLocations 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.