import AreaMeasurement3DViewModel from "@arcgis/core/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js";const AreaMeasurement3DViewModel = await $arcgis.import("@arcgis/core/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js");- Inheritance:
- AreaMeasurement3DViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.7
Provides the logic for the AreaMeasurement3D widget and component.
- See also
AreaMeasurement3D widget - Deprecated since 4.33. Use the Area Measurement 3D component instead.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
declaredClass readonly inherited | ||
measurement readonly | | |
state readonly | "disabled" | "ready" | "measuring" | "measured" | |
| | ||
| | ||
| |
analysis
- Since
- ArcGIS Maps SDK for JavaScript 4.23
The area measurement analysis object being created or modified by the view model.
If no analysis is provided, the view model automatically creates its own analysis and adds it to the view. In this case, the analysis will also be automatically removed from the view when the view model is destroyed.
Example
// Construct an area measurement analysis object outside of the view modelconst analysis = new AreaMeasurementAnalysis({ geometry: { type: "polygon", // autocasts as new Polygon() rings: [ [-73.9817, 40.7681], [-73.9582, 40.8005], [-73.9495, 40.7968], [-73.9730, 40.7644], [-73.9817, 40.7681] ] }});
// Ensure that the analysis is added to the viewview.analyses.add(analysis);
// Frame the analysis in the viewview.goTo(analysis.extent);
// Pass the analysis object as a constructor parameter to modify it using the view modelconst viewModel = new AreaMeasurement3DViewModel({ analysis: analysis, view: view}); unit
- Type
- SystemOrAreaUnit
Unit system (imperial, metric) or specific unit used for displaying the area values. Possible values are listed in unitOptions.
unitOptions
- Type
- SystemOrAreaUnit[]
List of available units and unit systems (imperial, metric) for displaying the area values.
By default, the following units are included: metric, imperial, square-inches, square-feet, square-us-feet, square-yards, square-miles, square-meters, square-kilometers, acres, ares, hectares.
Possible unit values can only be a subset of this list.
Methods
clear
- Signature
-
clear (): void
- Since
- ArcGIS Maps SDK for JavaScript 4.16
Clears the current measurement.
- Returns
- void
Type definitions
MeasurementValue
Measurement value.
state
- Type
- "available" | "unavailable" | "invalid"
State of the measurement value controlling how the value is displayed in the widget.
| Value | Description |
|---|---|
| available | measured value is available |
| unavailable | measured value is not available due an incomplete measurement |
| invalid | measured value is not available due to an invalid measurement configuration (e.g. self-intersecting polygon) |
Measurement
mode
- Type
- MeasurementMode
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.
In geodesic mode, the area and perimeter length are computed from a geodesic polygon on the WGS84 ellipsoid.