Classdesc

Projection definition class. One of these is created for each projection supported in the application and stored in the ol.proj namespace. You can use these in applications, but this is not required, as API params and options use ol.ProjectionLike which means the simple string code will suffice.

You can use ol.proj.get to retrieve the object for a particular projection.

The library includes definitions for EPSG:4326 and EPSG:3857, together with the following aliases:

If you use proj4js, aliases can be added using proj4.defs(); see documentation. To set an alternative namespace for proj4, use ol.proj.setProj4.

Param: options

Projection options.

Struct

Api

stable

Constructors

  • Parameters

    Returns Projection

    Classdesc

    Projection definition class. One of these is created for each projection supported in the application and stored in the ol.proj namespace. You can use these in applications, but this is not required, as API params and options use ol.ProjectionLike which means the simple string code will suffice.

    You can use ol.proj.get to retrieve the object for a particular projection.

    The library includes definitions for EPSG:4326 and EPSG:3857, together with the following aliases:

    If you use proj4js, aliases can be added using proj4.defs(); see documentation. To set an alternative namespace for proj4, use ol.proj.setProj4.

    Struct

    Api

    stable

Methods

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

    Returns string

    Code.

    Api

    stable

  • Get the validity extent for this projection.

    Returns Extent

    Extent.

    Api

    stable

  • 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 number

    Meters.

    Api

    stable

  • Get the resolution of the point in degrees or distance units. For projections with degrees as the unit this will simply return the provided resolution. The default for other projections is to estimate the point resolution by transforming the 'point' pixel to EPSG:4326, measuring its width and height on the normal sphere, and taking the average of the width and height. An alternative implementation may be given when constructing a projection. For many local projections, such a custom function will return the resolution unchanged.

    Parameters

    • resolution: number

      Resolution in projection units.

    • point: Coordinate

      Point.

    Returns number

    Point resolution in projection units.

    Api

  • Get the units of this projection.

    Returns ol.proj.Units

    Units.

    Api

    stable

  • Get the world extent for this projection.

    Returns Extent

    Extent.

    Api

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

    Returns boolean

    Whether the projection is global.

    Api

    stable

  • Set the validity extent for this projection.

    Parameters

    Returns void

    Api

    stable

  • Set the getPointResolution function for this projection.

    Parameters

    • func: ((resolution, coords) => number)

      Function

        • (resolution, coords): number
        • Parameters

          Returns number

    Returns void

    Api

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

    Parameters

    • global: boolean

      Whether the projection is global.

    Returns void

    Api

    stable

  • Set the world extent for this projection.

    Parameters

    • worldExtent: Extent

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

    Returns void

    Api

Generated using TypeDoc