Namespace: mercator

og.mercator

Mercator projection functions and parameters.

Members

static,constantog.mercator.MAX_LATnumber

Max mercator latitude.

static,constantog.mercator.MIN_LATnumber

Min mercator latitude.

static,constantog.mercator.ONE_BY_POLE_DOUBLEnumber

One by mercator double size.

static,constantog.mercator.POLEnumber

Mercator size.

static,constantog.mercator.POLE_DOUBLEnumber

Double mercator size.

Methods

staticog.mercator.forward_lat(lat){number}

Converts degrees latitude to mercator coordinate.
Name Type Description
lat number Degrees geodetic latitude.
Returns:
Type Description
number

staticog.mercator.forward_lon(lon){number}

Converts degrees longitude to mercator coordinate.
Name Type Description
lon number Degrees geodetic longitude.
Returns:
Type Description
number

staticog.mercator.forwardArray(lonLatArr){Array.<og.LonLat>}

Converts geodetic coordinate array to mercator coordinate array.
Name Type Description
lonLatArr Array.<og.LonLat> LonLat array to convert.
Returns:
Type Description
Array.<og.LonLat>

staticog.mercator.getTileX(lon, zoom){number}

Returns mercator map tile grid horizontal coordinate index by geodetic longitude and zoom level. Where top left corner of the grid is 0 coordinate index.
Name Type Description
lon number Geodetic degrees longitude.
zoom number Zoom level.
Returns:
Type Description
number

staticog.mercator.getTileY(lat, zoom){number}

Returns mercator map tile grid vertical coordinate index by geodetic latitude and zoom level. Where top left corner of the grid is 0 coordinate index.
Name Type Description
lat number Geodetic degrees latitude.
zoom number Zoom level.
Returns:
Type Description
number

staticog.mercator.inverse_lat(lon){number}

Converts mercator latitude to degrees coordinate.
Name Type Description
lon number Mercator latitude.
Returns:
Type Description
number

staticog.mercator.inverse_lon(lon){number}

Converts mercator longitude to degrees coordinate.
Name Type Description
lon number Mercator longitude.
Returns:
Type Description
number