import VolumeMeasurementAnalysisView3D from "@arcgis/core/views/3d/analysis/VolumeMeasurementAnalysisView3D.js";
const VolumeMeasurementAnalysisView3D = await $arcgis.import("@arcgis/core/views/3d/analysis/VolumeMeasurementAnalysisView3D.js");
@arcgis/core/views/3d/analysis/VolumeMeasurementAnalysisView3D
Represents the analysis view of a VolumeMeasurementAnalysis after it has been added to SceneView.analyses.
The VolumeMeasurementAnalysisView3D is responsible for rendering a VolumeMeasurementAnalysis using custom visualizations. The properties on the analysis view provide developers with the ability to query measured results. If the result is unavailable, the error property provides the details on the cause.
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 VolumeMeasurementAnalysis();
view.analyses.add(analysis); // add to the scene view
const analysisView = await view.whenAnalysisView(analysis);
Things to consider:
- When using the "cut-fill" measureType in interactive mode, hover over the shift manipulator, press
Tabto activate the tooltip input mode, and enter the elevation of the target surface. - Snapping is enabled by default. This can be temporarily disabled by holding the
CTRLkey. - 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 volume measurement analysis object associated with the analysis view. | VolumeMeasurementAnalysisView3D | ||
Error encountered while calculating the analysis result. | VolumeMeasurementAnalysisView3D | ||
Enables interactivity for the analysis. | VolumeMeasurementAnalysisView3D | ||
Result of the volume measurement. | VolumeMeasurementAnalysisView3D | ||
The analysis view type. | VolumeMeasurementAnalysisView3D | ||
When | VolumeMeasurementAnalysisView3D |
Property Details
-
analysis
Propertyanalysis VolumeMeasurementAnalysisreadonly -
The volume measurement analysis object associated with the analysis view.
-
error
Propertyerror VolumeMeasurementError |null |undefined -
Error encountered while calculating the analysis result. The error has well defined names that can be used to provide specific error feedback to the user. See VolumeMeasurementError for the list of possible error names.
-
result
Propertyresult VolumeMeasurementResult |null |undefinedreadonly -
Result of the volume measurement. Results are calculated asynchronously and should be watched for changes.
-
type
Propertytype Stringreadonly -
The analysis view type.
For VolumeMeasurementAnalysisView3D the type is always "volume-measurement-view-3d".
Method Overview
| Name | Return Type | Summary | Class |
|---|---|---|---|
Promise<VolumeMeasurementPlacementResult> | Starts the interactive placement of a new polygon for the volume measurement analysis. | VolumeMeasurementAnalysisView3D |
Method Details
-
place
Methodplace(options){Promise<VolumeMeasurementPlacementResult>} -
Starts the interactive placement of a new polygon for the volume measurement analysis.
If the analysis does not have a geometry yet, the method allows drawing it interactively in the view. Otherwise, clicking in the view will remove the previous geometry and start a new placement operation.
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<VolumeMeasurementPlacementResult> A promise which resolves when the operation is completed successfully or rejected if it is canceled. Example// cancel the placement operation at some later point // by calling abortController.abort() const abortController = new AbortController(); try { await analysisView.place({ signal: abortController.signal }); } catch (error) { if (error.name === "AbortError") { console.log("Placement operation was cancelled."); } }