-
-
Notifications
You must be signed in to change notification settings - Fork 893
Initial working fix - Resolves date line related issues. #2048
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
Initial working fix - Resolves date line related issues. #2048
Conversation
…d dateline and rotation with infinite scrolling longitudinal map. May still need clean up / optimization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @zach-snell, thanks for opening a PR!
I would be grateful if you could give a little more info as to what this PR fixes.
As I'm testing it, I'm comparing it to the master branch, and I can't see any difference in behaviour. Could you record some videos to show what failed before, and the fixed behaviour with your PR? I'm just struggling to understand why these changes are necessary, particularly with the oscillation fixes, as I've not experienced any oscillations.
As far as I understand, #2019 is completely unrelated to unbounded horizontal scrolling, and instead about issues with the TileLayer not being able to be changed properly. Could you explain how your PR fixes and relates to #2019?
| if (i == 0) { | ||
| result = addedWidth; | ||
| bestX = x; | ||
| bestError = error; | ||
| continue; | ||
| } | ||
| if ((bestX + ox - halfScreenWidth).abs() > | ||
| (x + ox - halfScreenWidth).abs()) { | ||
|
|
||
| // Only switch worlds if there's a significant improvement | ||
| // This prevents oscillation near the boundary | ||
| if (error < bestError - hysteresisThreshold) { | ||
| result = addedWidth; | ||
| bestX = x; | ||
| bestError = error; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be collapsed into a single decision?
I'm also not aware of any situation where oscillation at the boundary is an issue? Did you reproduce this? As far as I understand, this is very different to #2019, but I'm probably missing something.
// Only switch worlds if there's a significant improvement
// This prevents oscillation near the boundary
if (i == 0 || error < bestError - hysteresisThreshold) {
result = addedWidth;
bestError = error;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to give this a test - I had also noticed that the second assignment of bestX / bestError seemed unused. I knew I would need to review that anyways.
Further, I remember this was related but I was iterating so many times I will confirm if reverting has impact and if so if we can simplify the logic.
|
You know, I think you're right. I was half asleep I guess and didn't relate the valid issue. I will record a video showing the issue I was resolving later this morning. -- The issue was with the way the camera / tiles would flicker or jump from east to west as you move back and forth near the date line. |
6b32005 to
12ea190
Compare
…ific issue remains.
|
Alright! Very much simplified -- turns out there was a chain of self-created issues in there. This should be much easier to review! |
|
Sorry, been focused on some other PRs. I'm still not sure what this PR is fixing. As far I can see, I can move across the dateline completely fine in the example app on that page. |
|
Honestly it fixes what seems to be a very small thing that had downstream
impacts.
It has to do with angles when crossing the dateline causing some of the
system to mis-represent the current position.
It has been a bit since I messed with it now but that is the jist.
The example video you can look for when the dot that stays in one spot on
the viewport starts moving in unexpected ways.
…On Thu, Mar 20, 2025, 1:02 PM Luka S ***@***.***> wrote:
Sorry, been focused on some other PRs. I'm still not sure what this PR is
fixing. As far I can see, I can move across the dateline completely fine in
the example app on that page.
—
Reply to this email directly, view it on GitHub
<#2048 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRD2YJUAQQX4CIFQOP5MGT2VL7EZAVCNFSM6AAAAABYIXE7QOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBRGI3TAMBUGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: JaffaKetchup]*JaffaKetchup* left a comment
(fleaflet/flutter_map#2048)
<#2048 (comment)>
Sorry, been focused on some other PRs. I'm still not sure what this PR is
fixing. As far I can see, I can move across the dateline completely fine in
the example app on that page.
—
Reply to this email directly, view it on GitHub
<#2048 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRD2YJUAQQX4CIFQOP5MGT2VL7EZAVCNFSM6AAAAABYIXE7QOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBRGI3TAMBUGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I can't reproduce anything like is shown in the video at all. Are you using a mouse on a real device? |
|
For the time being, I'm going to close this, because I'm still unsure if there's an issue. Whilst I can see something strange in the screen recording, I can't reproduce this. If you're still having the issue, please file a bug report! Thanks for the contributions anyway :) |





Resolves issues around date line and rotation with infinite scrolling longitudinal map. May still need clean up / optimization.