Skip to content

Back function does not reflect the movement path that was performed #542

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

Closed
ben-lu-uw opened this issue Oct 26, 2021 · 5 comments · Fixed by #543
Closed

Back function does not reflect the movement path that was performed #542

ben-lu-uw opened this issue Oct 26, 2021 · 5 comments · Fixed by #543
Labels

Comments

@ben-lu-uw
Copy link
Contributor

When using the up arrow key to pan northwards and then pressing the back button in the context menu, the map pans in a diagonal direction which does not reflect the purely vertical motion that was performed.
To reproduce, use mapml-viewer.html, press the up arrow key 3 times then use the context menu to go back.

2021-10-26.15-13-37.mov
@ahmadayubi
Copy link
Member

ahmadayubi commented Oct 26, 2021

This is related to projection, as you can see the values do line up in terms of lat lng:

vals

It would be ideal to do this map "history" navigation in terms of pcrs which isn't fully possible, But it could be done by using leaflet's panBy which lets you move the map in terms of pixel offsets rather than lat lng. Pixel offsets are still not pcrs but probably better than lat lng (for working with any projection, and avoiding this bug).

The bug itself, is more specifically related to the projection and how leaflet reports it's position, when the map is moved up, leaflet moves it in terms of pixels then reports the latlng position in the event it emits, This latlng position reflects the distortion of the projection (lambert conformal conic, being a cone, as you move up your moving closer to the cone center which is highly distorted, shown below) but not the actual screen movement being purely vertical. Hopefully that made sense.

cone

@prushforth
Copy link
Member

prushforth commented Oct 26, 2021

Maybe we should re-cast the location history in terms of zoom,x,y in tcrs coordinates? Is that possible, even?

@ahmadayubi
Copy link
Member

Maybe we should re-cast the location history in terms of zoom,x,y in tcrs coordinates? Is that possible, even?

Possibly, it would have to rely on offsets though, which could be calculated by subtracting from the previous index in tcrs history I think, I'd need to experiment with it.

@prushforth
Copy link
Member

Possibly, it would have to rely on offsets though, which could be calculated by subtracting from the previous index in tcrs history I think, I'd need to experiment with it.

yeah, not too big a deal for now. Not sure offsets would work - what about when you change zoom?

@ahmadayubi
Copy link
Member

yeah, not too big a deal for now. Not sure offsets would work - what about when you change zoom?

It would all have to be accounted for, I made some progress, but this doesn't consider zoom yet:

2021-10-26.17-10-55.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants