Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difference projection,difference render #644

Open
mclkyo opened this issue Aug 8, 2022 · 3 comments
Open

difference projection,difference render #644

mclkyo opened this issue Aug 8, 2022 · 3 comments

Comments

@mclkyo
Copy link

mclkyo commented Aug 8, 2022

when is use projection 3857,style render correct
but i use projection 4326,style render is difference

map project is 3857,style render correct
image

4326 style, the line style is uncorrect,and the vector data position is wrong
image

@ahocevar
Copy link
Member

ahocevar commented Aug 8, 2022

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 });

@mclkyo
Copy link
Author

mclkyo commented Aug 9, 2022

image
the style is render correct,but i add a vector data to map, the vector position show is wrong

image
this is my code

@ahocevar
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants