Replace RasterOverlayTileProvider cache with SharedAssetDepot #987
+448
−340
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is currently a cache in the
QuadtreeRasterOverlayTileProvider
to hopefully prevent the same images from being downloaded multiple times when they're used by multiple different geometry tiles. There is currently a bug that will result in the overlay provider believing that the cache is full when it's not, making the cache eventually all but useless. As mentioned in #958, the issue for this bug, now that we have theSharedAsset
system, it makes sense to just get rid of that old cache code and use aSharedAssetDepot
instead. That's what this PR is for.While this PR currently implements the cache on the RasterOverlayTileProvider base class itself, it will only actually be used when the
loadTileImageFromUrl
method is called, and onlyQuadtreeRasterOverlayTileProvider
-derived classes seem to call this method.While this PR is in good working order, at least from my testing, it feels like it loads raster overlays slower than it did previously. This isn't a particularly surprising issue to occur after these changes, but it does need to be fixed. I'll try to get to the bottom of this on Monday.