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

Preload tiles #550

Merged
merged 1 commit into from
Oct 10, 2022
Merged

Preload tiles #550

merged 1 commit into from
Oct 10, 2022

Conversation

Dassderdie
Copy link
Collaborator

@Dassderdie Dassderdie commented Oct 10, 2022

Demonstration

The number of requests didn't seem to change by a lot. I didn't do a proper benchmark of it, though.

@Dassderdie
Copy link
Collaborator Author

I just chose a random reviewer - fell free to assign someone other if you're busy.

Copy link
Contributor

@benn02 benn02 left a comment

Choose a reason for hiding this comment

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

Why is it necessary to preload the tiles and doesnt it produce an unnecessary load to preload infinetly many?

@Dassderdie
Copy link
Collaborator Author

Why is it necessary to preload the tiles

Look at the demo https://openlayers.org/en/latest/examples/preload.html and try zooming in and out + pan to see the difference. Preloading makes this less intrusive as the new tiles are not white but a lower resolution tile from the appropiate area.
Because we cache the tiles (cacheSize: 1000 a few lines below), this is in our case only noticeable on the first zoom/pan.

and doesnt it produce an unnecessary load to preload infinetly many?

The argument is not how many tiles should be preloaded, but the maximum zoom for which they should be preloaded. We want to preload for every zoom level (-> zoom level Infinity like in the demo). In our case, the maximum zoom is 23 (same file, when the OlMap is initialized), so in this specific case we could use any number >= 23

@Dassderdie Dassderdie enabled auto-merge (squash) October 10, 2022 11:38
@Dassderdie Dassderdie merged commit 8bcc665 into dev Oct 10, 2022
@Dassderdie Dassderdie deleted the feature/preload-tiles branch December 16, 2022 14:52
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