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

map.fitBounds with padding affects the map.getBounds #13409

Open
benderlidze opened this issue Feb 18, 2025 · 0 comments
Open

map.fitBounds with padding affects the map.getBounds #13409

benderlidze opened this issue Feb 18, 2025 · 0 comments

Comments

@benderlidze
Copy link

map.fitBounds(bounds, { padding: 150 }) in v3.10 somehow sets the global bounds.
If you call map.getBounds(), it returns the bounds including the 150 px padding, which is incorrect.

In v2, map.getBounds() returns the correct bounds covering 100% of the height and width without any padding.

map.fitBounds(bounds, { padding: 150 });
const s = map.getBounds();
console.log('s', s);

v2 Results: [7.1204, 52.6618, 13.8875, 59.2029]
v3 Results: [8.4594, 53.4663, 12.5486, 58.5104]

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

1 participant