import type { ClonableMixin } from "../../core/Clonable.js"; import type { JSONSupport } from "../../core/JSONSupport.js"; import type { GeometryWithoutMeshUnion } from "../../geometry/types.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"; /** @since 5.2 */ export interface OutDistanceProperties extends Partial> { /** * Geometry used as the reference for measuring distance. Distances are measured from each feature to this geometry. * If not specified, distances are measured from the [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry). * * @since 5.2 */ referenceGeometry?: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" })) | null; } /** * Defines the [outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) parameter on a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) and specifies whether to return the distance * of each feature in the query result. It can also specify the [order](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#order) in which features are returned based on distance. * Distance values are returned only when the `outDistance` is specified and its [OutDistance.returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) property is `true`. * The distance values are included in the [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance) property of each feature. * * Distance values are measured from [referenceGeometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#referenceGeometry) when specified; otherwise, they are measured * from [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry). * * > [!WARNING] * > * > **Known Limitations** * > * > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability * > is `true`. * * @since 5.2 * @see [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) * @see [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance) */ export default class OutDistance extends OutDistanceSuperclass { constructor(properties?: OutDistanceProperties); /** * Indicates whether to return features sorted by distance. * The `"ascending"` option returns the nearest features first while the `"descending"` option returns farthest * features first, and null indicates there should be no distance-based ordering. * * @since 5.2 */ order?: "ascending" | "descending" | null; /** * The distance unit used for the returned distance values. This property applies only when * [returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) is `true`. * If omitted, the unit is determined from the [Query.outSpatialReference](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outSpatialReference). * If no output spatial reference is specified, the service's spatial reference unit is used. * * @since 5.2 */ outDistanceUnit?: "feet" | "miles" | "nautical-miles" | "us-nautical-miles" | "meters" | "kilometers" | null; /** * Geometry used as the reference for measuring distance. Distances are measured from each feature to this geometry. * If not specified, distances are measured from the [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry). * * @since 5.2 */ get referenceGeometry(): GeometryWithoutMeshUnion | null | undefined; set referenceGeometry(value: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" })) | null | undefined); /** * Indicates whether to return the calculated distance value for each feature in a distance query result. * When graphics are queried, distance values are returned in each feature's [distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance) property. * * @since 5.2 */ accessor returnDistance: boolean | null | undefined; } declare const OutDistanceSuperclass: typeof JSONSupport & typeof ClonableMixin