Example of a Sphere Mollweide map with a Graticule layer. This demo is the same as the OpenLayers one but here, it uses the proj4rs library instead of the proj4js one.
proj4 OpenLayers
import GeoJSON from 'ol/format/GeoJSON.js'; import Graticule from 'ol/layer/Graticule.js'; import Map from 'ol/Map.js'; import Projection from 'ol/proj/Projection.js'; import VectorLayer from 'ol/layer/Vector.js'; import VectorSource from 'ol/source/Vector.js'; import View from 'ol/View.js'; import proj4 from 'proj4'; import {register} from 'ol/proj/proj4.js'; ...
proj4rs
import GeoJSON from 'ol/format/GeoJSON.js'; import Graticule from 'ol/layer/Graticule.js'; import Map from 'ol/Map.js'; import Projection from 'ol/proj/Projection.js'; import VectorLayer from 'ol/layer/Vector.js'; import VectorSource from 'ol/source/Vector.js'; import View from 'ol/View.js'; import {proj4} from 'proj4rs/proj4.js'; import {register} from 'ol/proj/proj4.js'; ...