UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

64 lines (62 loc) 5.97 kB
import type Accessor from "../../core/Accessor.js"; import type { GeometryUnion } from "../../geometry/types.js"; import type { GeometryOperationLengthUnit } from "./types.js"; import type { MeshProperties } from "../../geometry/Mesh.js"; import type { PolylineProperties } from "../../geometry/Polyline.js"; import type { PolygonProperties } from "../../geometry/Polygon.js"; import type { PointProperties } from "../../geometry/Point.js"; import type { MultipointProperties } from "../../geometry/Multipoint.js"; import type { ExtentProperties } from "../../geometry/Extent.js"; export interface DistanceParametersProperties extends Partial<Pick<DistanceParameters, "distanceUnit" | "geodesic">> { /** * The geometry from which the distance is to be measured. The geometry can be * a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/), [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/), * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/), or a [Multipoint](https://developers.arcgis.com/javascript/latest/references/core/geometry/Multipoint/). */ geometry1?: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null; /** * The geometry to which the distance is to be measured. The geometry can be * a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/), [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/), * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/), or a [Multipoint](https://developers.arcgis.com/javascript/latest/references/core/geometry/Multipoint/). */ geometry2?: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null; } /** * Defines the input parameters when calling * [distance()](https://developers.arcgis.com/javascript/latest/references/core/rest/geometryService/#distance). * * @since 4.20 * @see [distance()](https://developers.arcgis.com/javascript/latest/references/core/rest/geometryService/#distance) * @see [ArcGIS REST API - Distance](https://developers.arcgis.com/rest/services-reference/distance.htm) */ export default class DistanceParameters extends Accessor { constructor(properties?: DistanceParametersProperties); /** * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/references/core/rest/support/DistanceParameters/#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/references/core/rest/support/DistanceParameters/#geometry2). If the unit * is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). */ accessor distanceUnit: GeometryOperationLengthUnit | null | undefined; /** When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/references/core/rest/support/DistanceParameters/#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/references/core/rest/support/DistanceParameters/#geometry2) is measured. */ accessor geodesic: boolean | null | undefined; /** * The geometry from which the distance is to be measured. The geometry can be * a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/), [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/), * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/), or a [Multipoint](https://developers.arcgis.com/javascript/latest/references/core/geometry/Multipoint/). */ get geometry1(): GeometryUnion | null | undefined; set geometry1(value: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null | undefined); /** * The geometry to which the distance is to be measured. The geometry can be * a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/), [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/), * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/), or a [Multipoint](https://developers.arcgis.com/javascript/latest/references/core/geometry/Multipoint/). */ get geometry2(): GeometryUnion | null | undefined; set geometry2(value: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null | undefined); /** * Converts an instance of this class to its ArcGIS portal JSON representation. * See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/using-fromjson) topic in the Guide for more information. * * @returns The ArcGIS portal JSON representation of an instance of this class. */ toJSON(): object; }