Repository navigation
TileLayer retains cache on data change - #6194
Conversation
ilan-gold
left a comment
There was a problem hiding this comment.
Some comments.
| // Should we do the same as the above? Not delete but use a boolean to cause an update? | ||
| tileset.tiles.forEach(tile => { |
There was a problem hiding this comment.
@Pessimistress Not sure what the origin of this behavior was but seems similar to the above? We should just set them to have updateLayers be true
|
|
||
| _updateTileset() { | ||
| const {tileset} = this.state; | ||
| _updateTileset(tileset, reload = false) { |
There was a problem hiding this comment.
Open to just setting up a new method but it feels like it would need to look similar i.e change frame number, check loading, call onViewportLoad etc.
| loadOptions(opts) { | ||
| this._loadOptions(opts); | ||
| } |
There was a problem hiding this comment.
There's already a setOptions function - should these be merged?
| /* eslint-enable complexity */ | ||
|
|
||
| _getTile({x, y, z}, create) { | ||
| _getTile({x, y, z}, create, reload) { |
There was a problem hiding this comment.
Better way to do forced reloads?
|
Also, the |
|
This is what I was talking about with the scheduler - I just pushed a change with some debugging changes. I log out before and after the scheduler is called, and then look at the output: (Assuming the logging is right) The tokens come back after the tests. But this isn't the case on the current master branch so there must be something going on here that I'm missing: One thing I notice is that deck.gl/test/modules/geo-layers/tile-layer/tile-layer.spec.js Lines 94 to 97 in e98df82 |
60d11ac to
272293b
Compare
|
@ilan-gold I pushed a different approach:
Also made some internal API changes to |
272293b to
c5637d3
Compare
updateTriggers and TileLayer Fix| reloadAll() { | ||
| for (const tile of this._cache.values()) { | ||
| tile.setNeedsReload(); | ||
| } |
There was a problem hiding this comment.
Do you think it makes sense to have two different loops here, one for reloading _selectedTiles i.e those in the viewport, and then another for clearing the cache of those outside the viewport? For example if you zoom out after the load has occurred, you will get old tiles sometimes. I think it would be better to have just no tiles outside the viewport instead of old data. I think that was the idea originally with my (very bad) code: 8f4cdd2#diff-ebfc47135e3d8fe2bee8b3d33fae4ebbbc295d01887c751d4cb77f71fc85a87aR70-R77
There was a problem hiding this comment.
| reloadAll() { | |
| for (const tile of this._cache.values()) { | |
| tile.setNeedsReload(); | |
| } | |
| reloadAll() { | |
| for (const [tileId, tile] of this._cache) { | |
| if (!this._selectedTiles.includes(tile)) { | |
| this._cache.delete(tileId); | |
| } else { | |
| tile.setNeedsReload(); | |
| } | |
| } |
Something like this maybe?
There was a problem hiding this comment.
Yes the proposed behavior makes sense. Feel free to push a commit.
I'm always a little wary about deleting items in a traversal. for (const tileId of this._cache.keys()) maybe?


Fixes #6179
Change List
reloadmethod forTileset2Dto be called on updates byupdateTriggersinstead of creating a new tileset