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

Error with tileSize = 512 #3

Open
duongvgm opened this issue Oct 22, 2021 · 4 comments
Open

Error with tileSize = 512 #3

duongvgm opened this issue Oct 22, 2021 · 4 comments

Comments

@duongvgm
Copy link

Hi.
If I use tileSize=512 then need to fix getTileId function in MVTSource, change parameter zoom to zoom-1
getTileId(zoom, x, y) { return [zoom - 1, x, y].join(":"); }

@techjb
Copy link
Owner

techjb commented Oct 22, 2021

I have not tested it with tiles different to 256. Can you provide a public source to do some test at 512?

@duongvgm
Copy link
Author

Hi. Thanks for sharing the great source code.
I have Vector Tile service according to MVT specification, for MVT and tileSize=512 (default) the first zoom level is from zoom=0 which covers the whole world, corresponding to zoom=1 for tileSize =256.
So I just recalculated the zoom level to match the service path as I shared above.

@duongvgm
Copy link
Author

I'm just trying with localhost. This is the image I tried:
image

@Noruka
Copy link

Noruka commented Aug 5, 2022

Mercator library divides tiles in hardcoded 256
getTileAtLatLng: function (latLng, zoom) { var t = Math.pow(2, zoom), s = 256 / t, p = this.fromLatLngToPoint(latLng); return { x: Math.floor(p.x / s), y: Math.floor(p.y / s), z: zoom }; }

probably something to check.

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

3 participants