geodeticLengthOperator

AMD: require(["esri/geometry/operators/geodeticLengthOperator"], (geodeticLengthOperator) => { /* code goes here */ });
ESM: import * as geodeticLengthOperator from "@arcgis/core/geometry/operators/geodeticLengthOperator.js";
Object: esri/geometry/operators/geodeticLengthOperator
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.

Property Overview

Name Type Summary Object

Indicates if the operator supports input geometries that contain curves.

geodeticLengthOperator

Property Details

supportsCurves

Property
supportsCurves Boolean |null |undefinedreadonly

Indicates if the operator supports input geometries that contain curves.

Default Value:true

Method Overview

Name Return Type Summary Object

Calculates the geodetic length of the input Geometry.

geodeticLengthOperator

Indicates if all dependencies of this module have been loaded.

geodeticLengthOperator
Promise

Loads this module's dependencies.

geodeticLengthOperator

Method Details

execute

Method
execute(geometry, options){Number}

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

Parameters
Specification
geometry GeometryUnion

The input geometry.

options Object
optional

Additional options.

Specification
curveType String
optional
Default Value: "geodesic"

The type of geodetic curve used to determine the length.

Possible Values:"geodesic"|"loxodrome"|"great-elliptic"|"normal-section"|"shape-preserving"

unit LengthUnit
optional

The length unit of the return value.

Returns
Type Description
Number Returns the geodetic length of the input geometry.
Example
if (!geodeticLengthOperator.isLoaded()) {
  await geodeticLengthOperator.load();
}

// Calculate the geodetic length of a polyline
const length = geodeticLengthOperator.execute(polyline);

isLoaded

Method
isLoaded(){Boolean}

Indicates if all dependencies of this module have been loaded.

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

load

Method
load(){Promise}

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

Returns
Type Description
Promise Resolves when the dependencies have been loaded.
See also

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.