Skip to content
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

improve lod tile loading for projections #11225

Merged
merged 2 commits into from Nov 5, 2021
Merged

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Nov 4, 2021

The previous approach was mistakenly dependent on the center of the viewport. The intent was to use this as a reference size for what a tile should be. But at lower zoom levels, if you pan away from the center of the projection the tiles at the center of the screen may not be the the ideal size.

The new approach:

  • calculates the size of a mercator square in the projected coordinates
  • divides this by the size of the square in mercator
  • scales it up by the scaleAdjustment used by the projection matrix

Before

Screen Shot 2021-11-04 at 4 17 01 PM

After

Screen Shot 2021-11-04 at 4 15 55 PM

Before

Screen Shot 2021-11-04 at 4 15 14 PM

After

Screen Shot 2021-11-04 at 4 15 06 PM

Launch Checklist

  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'

The previous approach was mistakenly dependent on the center of the
viewport. The intent was to use this as a reference size for what a tile
should be. But at lower zoom levels, if you pan away from the center of
the projection the tiles at the center of the screen may not be the the
ideal size.
@ansis ansis added the skip changelog Used for PRs that do not need a changelog entry label Nov 4, 2021
@ansis ansis requested a review from mourner November 4, 2021 20:25
Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

Excellent!

@ansis ansis merged commit 892d34e into main Nov 5, 2021
@ansis ansis deleted the projections-lod-improvement branch November 5, 2021 01:50
ansis added a commit that referenced this pull request Nov 5, 2021
The previous approach was mistakenly dependent on the center of the
viewport. The intent was to use this as a reference size for what a tile
should be. But at lower zoom levels, if you pan away from the center of
the projection the tiles at the center of the screen may not be the the
ideal size.
SnailBones pushed a commit that referenced this pull request Nov 5, 2021
The previous approach was mistakenly dependent on the center of the
viewport. The intent was to use this as a reference size for what a tile
should be. But at lower zoom levels, if you pan away from the center of
the projection the tiles at the center of the screen may not be the the
ideal size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog Used for PRs that do not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants