AreaMeasurement3DViewModel

AMD: require(["esri/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel"], (AreaMeasurement3DViewModel) => { /* code goes here */ });
ESM: import AreaMeasurement3DViewModel from "@arcgis/core/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel";
Class: esri/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel
Inheritance: AreaMeasurement3DViewModel Accessor
Since: ArcGIS API for JavaScript 4.7

Provides the logic for the AreaMeasurement3D widget.

See also:

Constructors

new AreaMeasurement3DViewModel(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
AreaMeasurementAnalysismore details

The area measurement analysis object being created or modified by the view model.

more detailsAreaMeasurement3DViewModel
Stringmore details

The name of the class.

more detailsAccessor
Objectmore details

The current measurement of the area.

more detailsAreaMeasurement3DViewModel
Stringmore details

The view model's state.

more detailsAreaMeasurement3DViewModel
SystemOrAreaUnitmore details

Unit system (imperial, metric) or specific unit used for displaying the area values.

more detailsAreaMeasurement3DViewModel
SystemOrAreaUnit[]more details

List of available units and unit systems (imperial, metric) for displaying the area values.

more detailsAreaMeasurement3DViewModel
SceneViewmore details

The view from which the widget will operate.

more detailsAreaMeasurement3DViewModel

Property Details

Since: ArcGIS API for JavaScript 4.23

The area measurement analysis object being created or modified by the view model.

This property can be set during view model construction, to provide an existing analysis to the view model for modification. Properties on the analysis can also be updated once it's assigned to the view model.

If no analysis is provided during view model construction, 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 model
const 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 view
view.analyses.add(analysis);

// Frame the analysis in the view
view.goTo(analysis.extent);

// Pass the analysis object as a constructor parameter to modify it using the view model
const viewModel = new AreaMeasurement3DViewModel({
  analysis: analysis,
  view: view
});
declaredClass Stringreadonly inherited

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

measurement Objectreadonly

The current measurement of the area.

Properties:
mode String

Describes the mode in which the measurement was taken. 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.

Possible Values:"euclidean"|"geodesic"

The area of the polygon.

perimeterLength MeasurementValue

The perimeter length of the polygon.

state Stringreadonly

The view model's state.

Value Description
disabled not ready yet
ready ready for measuring
measuring currently measuring
measured measuring has finished

Possible Values:"disabled"|"ready"|"measuring"|"measured"

Default Value:disabled

Unit system (imperial, metric) or specific unit used for displaying the area values. Possible values are listed in unitOptions.

unitOptions 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.

view SceneView

The view from which the widget will operate.

Method Overview

Name Return Type Summary Class
more details

Clears the current measurement.

more detailsAreaMeasurement3DViewModel
more details

Starts a new measurement.

more detailsAreaMeasurement3DViewModel

Method Details

clear()
Since: ArcGIS API for JavaScript 4.16

Clears the current measurement.

start()
Since: ArcGIS API for JavaScript 4.16

Starts a new measurement.

Example:
const areaMeasurement3DViewModel = new AreaMeasurement3DViewModel({
  view: view,
  unit: "square-meters"
});

await areaMeasurement3DViewModel.start();

Type Definitions

MeasurementValue Object

Measurement value.

Properties:
text String

Textual representation of the measured value.

state String

State of the measured value.

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)

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