Skip to content

Keep track of map history in terms of pixels rather than latitude, longitude #543

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

Merged
merged 7 commits into from
Nov 1, 2021

Conversation

ahmadayubi
Copy link
Member

@ahmadayubi ahmadayubi commented Oct 26, 2021

Rather than keeping track of navigation history in terms of latitude and longitude, this uses tcrs and calculates offsets to navigate history. This also accounts for zoom.

  • fix issue inaccurate offset on zoom
  • add comments
  • add additional tests

Closes #542

@ahmadayubi ahmadayubi marked this pull request as ready for review October 27, 2021 00:41
@prushforth
Copy link
Member

I see that the reload feature has a test, perhaps @ben-lu-uw would be willing to add a test or two for history within / across zoom levels? Is there anything else we could test that would be in doubt, ever?

@ahmadayubi
Copy link
Member Author

Nothing else comes to mind at the moment but it would be great to have tests that explore history when it's outside the scope of a projection, to avoid reverting back to the initial issue in the future.

Copy link
Contributor

@ben-lu-uw ben-lu-uw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I pan up, zoom in and then zoom back out I don't end up at the exact same location. Is this level of distortion expected?

image

@ahmadayubi
Copy link
Member Author

ahmadayubi commented Oct 28, 2021

No there shouldn't be any accepted level of distortion, I'll have a look at it.

Update: This is more an issue with leaflet + projections, and not related to the history changes.

Copy link
Member

@prushforth prushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good to me, nice idea to test across zoom levels, naturally would work within single zoom level.

@ahmadayubi
Copy link
Member Author

Tests look good to me, nice idea to test across zoom levels, naturally would work within single zoom level.

There are also tests inside the mapContextMenu.test.js file, in hind sight I should have suggested @ben-lu-uw add these tests to that file but it's not a major issue.

@prushforth prushforth merged commit 56f6fcf into Maps4HTML:main Nov 1, 2021
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.

Back function does not reflect the movement path that was performed
3 participants