DimensionAnalysisView3D

ESM: import DimensionAnalysisView3D from "@arcgis/core/views/3d/analysis/DimensionAnalysisView3D.js";
CDN: const DimensionAnalysisView3D = await $arcgis.import("@arcgis/core/views/3d/analysis/DimensionAnalysisView3D.js");
Class: @arcgis/core/views/3d/analysis/DimensionAnalysisView3D
Inheritance: DimensionAnalysisView3D→Accessor
Since: ArcGIS Maps SDK for JavaScript 4.33

Represents the analysis view of a DimensionAnalysis after it has been added to SceneView.analyses.

The DimensionAnalysisView3D is responsible for rendering a DimensionAnalysis using custom visualizations.

It allows to create new dimensions interactively using the place() method, query measured results, or to make existing dimensions selectable and editable by enabling the interactive property. To select a dimension, hover and click on its offset manipulator.

The view for an analysis can be retrieved using SceneView.whenAnalysisView similar to how layer views are retrieved for layers using SceneView.whenLayerView.

// create new analysis and add it to the view
const dimensionAnalysis = new DimensionAnalysis();
view.analyses.add(dimensionAnalysis);

// retrieve analysis view for the analysis
const dimensionAnalysisView = await view.whenAnalysisView(dimensionAnalysis);

Things to consider:

See also

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 dimension analysis object associated with the analysis view.

DimensionAnalysisView3D

The name of the class.

Accessor

Enables interactivity for the analysis.

DimensionAnalysisView3D

Results for each dimension in the analysis.

DimensionAnalysisView3D

The selected dimension.

DimensionAnalysisView3D

The analysis view type.

DimensionAnalysisView3D

When true, the analysis is visualized in the view.

DimensionAnalysisView3D

Property Details

analysis

Property
analysis DimensionAnalysisreadonly

The dimension analysis object associated with the analysis view.

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

interactive

Property
interactive Boolean

Enables interactivity for the analysis. When set to true and the analysis includes any valid dimensions, they become selectable and editable.

Default Value:false

results

Property
results Collection<LengthDimensionResult>readonly

Results for each dimension in the analysis.

The order of results matches the order of dimensions, so if the index of the dimension is known the collection can be indexed directly:

const dimensionAnalysisView = await view.whenAnalysisView(dimensionAnalysis);
const result = dimensionAnalysisView.results.at(dimensionIdx);

Given a dimension object, the results collection can also be searched:

const result = dimensionAnalysisView.results.find((result) => result.dimension === dimensionObject);

selectedDimension

Property
selectedDimension LengthDimension |null |undefined

The selected dimension. If interactive is true, any dimension in the analysis can be selected by clicking on it in the view. As long as interactive remains true, the properties of the selected dimension can be edited by interacting with manipulators in the view.

type

Property
type Stringreadonly

The analysis view type.

For DimensionAnalysisView3D the type is always "dimension-view-3d".

visible

Property
visible Boolean

When true, the analysis is visualized in the view.

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<void>

Starts the interactive creation of new dimensions and adds them to the analysis.

DimensionAnalysisView3D

Returns true if a named group of handles exist.

Accessor

Starts the interactive placement of a single dimension, adding it to the analysis.

DimensionAnalysisView3D

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.

createLengthDimensions

Method
createLengthDimensions(options){Promise<void>}

Starts the interactive creation of new dimensions and adds them to the analysis.

The first click places start point and the second sets end point.

The creation process will finish when the user double-clicks the mouse or presses the escape key. To stop the creation programmatically, pass an abort signal as an argument when calling the method.

This method is similar to the place() method, but it allows to create multiple dimensions in a row.

Calling this method sets interactive to true.

Parameters
options Object
optional

An object specifying additional options.

Specification
optional

Abort signal which can be used to cancel creation.

Returns
Type Description
Promise<void> A promise which resolves when creation is completed successfully or rejected if it is canceled.
Example
const abortController = new AbortController();

try {
  await analysisView.createLengthDimensions({ signal: abortController.signal });
} catch (error) {
  if (error.name === "AbortError") {
    console.log("Placement operation was cancelled.");
  }
}

// cancel the placement operation at some later point
abortController.abort();

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");
}

place

Method
place(options){Promise<DimensionPlacementResult>}

Starts the interactive placement of a single dimension, adding it to the analysis.

The first click places start point and the second sets end point.

The placement operation will finish when the user presses the escape key. To stop the placing programmatically, pass an abort signal as an argument when calling the method.

Calling this method sets interactive to true.

Parameters
optional

An object specifying additional options.

Specification
optional

Abort signal which can be used to cancel the operation.

Returns
Type Description
Promise<DimensionPlacementResult> A promise which resolves when the operation is completed successfully or rejected if it is canceled.
Example
const abortController = new AbortController();

try {
  await analysisView.place({ signal: abortController.signal });
} catch (error) {
  if (error.name === "AbortError") {
    console.log("Placement operation was cancelled.");
  }
}

// cancel the placement operation at some later point
abortController.abort();

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

DimensionPlacementResult

Type Definition
DimensionPlacementResult

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