Merge pull request #4868 from sebasbaumh/refreshSource
Allow to refresh a source and reload its data.
This commit is contained in:
@@ -150,6 +150,15 @@ ol.source.Source.prototype.getWrapX = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Refreshes the source and finally dispatches a 'change' event.
|
||||
* @api
|
||||
*/
|
||||
ol.source.Source.prototype.refresh = function() {
|
||||
this.changed();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set the attributions of the source.
|
||||
* @param {Array.<ol.Attribution>} attributions Attributions.
|
||||
|
||||
@@ -290,6 +290,15 @@ ol.source.Tile.prototype.getTileCoordForTileUrlFunction = function(tileCoord, op
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.Tile.prototype.refresh = function() {
|
||||
this.tileCache.clear();
|
||||
this.changed();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Marks a tile coord as being used, without triggering a load.
|
||||
* @param {number} z Tile coordinate z.
|
||||
|
||||
Reference in New Issue
Block a user