AMD:
require(["esri/geometry/operators/areaOperator"], (areaOperator) => { /* code goes here */ });
ESM:
import * as areaOperator from "@arcgis/core/geometry/operators/areaOperator.js";
Object:
esri/geometry/operators/areaOperator
Since: ArcGIS Maps SDK for JavaScript 4.31
Returns the planar area of a 2D geometry in its spatial reference units.
Property Overview
Name | Type | Summary | Object |
---|---|---|---|
Indicates if the operator supports input geometries that contain curves. | areaOperator |
Property Details
-
supportsCurves
supportsCurves Booleanreadonly
-
Indicates if the operator supports input geometries that contain curves.
- Default Value:true
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Calculates the planar area of the input geometry. | areaOperator |
Method Details
-
execute
execute(geometry, options){Number}
-
Calculates the planar area of the input geometry.
Parametersgeometry GeometryUnionThe geometry to calculate the area from.
options ObjectoptionalAdditional options.
Specificationunit AreaUnitoptionalThe area unit of the return value.
ReturnsType Description Number Returns the planar area of the geometry. Example// Calculate the area of a polygon const area = areaOperator.execute(polygon);