UNPKG

@itwin/core-frontend

Version:
100 lines 5.33 kB
/** @packageDocumentation * @module Tiles */ import { Point2d, Range2d } from "@itwin/core-geometry"; import { Cartographic } from "@itwin/core-common"; import { GlobalLocation, GlobalLocationArea } from "../../ViewGlobalLocation"; import { MapTilingScheme } from "../internal"; /** A specialization of [Range2d]($core-geometry) representing a [Cartographic]($common) region on the surface of the Earth, * used by [[MapTile]]s. * The `x` components of the `low` and `high` points refer to the western and eastern longitudes, respectively. * The `y` components of the `low` and `high` points refer to the southern and northern latitudes, respectively. * Longitudes are stored in radians in the range [-pi, pi]. * Latitudes are stored in radians in the range [-pi/2, pi/2]. * @public */ export declare class MapCartoRectangle extends Range2d { /** Construct a new rectangle with angles specified in radians. * @param west The western longitude in radians, in [-pi, pi]. * @param south The southern latitude in radians, in [-pi/2, pi/2]. * @param east The eastern latitude in radians, in [-pi, pi]. * @param north The northern latitude in radians, in [-pi/2, pi/2]. * @note If `north` is less than `south`, they will be swapped. * @see [[fromRadians]], [[fromDegrees]], [[createZero]], and [[createMaximum]] to construct a new rectangle. */ protected constructor(west: number, south: number, east: number, north: number); /** Create a rectangle with all angles set to zero. */ static createZero(): MapCartoRectangle; /** Create a rectangle encompassing all points on the surface of the Earth. */ static createMaximum(): MapCartoRectangle; /** Create a new rectangle with angles specified in radians. * @param west The western longitude in radians, in [-pi, pi]. * @param south The southern latitude in radians, in [-pi/2, pi/2]. * @param east The eastern latitude in radians, in [-pi, pi]. * @param north The northern latitude in radians, in [-pi/2, pi/2]. * @param result An optional preallocated rectangle to hold the result. * @note If `north` is less than `south`, they will be swapped. */ static fromRadians(west: number, south: number, east: number, north: number, result?: MapCartoRectangle): MapCartoRectangle; /** Create a new rectangle with angles specified in degrees. * @param west The western longitude in degrees, in [-180, 180]. * @param south The southern latitude in degrees, in [-90, 90]. * @param east The eastern latitude in degrees, in [-180, 180]. * @param north The northern latitude in degrees, in [-90, 90]. * @param result An optional preallocated rectangle to hold the result. * @note If `north` is less than `south`, they will be swapped. */ static fromDegrees(west: number, south: number, east: number, north: number, result?: MapCartoRectangle): MapCartoRectangle; /** The western longitude in radians. */ get west(): number; set west(x: number); /** The southern latitude in radians. */ get south(): number; set south(y: number); /** The eastern longitude in radians. */ get east(): number; set east(x: number); /** The northern latitude in radians. */ get north(): number; set north(y: number); /** A non-localized string representation of this rectangle, for debugging purposes. */ get latLongString(): string; /** A pair of [[Cartographic]]s representing the same area as this rectangle. */ get globalLocationArea(): GlobalLocationArea; /** The cartographic center of this rectangle. */ get cartoCenter(): Cartographic; /** The [[globalLocationArea]] and [[cartoCenter]] of this rectangle. */ get globalLocation(): GlobalLocation; /** Reinitialize this rectangle using angles specified in radians. * @param west The western longitude in radians, in [-pi, pi]. * @param south The southern latitude in radians, in [-pi/2, pi/2]. * @param east The eastern latitude in radians, in [-pi, pi]. * @param north The northern latitude in radians, in [-pi/2, pi/2]. * @note If `north` is less than `south`, they will be swapped. */ setRadians(west?: number, south?: number, east?: number, north?: number): void; /** Returns true if the specified cartographic location is contained within this rectangle's area, ignoring elevation. */ containsCartographic(carto: Cartographic): boolean; /** Returns the position at the center of this rectangle, at an elevation of zero. * @param result An optional preallocated Cartographic to store the result. * @returns the center of this rectangle. */ getCenter(result?: Cartographic): Cartographic; /** Computes fractional coordinates of the specified position within this rectangle's area. * @see [Range2d.worldToLocal]($core-geometry) */ fractionFromCartographic(carto: Cartographic): Point2d | undefined; /** @internal */ getTileFractionRange(tilingScheme: MapTilingScheme): Range2d; /** * Compute rectangle with angles specified in degrees. * @beta */ toDegrees(): { north: number; south: number; east: number; west: number; }; } //# sourceMappingURL=MapCartoRectangle.d.ts.map