-
Name Type Description options
Projection options.
Name Type Description code
string The SRS identifier code, e.g.
EPSG:4326
.units
module:ol/proj/Units | string | undefined Units. Required unless a proj4 projection is defined for
code
.extent
module:ol/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 themodule:ol/proj/Units~METERS_PER_UNIT
lookup table.worldExtent
module:ol/extent~Extent | undefined The world extent for the SRS.
getPointResolution
function | undefined Function to determine resolution at a point. The function is called with a
number
view resolution and aCoordinate
as arguments, and returns thenumber
resolution in projection units at the passed coordinate. If this isundefined
, the defaultgetPointResolution()
function will be used.
Methods
-
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.
-
Get the code for this projection, e.g. 'EPSG:4326'.
Returns:
Code.
-
Get the validity extent for this projection.
Returns:
Extent.
-
Get the amount of meters per unit of this projection. If the projection is not configured with
metersPerUnit
or a units identifier, the return isundefined
.Returns:
Meters.
-
Get the units of this projection.
Returns:
Units.
-
Get the world extent for this projection.
Returns:
Extent.
-
Is this projection a global projection which spans the whole world?
Returns:
Whether the projection is global.
-
Set the validity extent for this projection.
Name Type Description extent
module:ol/extent~Extent Extent.
-
Set the getPointResolution function (see
module:ol/proj.getPointResolution
for this projection.Name Type Description func
function Function
-
Set if the projection is a global projection which spans the whole world
Name Type Description global
boolean Whether the projection is global.
-
Set the world extent for this projection.
Name Type Description worldExtent
module:ol/extent~Extent World extent [minlon, minlat, maxlon, maxlat].