I need 3 layers: OSM, Google and Yandex. My view, OSM and Google layer in EPSG:3857 projection, but Yandex layer seems to be in EPSG:3395, so it was displayed not correctly. I've defined the new projection via proj4js and the layer has moved significantly, but it still doesn't match the other layers.
My code is:
proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
map = new ol.Map({
target: 'olmap',
layers: [
new ol.layer.Tile({
title: 'Yandex',
source: new ol.source.XYZ({
url: '...',
projection: 'EPSG:3395'
})
}),
new ol.layer.Tile({
title: 'Google',
source: new ol.source.XYZ({
url: '...'
})
}),
new ol.layer.Tile({
title: 'OSM',
source: new ol.source.XYZ({
url: '...'
})
})
],
view: new ol.View({
projection: 'EPSG:3857',
extent: ol.proj.transformExtent([-180, -80, 180, 80], 'EPSG:4326', 'EPSG:3857')
})
});
The definition of EPSG:3395 I took from here: https://epsg.io/3395 .
OSM layer:
Yandex.Maps layer:
Where is my mistake?