StoryMapJS API
    Preparing search index...

    Interface OlProjection

    In most cases, you should not need to create instances of this class. Instead, where projection information is required, you can use a string projection code or identifier (e.g. EPSG:4326) instead of a projection instance.

    The library includes support for transforming coordinates between the following projections:

    WGS 84 / Geographic - Using codes EPSG:4326, CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, urn:ogc:def:crs:OGC:1.3:CRS84, urn:ogc:def:crs:OGC:2:84, http://www.opengis.net/gml/srs/epsg.xml#4326, or urn:x-ogc:def:crs:EPSG:4326 WGS 84 / Spherical Mercator - Using codes EPSG:3857, EPSG:102100, EPSG:102113, EPSG:900913, urn:ogc:def:crs:EPSG:6.18:3:3857, or http://www.opengis.net/gml/srs/epsg.xml#3857 WGS 84 / UTM zones - Using codes EPSG:32601 through EPSG:32660 for northern zones and EPSG:32701 through EPSG:32760 for southern zones. Note that the built-in UTM transforms are lower accuracy (with errors on the order of 0.1 m) than those that you might get in a library like proj4js.

    For additional projection support, or to use higher accuracy transforms than the built-in ones, you can use the proj4js library. With proj4js, after adding any new projection definitions, call the :ol/proj/proj4.register function.

    You can use the :ol/proj.get function to retrieve a projection instance for one of the registered projections.

    interface OlProjection {
        canWrapX(): boolean;
        getAxisOrientation(): string;
        getCode(): string;
        getDefaultTileGrid(): TileGrid;
        getExtent(): Extent;
        getMetersPerUnit(): number | undefined;
        getPointResolutionFunc(): GetPointResolution | undefined;
        getUnits(): Units;
        getWorldExtent(): Extent;
        isGlobal(): boolean;
        setDefaultTileGrid(tileGrid: TileGrid): void;
        setExtent(extent: Extent): void;
        setGetPointResolution(
            func: (arg0: number, arg1: Coordinate) => number,
        ): void;
        setGlobal(global: boolean): void;
        setWorldExtent(worldExtent: Extent): void;
    }
    Index
    • Returns boolean

      The projection is suitable for wrapping the x-axis

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

      Axis orientation.

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

      Returns string

      Code.

    • Returns TileGrid

      The default tile grid.

    • Get the validity extent for this projection.

      Returns Extent

      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 is undefined.

      Returns number | undefined

      Meters.

    • Get the custom point resolution function for this projection (if set).

      Returns GetPointResolution | undefined

      The custom point resolution function (if set).

    • Get the units of this projection.

      Returns Units

      Units.

    • Get the world extent for this projection.

      Returns Extent

      Extent.

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

      Returns boolean

      Whether the projection is global.

    • Parameters

      • tileGrid: TileGrid

        The default tile grid.

      Returns void

    • Set the validity extent for this projection.

      Parameters

      • extent: Extent

        Extent.

      Returns void

    • Set the getPointResolution function (see :ol/proj.getPointResolution for this projection.

      Parameters

      • func: (arg0: number, arg1: Coordinate) => number

        Function

      Returns void

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

      Parameters

      • global: boolean

        Whether the projection is global.

      Returns void

    • Set the world extent for this projection.

      Parameters

      • worldExtent: Extent

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

      Returns void