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

Keeping tiles after zooming out past minzoom #4800

Open
bstadlbauer opened this issue Oct 3, 2024 · 4 comments
Open

Keeping tiles after zooming out past minzoom #4800

bstadlbauer opened this issue Oct 3, 2024 · 4 comments
Labels
enhancement New feature or request PR is more than welcomed Extra attention is needed

Comments

@bstadlbauer
Copy link

User Story

As a user I can zoom out on a Raster Layer past minzoom and the tiles of the last available zoom (minzoom) are still present

Rationale

Hi everyone!

I'm currently working with a tile server which can only render up to a certain minzoom. I've set the minzoom in the <Source> accordingly. Now, similar to "overzooming", where tiles will stay past the maxzoom, it would be nice if they don't vanish when zooming out past minzoom.

I've looked around the API docs as well as other github issues, but couldn't figure out a way to achieve this, but I might have missed something.

Thank you for all the great work on the project!

@bstadlbauer
Copy link
Author

In case there is a hacky way to do this I'd already be happy a well!

@HarelM
Copy link
Collaborator

HarelM commented Oct 3, 2024

You could probably hack it using addProtocol and returning an image made of higher zoom level tiles.
But this might prove problematic (using both addProtocol or in general to implement this) when the minzoom and current zoom are a few levels of zoom apart...

@HarelM HarelM added enhancement New feature or request PR is more than welcomed Extra attention is needed labels Oct 3, 2024
@ibesora
Copy link
Collaborator

ibesora commented Oct 4, 2024

In case there is a hacky way to do this I'd already be happy as well!

How much "hacky" are you comfortable with?
You can manually forge N tile requests, where N depends on the difference between your zoom level and the dataset zoom level, and inject the data in the SourceCache. After that, everything should work as expected

@bstadlbauer
Copy link
Author

Thank you for the quick responses!
My initial thinking went along the lines of re-using the tiles that have already been fetched for higher zooms, but I've got control over the cache headers, so that shouldn't be an issue either way.

I'll look into the options of injecting them into the SourceCache thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants