import { geodeticLengthIsLoaded, isLoaded, geodeticLengthLoad, load, geodeticLengthExecute } from "@arcgis/core/geometry/operators/geodeticLengthOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Returns the geodetic length of a 2D geometry.

Notes

Verify that isLoaded() returns true before using this module. Use load() to load this module's dependencies.

Type definitions

GeodeticLengthOptions

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.2

curveType

Property
Type
GeodeticCurveType | undefined

The type of geodetic curve used to determine the length.

Default value
"geodesic"

unit

Property
Type
LengthUnit | undefined

The length unit of the return value.

Default value
"meters"

Options

deprecated Type definition

Functions

geodeticLengthIsLoaded

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Indicates if all dependencies of this module have been loaded.

Signature
geodeticLengthIsLoaded (): boolean
Returns
boolean

Returns true if this module's dependencies have been loaded.

isLoaded

deprecated Function

Indicates if all dependencies of this module have been loaded.

Signature
isLoaded (): boolean
Returns
boolean

Returns true if this module's dependencies have been loaded.

geodeticLengthLoad

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Loads this module's dependencies. This method must be called first if geodeticLengthIsLoaded returns false.

See also
Signature
geodeticLengthLoad (): Promise<void>
Returns
Promise<void>

Resolves when the dependencies have been loaded.

load

deprecated Function

Loads this module's dependencies. This method must be called first if isLoaded returns false.

See also
Signature
load (): Promise<void>
Returns
Promise<void>

Resolves when the dependencies have been loaded.

geodeticLengthExecute

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Calculates the geodetic length of the input Geometry. Unless the unit option is set, the default is meters.

Signature
geodeticLengthExecute (geometry: GeometryUnion, options?: GeodeticLengthOptions): number

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

options

Additional options.

Returns
number

Returns the geodetic length of the input geometry.

Example
if (!geodeticLengthIsLoaded()) {
await geodeticLengthLoad();
}
// Calculate the geodetic length of a polyline
const length = geodeticLengthExecute(polyline);

execute

deprecated Function

Calculates the geodetic length of the input Geometry. Unless the unit option is set, the default is meters.

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

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

options

Additional options.

Returns
number

Returns the geodetic length of the input geometry.

Example
if (!geodeticLengthIsLoaded()) {
await geodeticLengthLoad();
}
// Calculate the geodetic length of a polyline
const length = geodeticLengthExecute(polyline);

Variables

geodeticLengthSupportsCurves

Variable
Since
ArcGIS Maps SDK for JavaScript 5.2

Indicates if the operator supports input geometries that contain curves. The value is null or undefined until the operator is loaded, then it will always be true.

Type
boolean | null | undefined

supportsCurves

deprecated Variable

Indicates if the operator supports input geometries that contain curves. The value is null or undefined until the operator is loaded, then it will always be true.

Type
boolean | null | undefined