Skip to content
import { execute, 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

Options

Type definition

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.

Functions

NameReturn TypeObject

execute

Function

Calculates the planar area of the input geometry.

Signature
execute (geometry: GeometryUnion, options?: Options): 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 = areaOperator.execute(polygon);

Variables

supportsCurves

Variable

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

Type
boolean
Default value
true