I use vector tiles in crs ETRS89/UTM zone 32N (EPSG:25832) in OpenLayers and it works properly with default style.
But my problem is that if I apply a style.json from Maputnik in form of Mapbox Style by using th library olm-mapbox-style, it will be ignored. The same style.json works fine with "EPSG:3857".
I guess it is related to view because the olms uses map.getView().getZoom() function by updating the style.
How can I resolve this problem? Any idea? Many thanks.
...
import {apply, applyStyle} from 'ol-mapbox-style';
...
proj4.defs("EPSG:25832","+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");
register(proj4);
var projection = getProjection("EPSG:25832");
const map = new Map({
target: 'map',
layers:[
new TileLayer({
source: new OSM()
}),
vectorTile
],
view: new View({
center: transform([7.012, 51.4], "EPSG:4326", projection),
projection:projection,
zoom: 6
})
});
const jsonPath = require('./data/style.json');
apply(map, jsonPath);