Trying to add to my map an WMS layer with custom projection
When executing, the map does not show any layer.
Custom projection:
proj4.defs("EPSG:25830","+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");
register(proj4);
const customproj = getProjection('EPSG:25830');
WMS Layer:
var layer =
new TileLayer({
source: new TileWMS({
url: 'https://idena.navarra.es/ogc/wms',
params: {'LAYERS': 'catastro'},
projection: customproj
})
});
Map:
var map = new Map({
target: 'map',
layers: [layer],
view: new View({
projection: customproj,
center: fromLonLat([-1.629950,42.63]),
zoom: 9
})
});
What's wrong here?
center: fromLonLat([-1.629950,42.63], customproj),