IProjection

Projection. Describes how the real map is projected onto the endless pixel plane. One "world" should be sized 256x256 pixels at the zero zoom level, while the upper left corner of this world has the coordinates (0,0) and the axes coordinates go to the right and down. "Worlds" can be connected along any axis (or both axes at once).

Constructor | Methods

Constructor

IProjection()

Methods

Name Returns Description
fromGlobalPixels(globalPixelPoint, zoom)

Number[]

Converts pixel coordinates to the projection's coordinates at the specified zoom level.

getCoordSystem()

ICoordSystem

Returns the coordinate system that is used by the projection.

isCycled()

Boolean[]

Indicator of projection cycling.

toGlobalPixels(coordPoint, zoom)

Number[]

Converts projection coordinates to global pixel coordinates at the specified zoom level.

Methods details

fromGlobalPixels

{Number[]} fromGlobalPixels(globalPixelPoint, zoom)

Converts pixel coordinates to the projection's coordinates at the specified zoom level.

Returns a point in the projection's coordinates.

Parameters:

Parameter Default value Description
globalPixelPoint *

Type: Number[]

A point in pixel coordinates.

zoom *

Type: Number

Zoom level.

* Mandatory parameter/option.

getCoordSystem

{ICoordSystem} getCoordSystem()

Returns the coordinate system that is used by the projection.

isCycled

{Boolean[]} isCycled()

Indicator of projection cycling.

Returns a pair of flags that show whether the map is looped along the pixel axes (x/y).

toGlobalPixels

{Number[]} toGlobalPixels(coordPoint, zoom)

Converts projection coordinates to global pixel coordinates at the specified zoom level.

Returns a pair of pixel coordinates.

Parameters:

Parameter Default value Description
coordPoint *

Type: Number[]

A point in the projection's coordinates.

zoom *

Type: Number

Zoom level.

* Mandatory parameter/option.