▾
import { lengthExecute, execute, lengthSupportsCurves, supportsCurves } from "@arcgis/core/geometry/operators/lengthOperator.js";const { lengthExecute, execute, lengthSupportsCurves, supportsCurves } = await $arcgis.import("@arcgis/core/geometry/operators/lengthOperator.js");- Since
- ArcGIS Maps SDK for JavaScript 4.31
Returns the planar length of a 2D geometry.

Type definitions
LengthOptions
Type definition
- Since
- ArcGIS Maps SDK for JavaScript 5.2
unit
Property
- Type
- LengthUnit | undefined
The length 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
lengthExecute
Function
- Since
- ArcGIS Maps SDK for JavaScript 5.2
Calculates the planar length of the input geometry.
- Signature
-
lengthExecute (geometry: GeometryUnion, options?: LengthOptions): number
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| geometry | The geometry to calculate the length from. | | |
| options | Additional options. | |
- Returns
- number
Returns the planar length of the geometry.
- Example
- // Calculate the length of a polylineconst length = lengthExecute(polyline);
execute
deprecated Function
Calculates the planar length of the input geometry.
- Signature
-
execute (geometry: GeometryUnion, options?: LengthOptions): number
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| geometry | The geometry to calculate the length from. | | |
| options | Additional options. | |
- Returns
- number
Returns the planar length of the geometry.
- Example
- // Calculate the length of a polylineconst length = lengthExecute(polyline);
Variables
lengthSupportsCurves
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