Class: LonLat

cercaliagl.LonLat


Javascript ES5

const lonLat = new cercaliagl.LonLat(1.4151455, 41.24514);

Coordinates. Let you specify the coordinates in EPSG:4326 projection
More information about this projection: https://epsg.io/4326

new LonLat(lon, lat)

Name Type Description
lon number | string

Longitude, in geographic coordinate system

lat number | string

Latitude, in geographic coordinate system

Extends

Methods

Gets a value.

Name Type Description
key string

Key name.

Returns:
Value.

getLat(){number}

Obtain latitude coordinate

Returns:
Latitud

getLon(){number}

Obtain longitude coordinate

Returns:
Coordinate Longitude

set(key, value, silent) inherited

Sets a value.

Name Type Description
key string

Key name.

value *

Value.

silent boolean

Update without triggering an event.

toArray(){Array.<number>}

Transform position to array [longitude, latitude].

toString(){string}

Position to string. Format longitude,latitude.

Returns:
To string longitude,latitude. For example: `"1.41651,41.541451"