import { areaExecute, execute, areaSupportsCurves, supportsCurves } from "@arcgis/core/geometry/operators/areaOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Returns the planar area of a 2D geometry.

Area operator

Type definitions

AreaOptions

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.2

unit

Property
Type
AreaUnit | undefined

The area unit of the return value. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.

Options

deprecated Type definition
Supertypes
AreaOptions

Functions

areaExecute

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Calculates the planar area of the input geometry.

Signature
areaExecute (geometry: GeometryUnion, options?: AreaOptions): number

Parameters

ParameterTypeDescriptionRequired
geometry

The geometry to calculate the area from.

options

Additional options.

Returns
number

Returns the planar area of the geometry.

Example
// Calculate the area of a polygon
const area = areaExecute(polygon);

execute

deprecated Function

Calculates the planar area of the input geometry.

Signature
execute (geometry: GeometryUnion, options?: AreaOptions): number

Parameters

ParameterTypeDescriptionRequired
geometry

The geometry to calculate the area from.

options

Additional options.

Returns
number

Returns the planar area of the geometry.

Example
// Calculate the area of a polygon
const area = areaExecute(polygon);

Variables

areaSupportsCurves

Variable
Since
ArcGIS Maps SDK for JavaScript 5.2

Indicates if the operator supports input geometries that contain curves. The value will always be true.

Type
boolean
Default value
true

supportsCurves

deprecated Variable

Indicates if the operator supports input geometries that contain curves. The value will always be true.

Type
ReturnType