Class: Projection

ol.proj.Projection

Class for coordinate transforms between coordinate systems. By default, OpenLayers ships with the ability to transform coordinates between geographic (EPSG:4326) and web or spherical mercator (EPSG:3857) coordinate reference systems.

Additional transforms may be added by using the proj4js library. If the proj4js library is included, the method will work between any two coordinate reference systems with proj4js definitions.

new ol.proj.Projection(options) experimental

Name Type Description
options

Projection options.

Name Type Description
code string

The SRS identifier code, e.g. EPSG:4326.

units ol.proj.Units | string

Units.

extent ol.Extent | undefined optional

The validity extent for the SRS.

axisOrientation string | undefined optional

The axis orientation as specified in Proj4. The default is enu.

global boolean | undefined optional

Whether the projection is valid for the whole globe. Default is false.

Subclasses

Methods

getCode(){string} experimental

Get the code for this projection, e.g. 'EPSG:4326'.

Returns:
Code.

getExtent(){ol.Extent} experimental

Get the validity extent for this projection.

Returns:
Extent.

getUnits(){ol.proj.Units} experimental

Get the units of this projection.

Returns:
Units.