Functions
-
import {epsgLookupMapTiler} from 'ol/proj/proj4';Generate an EPSG lookup function which uses the MapTiler Coordinates API to find projection definitions which do not require proj4 to be configured to handle
+nadgridsparameters. CallsetEPSGLookupuse the function for lookupssetEPSGLookup(epsgLookupMapTiler('{YOUR_MAPTILER_API_KEY_HERE}')).Name Type Description keystring MapTiler API key. Get your own API key at https://www.maptiler.com/cloud/.
- Deprecated
- Not needed any more, the default lookup provides this functionality now.
Returns:
The EPSG lookup function.
-
import {fromEPSGCode} from 'ol/proj/proj4';Get a projection from an EPSG code. This function fetches the projection definition from the spatialreference.org website, registers this definition for use with proj4, and returns a configured projection. You must call import proj4 and call
registerbefore using this function.If the projection definition is already registered with proj4, it will not be fetched again (so it is ok to call this function multiple times with the same code).
Name Type Description codenumber | string The EPSG code (e.g. 4326 or 'EPSG:4326').
- Deprecated
- Use
fromProjectionCodeinstead.
- Use
Returns:
The projection.
-
import {fromProjectionCode} from 'ol/proj/proj4';Get a projection from a projection code (i.e., authority:number). This function fetches the projection definition from the https://spatialreference.org website, registers this definition for use with proj4, and returns a configured projection. You must call import proj4 and call
registerbefore using this function.If the projection definition is already registered with proj4, it will not be fetched again (so it is ok to call this function multiple times with the same code).
Name Type Description codestring The projection code (e.g., 'EPSG:4326' or 'OGC:CRS84').
Returns:
The projection.
-
import {register} from 'ol/proj/proj4';Make projections defined in proj4 (with
proj4.defs()) available in OpenLayers. Requires proj4 >= 2.8.0.This function should be called whenever changes are made to the proj4 registry, e.g. after calling
proj4.defs(). Existing transforms will not be modified by this function.Name Type Description proj4module:proj4 Proj4.
-
import {setEPSGLookup} from 'ol/proj/proj4';Set the lookup function for getting proj4 or WKT definitions given an EPSG code. By default, the
fromEPSGCodefunction uses the spatialreference.org website for WKT definitions. This can be changed by providing a different lookup function.Name Type Description funcfunction The lookup function.
- Deprecated
- Use
setProjectionCodeLookupinstead.
- Use
-
import {setProjectionCodeLookup} from 'ol/proj/proj4';Set the lookup function for getting proj4 or WKT definitions given an projection code. By default, the
fromProjectionCodefunction uses the spatialreference.org website for WKT definitions. This can be changed by providing a different lookup function.Name Type Description funcfunction The lookup function.