Skip to main content

GeoPoint

A single point geometry, such as a specific location, address, or longitude, latitude pair.

Implements​

Constructors​

new GeoPoint()​

new GeoPoint(): GeoPoint

Create a new GeoPoint object with default coordinates.

Returns​

GeoPoint

new GeoPoint()​

new GeoPoint(geoJSONPosition, bbox?): GeoPoint

Create a new GeoPoint instance from another GeoJSONPosition coordinates.

Parameters​

ParameterType
geoJSONPositionCoordinates2D | Coordinates3D
bbox?BBox2DLiteral | BBox3DLiteral | GeoBoundingBox

Returns​

GeoPoint

new GeoPoint()​

new GeoPoint(geoLocationCoordinates, bbox?): GeoPoint

Create a new GeoPoint instance from the browser's Geolocation API coordinates.

Parameters​

ParameterType
geoLocationCoordinatesGeolocationCoordinatesLike
bbox?BBox2DLiteral | BBox3DLiteral | GeoBoundingBox

Returns​

GeoPoint

See​

MDN Web Docs

new GeoPoint()​

new GeoPoint(latLngLiteral, bbox?): GeoPoint

Creates a new GeoPoint instance from a Google Maps API google.maps.LatLngLiteral | LatLngLiteral object.

Parameters​

ParameterType
latLngLiteralLatLngLiteral
bbox?BBox2DLiteral | BBox3DLiteral | GeoBoundingBox

Returns​

GeoPoint

new GeoPoint()​

new GeoPoint(interpolatedCoords, bbox?): GeoPoint

Creates a new GeoPoint instance from internal coordinates.

Parameters​

ParameterType
interpolatedCoordsInternalPointCoordinates
bbox?BBox2DLiteral | BBox3DLiteral | GeoBoundingBox

Returns​

GeoPoint

new GeoPoint()​

new GeoPoint(latLng, bbox?): GeoPoint

Creates a new GeoPoint instance from a Google Maps API google.maps.LatLng | LatLng object.

Parameters​

ParameterType
latLngLatLngLiteral
bbox?BBox2DLiteral | BBox3DLiteral | GeoBoundingBox

Returns​

GeoPoint

new GeoPoint()​

new GeoPoint(geoPointJSON, bbox?): GeoPoint

Create a new GeoPoint instance from another PointLiteral.

Parameters​

ParameterType
geoPointJSONPointLiteral
bbox?BBox2DLiteral | BBox3DLiteral | GeoBoundingBox

Returns​

GeoPoint

new GeoPoint()​

new GeoPoint(input, bbox?): GeoPoint

Create a new GeoPoint instance.

Parameters​

ParameterType
inputGeoPointInput
bbox?BBox2DLiteral | BBox3DLiteral | GeoBoundingBox

Returns​

GeoPoint

Properties​

boundingBox​

boundingBox: null | GeoBoundingBox = null;

The bounding box literal of the GeoPoint.

See​


type​

readonly type: "Point" = GeometryType.Point;

Declares the type of GeoJSON object as a Point geometry.

Implementation of​

PointLiteral.type

Accessors​

altitude​

get altitude(): number

The altitude of the point, i.e. the z-coordinate.

This is optional and is typically measured in meters.

Default​

0
set altitude(value): void

Parameters​

ParameterType
valuenumber

Returns​

number


bbox​

get bbox(): undefined | BBox2DLiteral | BBox3DLiteral

The bounding box literal of the GeoPoint.

See​

set bbox(bbox): void

A bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.

This is useful when defining the extent of a GeoJSON object, i.e. the minimum and maximum coordinates of the object's Geometries, Features, or Feature Collections.

@TJS-type array @TJS-items.type number

See​

GeoJSON Bounding Boxes

Parameters​

ParameterType
bboxundefined | BBox2DLiteral | BBox3DLiteral

Returns​

undefined | BBox2DLiteral | BBox3DLiteral

A bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.

This is useful when defining the extent of a GeoJSON object, i.e. the minimum and maximum coordinates of the object's Geometries, Features, or Feature Collections.

@TJS-type array @TJS-items.type number

See​

GeoJSON Bounding Boxes

Implementation of​

PointLiteral.bbox


coordinates​

get coordinates(): Coordinates2D | Coordinates3D

A pair of coordinates in the form of [longitude, latitude].

@TJS-type array @TJS-items.type number

See​

Point2DCoordinates for more information.

set coordinates(coords): void

A pair of coordinates in the form of [longitude, latitude].

@TJS-type array @TJS-items.type number

See​

Point2DCoordinates for more information.

Parameters​

ParameterType
coordsCoordinates2D | Coordinates3D

Returns​

Coordinates2D | Coordinates3D

A pair of coordinates in the form of [longitude, latitude].

@TJS-type array @TJS-items.type number

See​

Point2DCoordinates for more information.

Implementation of​

PointLiteral.coordinates


latitude​

get latitude(): number

The latitude of the point in degrees, i.e. the y-coordinate.

Values outside the range will be clamped to the poles.

set latitude(value): void

Parameters​

ParameterType
valuenumber

Returns​

number


longitude​

get longitude(): number

The longitude of the point in degrees, i.e. the x-coordinate.

Values outside the range will be wrapped around to the opposite side of the globe.

set longitude(value): void

Parameters​

ParameterType
valuenumber

Returns​

number

Methods​

[iterator]()​

iterator: Iterator<number, any, any>

Returns​

Iterator<number, any, any>


is2D()​

is2D(): boolean

Whether the GeoPoint is 2-dimensional.

Returns​

boolean


is3D()​

is3D(): boolean

Whether the GeoPoint is 3-dimensional.

Returns​

boolean


isNullIsland()​

isNullIsland(): boolean

Whether the GeoPoint is the null island at 0, 0.

Returns​

boolean


to2DCoordinates()​

to2DCoordinates(): Coordinates2D

Returns​

Coordinates2D


to3DCoordinates()​

to3DCoordinates(): Coordinates3D

Returns​

Coordinates3D


toDMS()​

toDMS(): string

Converts the GeoPoint to DMS (Degrees, Minutes, Seconds) format.

Returns​

string


toGoogleLatLngLiteral()​

toGoogleLatLngLiteral(): LatLngLiteral

Converts the GeoPoint to a Google Maps API google.maps.LatLngLiteral | LatLngLiteral object.

Returns​

LatLngLiteral


toH3Cell()​

toH3Cell(resolution): H3Cell

Converts the GeoPoint to a H3 short cell address.

Parameters​

ParameterTypeDefault value
resolutionnumber15

Returns​

H3Cell


toH3ShortCell()​

toH3ShortCell(resolution): H3CellShort

Converts the GeoPoint to a H3 short cell address.

Parameters​

ParameterTypeDefault value
resolutionnumber15

Returns​

H3CellShort


toJSON()​

toJSON(): PointLiteral

Returns​

PointLiteral


toString()​

toString(): string

Returns a string representation of an object.

Returns​

string


from()​

static from(input): null | GeoPoint

Attempts to create a new GeoPoint instance from the given input.

Parameters​

ParameterType
inputunknown

Returns​

null | GeoPoint