TileLayer and preventing unnecessary requests #9605
Unanswered
ShootingStar91
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, TileLayer is working well for me apart from one issue.
When I zoom from say 5 to 11, the layer keeps requesting new data for every zoom level. Often that is unnecessary, as the data is the same at level 11 that has already been fetched at 5. The query is heavy enough that I can't have it run on every single zoom-level change.
This was asked some years ago here:
#4707
The two suggested solutions don't work for me. Separate layers for zoom level and hiding them with "visible" is not good, as once I zoom past the first layer, the first one disappears and the second begins loading new data even though the first layer was ok.
The other suggestion is to optionally return null in the getTileData method. I'm not sure how it's supposed to work, wouldn't the method returning null simply mean the previous data is replaced with no data?
What I'd like is that I'd still have the tile system and fetching data at different zoom levels, but the cache would recognize that zoom level does not matter for the data. So, if client has loaded data at z=5, and user zooms in, the client does not request new data. Or if user has already scrolled the map around at z=15, so that ALL children tiles of x, y, 5 have been loaded, when the user zooms to z=5, it does not have to be loaded again.
Could it be possible to achieve this by writing my own Tileset2D class? https://deck.gl/docs/api-reference/geo-layers/tile-layer#tileset2d Or is there a better option?
Beta Was this translation helpful? Give feedback.
All reactions