Projection support for ol-ishare and ol.
Methods
(inner) addProjection(code, definition) → {ol/proj/Projection~Projection}
import { addProjection } from 'ol-ishare/proj.js';
Adds a projection to ol-ishare and ol using proj4 if available.
proj4 can be registered via calling setProj4
or by exposing proj4 at
window.proj4
.
Parameters:
Name | Type | Description |
---|---|---|
code |
String | ID of the projection e.g. |
definition |
String | Projection definition in wkt or proj4 format e.g. |
Returns:
OpenLayers Projection instance
(inner) setProj4(proj4) → {Object|undefined}
import { setProj4 } from 'ol-ishare/proj.js';
Set the proj4 instance that ol-ishare and ol will use to define custom projections.
Use addProjection
to add a projection to ol-ishare and ol.
Parameters:
Name | Type | Description |
---|---|---|
proj4 |
Object | The proj4 instance |
Returns:
The proj4 instance or undefined
- Type
- Object | undefined
(inner) getProj4() → {Object|undefined}
import { getProj4 } from 'ol-ishare/proj.js';
Attempt to get a reference to the proj4 instance used by ol-ishare and ol to
define custom projections. If proj4 is not already registered, this function
will attempt to find a reference at window.proj4
.
Use addProjection
to add a projection to ol-ishare and ol.
Returns:
The proj4 instance or undefined
- Type
- Object | undefined