Extent

Source: Extent.ts:12

Represents geographical coordinates extent.


Constructor

new Extent(sw?: LonLat, ne?: LonLat): Extent

Parameters

  • sw (LonLat, optional) — South West extent corner coordinates.
  • ne (LonLat, optional) — North East extent corner coordinates.

Instance Methods

setByCoordinates(arr: Array.<LonLat>): Extent

Sets current bounding extent object by coordinate array.

Parameters

  • arr (Array.<LonLat>) — Coordinate array.

Returns

isInside(lonlat: LonLat): boolean

Determines if point inside extent.

Parameters

  • lonlat (LonLat) — Coordinate point.

Returns

  • boolean — Returns true if point inside extent.

overlaps(e: Extent): boolean

Returns true if two extent overlap each other.

Parameters

  • e (Extent) — Another extent.

Returns

  • boolean

getWidth(): number

Gets extent width.

Returns

  • number — Extent width.

getHeight(): number

Gets extent height.

Returns

  • number — Extent height.

clone(): Extent

Creates clone instance of the current extent.

Returns

getCenter(): number

Gets the center coordinate of the extent.

Returns

  • number — Center coordinate.

getNorthWest()

getNorthEast()

getSouthWest()

getSouthEast()

getNorth()

getWest()

getSouth()

equals(extent: Extent): boolean

Returns extents are equals.

Parameters

Returns

  • boolean

forwardMercator(): Extent

Converts extent coordinates to mercator projection coordinates.

Returns

  • Extent — New instance of the current extent.

inverseMercator(): Extent

Converts extent coordinates from mercator projection to degrees.

Returns

  • Extent — New instance of the current extent.

getCartesianBounds(ellipsoid: Ellipsoid): Array.<number>

Gets cartesian bounding bounds of the current ellipsoid.

Parameters

Returns

  • Array.<number> — Cartesian 3d coordinate array. (exactly 6 entries)

Static Methods

createFromArray(arr: Array.<number>): Extent

Creates extent instance from values in array.

Parameters

  • arr (Array.<number>) — South west and north-east longitude and latitudes packed in array. (exactly 4 entries)

Returns

createByCoordinates(arr: Array.<LonLat>): Extent

Creates bound extent instance by coordinate array.

Parameters

  • arr (Array.<LonLat>) — Coordinate array.

Returns

createByCoordinatesArr(arr: Array.<Array.<number>>): Extent

Creates bound extent instance by coordinates array.

Parameters

  • arr (Array.<Array.<number>>) — Coordinate array. (exactly 2 entries)

Returns

fromTile( x: number, y: number, z: number, width: number, height: number, ): Extent

Creates extent by merсator grid tile coordinates.

Parameters

  • x (number)
  • y (number)
  • z (number)
  • width (number)
  • height (number)

Returns