Skip to content

UtilityNetworkTraceAnalysisViewModel

ESM: import UtilityNetworkTraceAnalysisViewModel from "@arcgis/core/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js";
CDN: const UtilityNetworkTraceAnalysisViewModel = await $arcgis.import("@arcgis/core/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js");
Class: @arcgis/core/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel
Inheritance: UtilityNetworkTraceAnalysisViewModel→Accessor
Since: ArcGIS Maps SDK for JavaScript 4.32

Provides the logic for the UtilityNetworkTraceAnalysis component.

See also

Constructors

UtilityNetworkTraceAnalysisViewModel

Constructor
new UtilityNetworkTraceAnalysisViewModel(properties)
Parameter
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
Show inherited properties Hide inherited properties
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

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

executionError

Property
executionError String |null |undefinedreadonly

Displays execution errors.

For UtilityNetworkTraceAnalysisViewModel the executionError is always "trace-error".

loadError

Property
loadError String |null |undefinedreadonly

Displays an error if loading fails.

Possible Values:"no-user-type-extension" |"no-utility-network" |"no-view" |"sceneView-not-supported"

state

Property
state Stringreadonly

The viewModel's state.

Possible Values:"disabled" |"executing" |"loading" |"ready"

utilityNetwork

Property
utilityNetwork UtilityNetwork |null |undefined

Determines the utility network to use.

view

Property
view MapView |null |undefined

The view from which the widget will operate.

Method Overview

Show inherited methods Hide inherited methods
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

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
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();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key 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

Method
executeNamedTraceConfiguration(parameters){Promise<TraceResult>}

Method used to execute a trace using a named trace configuration.

Parameter

The parameters used to execute a trace based using named trace configurations.

Returns
Type Description
Promise<TraceResult>
  • When resolved, returns the trace results which could include elements, function results or aggregated geometries.
Example
const 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

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if 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");
}

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

Type Definitions

NamedTraceConfigurationParameters

Type Definition
NamedTraceConfigurationParameters Object

Object used to execute a trace using a named trace configuration.

Properties
namedTraceConfigurationGlobalId String

The globalId of the named trace configuration.

outSpatialReference SpatialReference
optional

The desired out SpatialReference of the trace.

traceLocations TraceLocation[]
optional

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.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.