With OL5 I'm trying to use a map with Gall-Peters projection with this definition:
var projname = 'EPSG:22';
var projdef = '+proj=cea +lon_0=0 +lat_ts=45 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs';
var petersProjection = new Projection({
code: projname,
units: 'm',
extent: [-14192432.0000000000000000,-8984819.0000000000000000, 14192432.0000000000000000,8928365.0000000000000000]
});
proj4.defs(projname, projdef);
register(proj4);
GeoServer is used to serve the map as WMS and WMTS also in Gall-Peters projection.
In OL client the map is not wrapped across the 180° meridian. It only shows "one world". When I switch the projection to EPSG:4326 or EPSG:3857 I get a continous wrapped map.
I'm stuck here. Is something wrong with my projection definition? Is OL only able to wrap with standard projections? How can I get a wrapped map in Gall-Peters projection?
For reference here are my definitions of layer, view and map:
var basiskarte_source = new TileWMS({
url: geoserver_url,
serverType: 'geoserver',
params: {'FORMAT': 'image/png',
'VERSION': '1.1.1',
TILED: true,
LAYERS: 'eg:basiskarte',
tilesOrigin: -180 + "," + -90,
srs: 'EPSG:22'
},
projection : petersProjection
});
var wms_geoserver_tiled_layer =
new TileLayer({
title : 'gall-peters-map',
type : 'base',
visible : true,
source: basiskarte_source
});
var myview = new View({
center: fromLonLat([36.8394, -1.2743], petersProjection),
projection: projectionInUse,
zoom: 1,
rotation: deg2rad(180)
});
var map = new Map({
target: 'map',
layers: [
new LayerGroup({
title : 'Basiskarte',
layers: [wms_geoserver_tiled_layer]
})
],
view: myview
});