import AreaMeasurementAnalysisView3D from "@arcgis/core/views/3d/analysis/AreaMeasurementAnalysisView3D.js";
const AreaMeasurementAnalysisView3D = await $arcgis.import("@arcgis/core/views/3d/analysis/AreaMeasurementAnalysisView3D.js");
@arcgis/core/views/3d/analysis/AreaMeasurementAnalysisView3D
Represents the analysis view of an AreaMeasurementAnalysis after it has been added to SceneView.analyses.
The AreaMeasurementAnalysisView3D is responsible for rendering a AreaMeasurementAnalysis 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 AreaMeasurementAnalysis();
sceneView.analyses.add(analysis); // add to the scene view
const analysisView = await view.whenAnalysisView(analysis);
Things to consider:
- Snapping is enabled by default. This can be temporarily disabled by holding the
CTRL
key. - Layer types currently supported for snapping are: FeatureLayer, GraphicsLayer (except Mesh geometries), GeoJSONLayer, WFSLayer, CSVLayer, 3D Object SceneLayer, and BuildingSceneLayer.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
The area measurement analysis object associated with the analysis view. | AreaMeasurementAnalysisView3D | ||
Enables interactivity for the analysis. | AreaMeasurementAnalysisView3D | ||
Result of the area measurement. | AreaMeasurementAnalysisView3D | ||
The analysis view type. | AreaMeasurementAnalysisView3D | ||
When | AreaMeasurementAnalysisView3D |
Property Details
-
analysis
analysis AreaMeasurementAnalysisreadonly
-
The area measurement analysis object associated with the analysis view.
-
interactive
interactive Boolean
-
Enables interactivity for the analysis. When set to
true
, manipulators will be displayed, allowing users to click and drag to edit the analysis if it has a valid geometry.This property is automatically set to
true
when the analysis is assigned to an Area Measurement 3D component.- Default Value:false
-
result
result AreaMeasurementAnalysisResult |null |undefined
-
Result of the area measurement. Results are calculated asynchronously and should be watched for changes.
-
type
type Stringreadonly
-
The analysis view type.
For AreaMeasurementAnalysisView3D the type is always "area-measurement-view-3d".
-
visible
visible Boolean
-
When
true
, the analysis is visualized in the view.
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Promise<AreaMeasurementPlacementResult> | Starts the interactive placement of an area measurement. | AreaMeasurementAnalysisView3D |
Method Details
-
place
place(options){Promise<AreaMeasurementPlacementResult>}
-
Starts the interactive placement of an area measurement.
If the analysis does not have a geometry yet, the method allows creating one interactively in the view. If the analysis already has a measurement, clicking in the view will remove it and start the placement of a new geometry.
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
.ParametersReturnsType Description Promise<AreaMeasurementPlacementResult> A promise which resolves when the operation is completed successfully or rejected if it is canceled. Exampleconst 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
-
Result obtained from an AreaMeasurementAnalysis.
- Properties
-
Describes the mode in which the measurement is computed. In
euclidean
mode, the area and perimeter length are computed from a flat polygon with straight segments on the perimeter in the ECEF coordinate system. Ingeodesic
mode, the area and perimeter length are computed from a geodesic polygon on the WGS84 ellipsoid.Possible Values:"euclidean"|"geodesic"
Area of the polygon.
Perimeter length of the polygon.