Allow to refresh a source and reload its data.

Provide an API to refresh a source and reload its data in an associated
layer, as for example already loaded tiles in a ol.source.Tile source
are not refreshed. Additionally a test for the new
ol.source.Source.refresh() function is provided.

Currently internal state is not cleaned up, e.g. already loaded tiles
in a `ol.source.Tile` source are still cached and not reloaded at all.

github issue #4867 (https://github.com/openlayers/ol3/issues/4867)
This commit is contained in:
Sebastian Baumhekel
2016-02-18 16:11:36 +01:00
parent 68088341d6
commit 7fcf2650ee
4 changed files with 65 additions and 0 deletions

View File

@@ -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.