Incorrect zoom for some bounds
Opened this issue · 3 comments
For some bounds it calculates incorrect zoom, for example here [-112.16601, 37.622623, -112.082016, 37.672085]
it calculates zoom 13 and it doesn't include most of markers, correct zoom will be 12.
geoViewport.viewport([-112.16601, 37.622623, -112.082016, 37.672085], [672, 376])
If I convert back to bounds from center and zoom, it doesn't match initial bounds:
geoViewport.bounds([-112.12401330471039, 37.64735841514176], 13, [672, 376])
[-112.1817398071289, 37.621845878167704, -112.0663833618164, 37.67295135774715]
In this case [2.269904, 48.849976, 2.391055, 48.874565]
it calculates zoom 12 which is correct and includes all markers.
I am having the same issue. The amount its off by varies between cases so I can't even take a specific fraction of the zoom.
Does it make a difference when you specify the pixel size?
Leaflet and GL JS zooms are off by one because of the tileSize so wonder if that could be the reason here?
Yes, changing the tile size to 512 fixed the issue! Thank you!
I should have read the bottom part of the readme more closely. The blog link at the bottom is broken, I believe I found the correct post. Will open an MR with the new link.