@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
38 lines (35 loc) • 1.15 kB
TypeScript
/**
* Returns the planar length of a 2D geometry.
*
* 
*
* @since 4.31
*/
import type { LengthUnit } from "../../core/units.js";
import type { GeometryUnion } from "../types.js";
export interface Options {
/**
* 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.
*/
unit?: LengthUnit;
}
/**
* Calculates the planar length of the input geometry.
*
* @param geometry - The geometry to calculate the length from.
* @param options - Additional options.
* @returns Returns the planar length of the geometry.
* @example
* // Calculate the length of a polyline
* const length = lengthOperator.execute(polyline);
*/
export function execute(geometry: GeometryUnion, options?: Options): number;
/**
* Indicates if the operator supports input geometries that contain curves.
* The value will always be `true`.
*
* @default true
*/
export const supportsCurves: boolean;