You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unbounded horizontal scroll does not play well with longitude constraints near 180 or -180 #2072
Let's say someone wants to have a map constrained to Te Waipounamu, the south island of New Zealand, because why not. Good camera constraints coordinates would be between -38.82;164.37 and -49.49;177.86.
However because the bottom right corner is so close to longitude 180 and because of the way unbounded horizontal scroll is implemented, if you pan with enough speed towards the east, it will reach the constraints and jump you back to the west instead of stopping at the constraint.
I discovered it while trying to understand what causes #2071 precisely
How can we reproduce it?
Create a FlutterMap with the following property set in MapOptions : cameraConstraint: CameraConstraint.contain(bounds: LatLngBounds(const LatLng(-38.82, 164.37), const LatLng(-49.49, 177.86)))
Do you have a potential solution?
No idea yet, don't know how unbounded constraints work
I'm aware that this could be an issue. Can you also just share your initial camera config? For me, the entire map just turns black if the initial camera is outside of the constraints.
Can you also just share your initial camera config? For me, the entire map just turns black if the initial camera is outside of the constraints.
Hi, sorry for the insufficiently detailed snippet, by running the example app on the home route and with the following FlutterMap I manage to reproduce on ios and chrome (got to fling it hard though, harder than on mobile) :
@monsieurtanuki Yeah, we need to add world numbers to LatLngBounds, as well as thinking about it for paths, as discussed in #2206 (comment). Not sure if you've seen #2205 - it's sort of related (allows across the antimeridian, but doesn't use world numbers)?
Although I don't think that is related to this issue, or directly related to #2022? Unless you're thinking of something I'm not.
Activity
JaffaKetchup commentedon Apr 8, 2025
Hi @mbenoukaiss, thanks for all the research!
I'm aware that this could be an issue. Can you also just share your initial camera config? For me, the entire map just turns black if the initial camera is outside of the constraints.
mbenoukaiss commentedon Apr 9, 2025
Hi, sorry for the insufficiently detailed snippet, by running the example app on the home route and with the following
FlutterMapI manage to reproduce on ios and chrome (got to fling it hard though, harder than on mobile) :JaffaKetchup commentedon Jul 1, 2026
This feels similar to #2022.
monsieurtanuki commentedon Jul 2, 2026
@JaffaKetchup Would that mean that we should definitely support that "world number" feature?
JaffaKetchup commentedon Jul 2, 2026
@monsieurtanuki Yeah, we need to add world numbers to
LatLngBounds, as well as thinking about it for paths, as discussed in #2206 (comment). Not sure if you've seen #2205 - it's sort of related (allows across the antimeridian, but doesn't use world numbers)?Although I don't think that is related to this issue, or directly related to #2022? Unless you're thinking of something I'm not.