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

unnecessary spinner display on re-zoom with cached tiles #780

Open
alexeykurbako opened this issue Mar 7, 2024 · 8 comments
Open

unnecessary spinner display on re-zoom with cached tiles #780

alexeykurbako opened this issue Mar 7, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@alexeykurbako
Copy link

Describe the bug
Hey everyone. We faced this issue a year ago after adding Spinner that indicates slide tile loading during requests to the api and everything works fine except one moment: when user tries to zoom in and zoom out to the same place Spinner appears for half a second and disappears(there are no requests to the backend during this loading) but it looks pretty bad and we are looking for a way of solving this issue. We guess that VIV uses kind of cache under the hood where it stores loaded tiles and clear as soon as it overflows. Function that check if all layers are loaded(if true we show spinner):
deckRef?.current?.deck.props.layers .flatMap((lay) => lay) .every(({ isLoaded }) => isLoaded);
Is it possible to prevent slide loading if user zoom in and out to the same place?
Is it possible to understand that viv sent request to the backend to get new tile so we were able to show spinner only during requests?

To Reproduce
zoom in and out in the same place

Expected behavior
No layers loading because they have been already loaded

Screenshots
Small video that demonstrates the issue:

Screen.Recording.2024-03-07.at.18.54.22.mov

Environment:
@hms-dbmi/viv: 0.13.8
@deck.gl/core: ~8.8.20

  • Browser:
    Google Chrome
  • Browser version:
    Version 122.0.6261.69 arm64
@alexeykurbako alexeykurbako added the bug Something isn't working label Mar 7, 2024
@manzt manzt changed the title tile unnecessary spinner display on re-zoom with cached tiles Mar 7, 2024
@manzt
Copy link
Member

manzt commented Mar 7, 2024

Thanks for the issue. The title was not very clear. I added one. does that capture the essence of this issue?

@ilan-gold
Copy link
Collaborator

There is definitely caching for geotiff and deck.gl. Are you using tiff or zarr?

@ilan-gold
Copy link
Collaborator

ilan-gold commented Mar 7, 2024

The reason I ask is that I am not sure how we could check whether or not a tile is in the geotiff cache. If deck.gl does not think the tile is loaded, but geotiff has cached it, I think there is likely no way for us to easily check if something is in the geotiff cache.

@alexeykurbako
Copy link
Author

There is definitely caching for geotiff and deck.gl. Are you using tiff or zarr?

We use tiff

@alexeykurbako
Copy link
Author

alexeykurbako commented Mar 11, 2024

The reason I ask is that I am not sure how we could check whether or not a tile is in the geotiff cache. If deck.gl does not think the tile is loaded, but geotiff has cached it, I think there is likely no way for us to easily check if something is in the geotiff cache.

Thanks for reply. Is it possible to expand cache size somehow?

@alexeykurbako
Copy link
Author

alexeykurbako commented Mar 11, 2024

Thanks for the issue. The title was not very clear. I added one. does that capture the essence of this issue?

Maybe "unnecessary layers loading on re-zoom with cached tiles" ?

@vadzimvashchanka
Copy link

Hey guys, can it be a solution? https://deck.gl/docs/api-reference/geo-layers/tile-layer. I mean configurable maxCacheSize. The issue persists also in their sandbox example - if to zoom the map in and out it is not saved in cache

@ilan-gold
Copy link
Collaborator

@vadzimvashchanka Yes, I think if you expanded the deck.gl cache size, that could help with the issue. You could also maybe debounce the spinner or something similar so that it only starts after 500ms (during which time the deck.gl cache hopefully catches up with geotiff cache).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants