DirectLineMeasurementAnalysisView3D

ESM: import DirectLineMeasurementAnalysisView3D from "@arcgis/core/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js";
CDN: const DirectLineMeasurementAnalysisView3D = await $arcgis.import("@arcgis/core/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js");
Class: @arcgis/core/views/3d/analysis/DirectLineMeasurementAnalysisView3D

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

The DirectLineMeasurementAnalysisView3D is responsible for rendering a DirectLineMeasurementAnalysis using custom visualizations.

It allows to create a new analysis interactively using the place() method, query the measured result, or make an existing analysis editable by enabling the interactive property.

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

// retrieve analysis view for analysis
const analysis = new DirectLineMeasurementAnalysis();
sceneView.analyses.add(analysis); // add to the scene view
const analysisView = await view.whenAnalysisView(analysis);

Things to consider:

See also

Property Overview

Name Type Summary Class

The direct line measurement analysis object associated with the analysis view.

DirectLineMeasurementAnalysisView3D

Enables interactivity for the associated analysis.

DirectLineMeasurementAnalysisView3D

Result of the direct line measurement.

DirectLineMeasurementAnalysisView3D

The analysis view type.

DirectLineMeasurementAnalysisView3D

When true, the analysis is visualized in the view.

DirectLineMeasurementAnalysisView3D

Property Details

analysis

Property
analysis DirectLineMeasurementAnalysisreadonly

The direct line measurement analysis object associated with the analysis view.

interactive

Property
interactive Boolean

Enables interactivity for the associated analysis. When set to true, manipulators will be displayed, allowing users to click and drag to edit the analysis if it has a valid startPoint and endPoint.

This property is automatically set to true when the analysis is assigned to a Direct Line Measurement 3D component.

Default Value:false

Result of the direct line measurement. Results are calculated asynchronously and should be watched for changes.

type

Property
type Stringreadonly

The analysis view type.

For DirectLineMeasurementAnalysisView3D the type is always "direct-line-measurement-view-3d".

visible

Property
visible Boolean

When true, the analysis is visualized in the view.

Method Overview

Name Return Type Summary Class

Starts the interactive placement of a direct line measurement.

DirectLineMeasurementAnalysisView3D

Method Details

place

Method
place(options){Promise<DirectLineMeasurementPlacementResult>}

Starts the interactive placement of a direct line measurement.

If the analysis does not have a startPoint and endPoint yet, the method allows placing the start and end points interactively in the view. If the analysis already has a measurement, clicking in the view will remove it and start the placement of new start and end points.

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<DirectLineMeasurementPlacementResult> 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();

Type Definitions

DirectLineMeasurementAnalysisResult

Type Definition
DirectLineMeasurementAnalysisResult

Result obtained from a DirectLineMeasurementAnalysis.

Properties
mode String

Describes how the horizontalDistance is computed.

  • In euclidean mode, the horizontal distance is the 2D distance between the two points, computed in a Euclidean manner. This mode is used in scenes with projected coordinate systems (PCS), apart from Web Mercator.
  • In geodesic mode, the horizontal distance is computed geodetically. This mode is used in scenes with geographic coordinate systems (GCS) or in Web Mercator.

Possible Values:"euclidean"|"geodesic"

directDistance Length

The 3D distance between the two points that is computed in a Euclidean manner.

horizontalDistance Length

The 2D distance between the two points.

verticalDistance Length

The elevation difference between the two points.

DirectLineMeasurementPlacementResult

Type Definition
DirectLineMeasurementPlacementResult

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