Merge pull request #9250 from ahocevar/clear-refresh

Clearer behaviour of clear() and refresh() on sources
This commit is contained in:
Andreas Hocevar
2019-02-21 17:12:26 +01:00
committed by GitHub
7 changed files with 224 additions and 14 deletions

View File

@@ -300,12 +300,20 @@ class TileSource extends Source {
return withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;
}
/**
* Remove all cached tiles from the source. The next render cycle will fetch new tiles.
* @api
*/
clear() {
this.tileCache.clear();
}
/**
* @inheritDoc
*/
refresh() {
this.tileCache.clear();
this.changed();
this.clear();
super.refresh();
}
/**