Merge pull request #9250 from ahocevar/clear-refresh
Clearer behaviour of clear() and refresh() on sources
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user