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

Do not render vector tiles unless they are being used #12778

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

ahocevar
Copy link
Member

@ahocevar ahocevar commented Sep 18, 2021

This pull request removes code that causes quite a bit of overhead in the vector tile renderer: rendering a tile immediately after loading bypasses our logic that makes sure we only render tiles that are actually being used (frameState.usedTiles). That code originally was meant for better making use of a render frame, but in practice, it causes more work because it renders tiles during/after zoom animations that are not needed for rendering the target resolution.

This pull request is best reviewed without looking at whitespace changes.

@ahocevar ahocevar marked this pull request as draft September 18, 2021 08:57
@ahocevar ahocevar marked this pull request as ready for review September 18, 2021 09:03
const hifi = !(
viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING]
);
if (hifi || !tile.wantedResolution) {
tile.wantedResolution = resolution;
Copy link
Member

Choose a reason for hiding this comment

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

Do we not need to know tile.wantedResolution any more?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do need to know it, and we still set it in getTile().

@ahocevar ahocevar merged commit b7e3695 into openlayers:main Sep 18, 2021
@ahocevar ahocevar deleted the vectortile-remove-extra-work branch September 18, 2021 20:46
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.

2 participants