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

refactor!: make LatLngBounds mutable & depend less on 'latlong2' #1834

Merged
merged 10 commits into from
Mar 12, 2024

Conversation

josxha
Copy link
Contributor

@josxha josxha commented Feb 20, 2024

This pr is probably a bit controversial.

  • It refactors LatLngBounds to store max and min latitude and longitude instead of the LatLngs of the corners
  • It cleans up the methods to make them produce less ephemeral objects
  • It renames the previous default contructor to LatLngBounds.fromCorners() and adds a new default raw constructor for better performance. Even though values get provided directly it uses asserts to catch potential implementation errors.

Very similar would be Bounds if I'm not mistaken.

@josxha josxha added this to the v7.0 milestone Feb 20, 2024
@josxha josxha self-assigned this Feb 21, 2024
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, except for the one thing around constructor naming.

lib/src/geo/latlng_bounds.dart Outdated Show resolved Hide resolved
@josxha
Copy link
Contributor Author

josxha commented Mar 12, 2024

Ready for another review. I think this pull request is now non-breaking.

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! Still breaking, but only for implementers of LatLngBounds, which should be no-one.

@JaffaKetchup JaffaKetchup changed the title refactor!: LatLngBounds refactor!: make LatLngBounds mutable & depend less on 'latlong2' Mar 12, 2024
@josxha josxha merged commit 0fef8d6 into fleaflet:master Mar 12, 2024
7 checks passed
@josxha josxha deleted the refactor-bounds branch March 12, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants