import { execute, supportsCurves } from "@arcgis/core/geometry/operators/lengthOperator.js";const { execute, 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
Options
Type definition
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
| Name | Return Type | Object |
|---|---|---|
| | |
| | ||
| |
execute
Function
Calculates the planar length of the input geometry.
- Signature
-
execute (geometry: GeometryUnion, options?: Options): 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 = lengthOperator.execute(polyline);Variables
supportsCurves
Variable
Indicates if the operator supports input geometries that contain curves.
The value will always be true.
- Type
- boolean
- Default value
- true