Atlaslog
Atlaslog / OpenLayers / API / Projection
OpenLayers · API reference

Projection

Quick answer

Get the axis orientation of this projection. Example values are: enu - the default easting, northing, elevation. neu - northing, easting, up - useful for "lat/long" geographic coordinates, or south orientated transverse mercator.

Last verified 2026-11-03 · OpenLayers 10.3.1 · Cite this page
Runnable examplesChinese noteAll API topics

new Projection(options)

proj/Projection.js, line 62
Name Type Description
code string

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

units Units | undefined

Units. Required unless a proj4 projection is defined for code.

extent Extent | undefined

The validity extent for the SRS.

axisOrientation string (defaults to 'enu')

The axis orientation as specified in Proj4.

global boolean (defaults to false)

Whether the projection is valid for the whole globe.

metersPerUnit number | undefined

The meters per unit for the SRS. If not provided, the units are used to get the meters per unit from the METERS_PER_UNIT lookup table.

worldExtent Extent | undefined

The world extent for the SRS.

getPointResolution GetPointResolution | undefined

Function to determine resolution at a point. The function is called with a number view resolution and a Coordinate as arguments, and returns the number resolution in projection units at the passed coordinate. If this is undefined, the default getPointResolution function will be used.

Methods

getAxisOrientation(){string}

proj/Projection.js, line 204

Get the axis orientation of this projection. Example values are: enu - the default easting, northing, elevation. neu - northing, easting, up - useful for "lat/long" geographic coordinates, or south orientated transverse mercator. wnu - westing, northing, up - some planetary coordinate systems have "west positive" coordinate systems

Returns:
Axis orientation.

getCode(){string}

proj/Projection.js, line 151

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

Returns:
Code.

getExtent(){Extent}

proj/Projection.js, line 160

Get the validity extent for this projection.

Returns:
Extent.

getMetersPerUnit(){number | undefined}

proj/Projection.js, line 180

Get the amount of meters per unit of this projection. If the projection is not configured with metersPerUnit or a units identifier, the return is undefined.

Returns:
Meters.

getUnits(){Units}

proj/Projection.js, line 169

Get the units of this projection.

Returns:
Units.

getWorldExtent(){Extent}

proj/Projection.js, line 189

Get the world extent for this projection.

Returns:
Extent.

isGlobal(){boolean}

proj/Projection.js, line 213

Is this projection a global projection which spans the whole world?

Returns:
Whether the projection is global.

setExtent(extent)

proj/Projection.js, line 246

Set the validity extent for this projection.

Name Type Description
extent Extent

Extent.

setGetPointResolution(func)

proj/Projection.js, line 267

Set the getPointResolution function (see getPointResolution for this projection.

Name Type Description
func function

Function

setGlobal(global)

proj/Projection.js, line 222

Set if the projection is a global projection which spans the whole world

Name Type Description
global boolean

Whether the projection is global.

setWorldExtent(worldExtent)

proj/Projection.js, line 257

Set the world extent for this projection.

Name Type Description
worldExtent Extent

World extent [minlon, minlat, maxlon, maxlat].

TutorialsAPI index
English reference text adapted from the official OpenLayers documentation, © OpenLayers contributors, licensed under BSD-2-Clause.
Original page: https://openlayers.org/en/latest/apidoc/module-ol_proj_Projection-Projection.html · Chinese note: /openlayers/api/projection.html
Cite this page

Atlaslog (2026). Projection. https://www.jingweizhi.com/en/openlayers/api/projection.html (accessed 2026-11-03).