Skip to content

feat: allow antimeridian span for LatLngBounds and CameraFit#2205

Open
JetA2 wants to merge 2 commits into
fleaflet:masterfrom
JetA2:camerafit-antimeridian
Open

feat: allow antimeridian span for LatLngBounds and CameraFit#2205
JetA2 wants to merge 2 commits into
fleaflet:masterfrom
JetA2:camerafit-antimeridian

Conversation

@JetA2
Copy link
Copy Markdown

@JetA2 JetA2 commented Apr 26, 2026

This addition allows a CameraFit spanning the antimeridian to be created using CameraFit.boundsor CameraFit.insideBounds. It was also necessary to add a new constructor LatLngBounds.unconstrainedLng to be able to create bounds that span the antimeridian.

Example: showing the airports at Magadan and Anchorage on a map.

Before (using CameraFit.bounds with LatLngBounds.worldSafe):
Simulator Screenshot - iPad mini (A17 Pro) - 2026-04-26 at 18 11 39

After (using CameraFit.bounds with LatLngBounds.unconstrainedLng):
Simulator Screenshot - iPad mini (A17 Pro) - 2026-04-26 at 18 13 59

@JaffaKetchup
Copy link
Copy Markdown
Member

Hey, thanks for this. We're actually looking into better anti-meridian and direction wrapping control of latlngs at the moment, so I'm not going to merge this just yet in case we change things with LatLngBounds. But at the moment, this is great!

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

Successfully merging this pull request may close these issues.

2 participants