Skip to content
New issue

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

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

Already on GitHub? # to your account

Updated fitBounds to handle rotation #1550

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

jjoelson
Copy link
Contributor

@jjoelson jjoelson commented Jun 9, 2023

Per the discussion in #1549, here's a separate PR to address #1342.

I've added tests for no padding, symmetric padding, and asymmetric padding for every 10 degree interval between -360 and 360. Here are visuals of the test cases:

No padding:

fitBounds.-.no.padding.mov

Symmetric padding:

fitBounds.-.symmetric.padding.mov

Asymmetric padding:

fitBounds.-.asymmetric.padding.mov

@JaffaKetchup JaffaKetchup linked an issue Jun 10, 2023 that may be closed by this pull request
5 tasks
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jjoelson, and thanks for the fix!

The fix looks good, but I'm not sure 72 tests are necessary :).
Could probably get away with doing it in iterations of 30 deg, or even 60 deg.

@rorystephenson rorystephenson mentioned this pull request Jun 12, 2023
5 tasks
@jjoelson jjoelson force-pushed the 1342-fix-fit-bounds branch from b0550a4 to dc94485 Compare June 12, 2023 16:11
@jjoelson
Copy link
Contributor Author

The fix looks good, but I'm not sure 72 tests are necessary :). Could probably get away with doing it in iterations of 30 deg, or even 60 deg.

I wrote a bit of code to generate the tests and it's possible I got a bit carried away using it. 😅

I just updated the PR to use 60 deg increments.

@jjoelson jjoelson requested a review from JaffaKetchup June 12, 2023 16:53
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the submission!

@JaffaKetchup JaffaKetchup merged commit 359feda into fleaflet:master Jun 12, 2023
@jjoelson jjoelson deleted the 1342-fix-fit-bounds branch June 12, 2023 17:40
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fitBounds does not work as expected when a Map is rotated
2 participants