ol-mapbox-style
ol-mapbox-style copied to clipboard
difference projection,difference render
when is use projection 3857,style render correct but i use projection 4326,style render is difference
map project is 3857,style render correct
4326 style, the line style is uncorrect,and the vector data position is wrong
If you use a projection other than EPSG:3857, you have to pass a resolutions
property to applyStyle()
's options, e.g.
const maxResolution = 360 / 512; // for EPSG:4326 (degrees)
const resolutions = [];
for (let i = 0; i < 23; ++i) {
resolutions.push(maxResolution / Math.pow(2, i));
}
applyStyle(myLayer, myStyle, 'mySource', { resolutions });
the style is render correct,but i add a vector data to map, the vector position show is wrong
this is my code
Then the tilegrid does not match the tile layout of the service you are using. Consult the service provider for the correct tile layout, and define your TileGrid
accordingly.