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

cant get setMaxOverzoomLevel to work #503

Open
farfromrefug opened this issue Jun 13, 2022 · 7 comments
Open

cant get setMaxOverzoomLevel to work #503

farfromrefug opened this issue Jun 13, 2022 · 7 comments

Comments

@farfromrefug
Copy link
Contributor

I cant get this to work. I have a layer which datasource stops at zoom 7. Even if i set setMaxOverzoomLevel(1) (or even 0). Then at zoom (let s say) 14 it will always find the parent tile from 7.
I would expect to render empty tile at zoom 14

@mtehver
Copy link
Contributor

mtehver commented Jun 15, 2022

@farfromrefug 'Overzoom' only applies to tiles already loaded and cached. Thus is if overzoom=1 and current zoom=6 and the relevant tile is not available, SDK checks if it has zoom=5 tile cached. If it has, then this tile is displayed instead while the zoom=6 tile is being fetched.

@farfromrefug
Copy link
Contributor Author

@mtehver ok i see so there is no way to say like stop rendering the data source if the we are 6 level over zoom ? The use case is hillshade where the rendering of high overzoom can be very ugly. Would be good to be able to say stop at overzoom 3. This is what i thought setMaxOverzoomLevel was for

@mtehver
Copy link
Contributor

mtehver commented Jun 15, 2022

@farfromrefug Documentation is somewhat ambiguous here, so I can see how it caused the confusion. As the use case is quite specific, the option is to create a custom data source that returns empty tiles starting from some threshold zoom level.

@farfromrefug
Copy link
Contributor Author

@mtehver great idea! i am on it!

@farfromrefug
Copy link
Contributor Author

farfromrefug commented Jun 22, 2022

@mtehver i might need a bit of help from you on this. I started to implement this by returning std::make_shared<TileData>(std::shared_ptr<BinaryData>()); for empty tiles. Then in RasterLayer it falls into that if
My issue is that going there seems to still draw what's in the cache. How can i prevent that?
I have a feeling it is because the parent tile is found in the preloadingCache. Can i invalidate the tile from preloadingCache when i fail into my overzoomLevel ?
EDIT: maybe the solution is to return a "transparent" tile? but i am not sure how to make it work with vector and raster tiles

@mtehver
Copy link
Contributor

mtehver commented Jun 27, 2022

@farfromrefug Good find regarding caching and null tileData.data, I think the correct behavior would be to removing respective tile from the cache. As a workaround, creating a transparent tile should work fine.

@farfromrefug
Copy link
Contributor Author

@mtehver ok i ll try removing from the cache

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

No branches or pull requests

2 participants