Constructor#
new LonLat(lonopt, latopt, heightopt)#
Name | Type | Attributes | Description |
---|---|---|---|
lon | number | <optional> | Longitude. |
lat | number | <optional> | Latitude. |
height | number | <optional> | Height over the surface. |
Methods#
clone() → {LonLat}#
Clone the coordinates.
- Type:
- LonLat
copy(lonLatopt) → {LonLat}#
Copy coordinates.
Name | Type | Attributes | Description |
---|---|---|---|
lonLat | LonLat | <optional> | Coordinates to copy. |
- Type:
- LonLat
equal(b) → {boolean}#
Compares coordinates.
Name | Type | Description |
---|---|---|
b | LonLat | Coordinate to compare with. |
- Type:
- boolean
forwardMercator() → {LonLat}#
Converts to mercator coordinates.
- Type:
- LonLat
inverseMercator() → {LonLat}#
Converts from mercator coordinates.
- Type:
- LonLat
isZero() → {boolean}#
Check zero coordinates
- Type:
- boolean
set(lonopt, latopt, heightopt) → {LonLat}#
Sets coordinates.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
lon | number | <optional> | 0 | Longitude. |
lat | number | <optional> | 0 | Latitude. |
height | number | <optional> | 0 | Height. |
- Type:
- LonLat
toArray() → {Array.<number>}#
Create array from lonLat
- Type:
- Array.<number>
(static) createFromArray(arr) → {LonLat}#
Creates an object by coordinate array.
Name | Type | Description |
---|---|---|
arr | Array.<number> | Coordinates array, where first is longitude, second is latitude and third is a height. (exactly 3 entries) |
- Type:
- LonLat
(static) forwardMercator(lon, lat, heightopt) → {LonLat}#
Converts degrees to mercator coordinates.
Name | Type | Attributes | Description |
---|---|---|---|
lon | number | Degrees longitude. | |
lat | number | Degrees latitude. | |
height | number | <optional> | Height. |
- Type:
- LonLat
(static) forwardMercatorRes(lonLat, res) → {LonLat}#
Converts degrees to mercator coordinates.
- Output mercator coordinates
- Type:
- LonLat
(static) inverseMercator(x, y, heightopt) → {LonLat}#
Converts mercator to degrees coordinates.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x | number | Mercator longitude. | ||
y | number | Mercator latitude. | ||
height | number | <optional> | 0 | Height. |
- Type:
- LonLat
(static) join()#
Creates coordinates array.
(static) toArray(lonLat) → {Array.<number>}#
Create array from lonLat
Name | Type | Description |
---|---|---|
lonLat |
- Type:
- Array.<number>