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

When zooming, show previous over zoomed tile until tiles load #47

Open
darbio opened this issue May 25, 2023 · 3 comments
Open

When zooming, show previous over zoomed tile until tiles load #47

darbio opened this issue May 25, 2023 · 3 comments

Comments

@darbio
Copy link

darbio commented May 25, 2023

Hi @merlos. Thank you for the great library.

I have a couple of use cases where I want to show the previous overzoomed level while waiting for the next level to load.

First use case is to hide the loading of the tiles (prevent the gray boxes whilst the tile is loading).

Second use case is to show an overzoomed tile when a 404 is returned for that zoom level (due to the map server not having a full tile set at that zoom).

Any tips as to how this could be implemented in your code base?

I'd be happy to do the work if you can point me in the correct direction.

@3DTOPO
Copy link

3DTOPO commented Jun 21, 2024

+1

I've been thinking of the exact same thing!

@3DTOPO
Copy link

3DTOPO commented Jun 22, 2024

I gave it a shot, and I'm creating low res files and returning them if the image isn't immediately available and calling result(tempTileData, nil), but when the full res tile is ready, calling result with the full res image seems to be ignored.

@merlos
Copy link
Owner

merlos commented Jun 22, 2024

Hi @3DTOPO

Some time ago I thought about how this could be implemented, precisely to overcome the challenge that you're facing. At that time I did not know how to replace the temporary tile with the actual one, what I understood is that once you tell the tile layer this is the file it keeps it... so what I thought could be a possibility was to add a new tile layer underneath of the regular one that would hold the temporary zoomed tiles.

In addition there is one parameter that sets transparency of the regular tiles one that is set to non-transparent to prevent Apple Maps to be displayed. You have to change it to be able to see the zoomed tiles.

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

3 participants