From 1f48198e95a4e21106c04acc4158ff804436d8bd Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 26 Apr 2016 10:20:44 +0200 Subject: [PATCH] Allow tiles in ol.ImageState.ERROR state to be loaded. --- src/ol/image.js | 7 +++++-- src/ol/imagetile.js | 7 +++++-- src/ol/tile.js | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/ol/image.js b/src/ol/image.js index 845bd9a572..03e01f27e1 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -122,10 +122,13 @@ ol.Image.prototype.handleImageLoad_ = function() { /** - * Load not yet loaded URI. + * Load the image or retry if loading previously failed. + * Loading is taken care of by the tile queue, and calling this method is + * only needed for preloading or for reloading in case of an error. + * @api */ ol.Image.prototype.load = function() { - if (this.state == ol.ImageState.IDLE) { + if (this.state == ol.ImageState.IDLE || this.state == ol.ImageState.ERROR) { this.state = ol.ImageState.LOADING; this.changed(); goog.asserts.assert(!this.imageListenerKeys_, diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index ada8413958..85cc5a79d8 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -137,10 +137,13 @@ ol.ImageTile.prototype.handleImageLoad_ = function() { /** - * Load not yet loaded URI. + * Load the image or retry if loading previously failed. + * Loading is taken care of by the tile queue, and calling this method is + * only needed for preloading or for reloading in case of an error. + * @api */ ol.ImageTile.prototype.load = function() { - if (this.state == ol.TileState.IDLE) { + if (this.state == ol.TileState.IDLE || this.state == ol.TileState.ERROR) { this.state = ol.TileState.LOADING; this.changed(); goog.asserts.assert(!this.imageListenerKeys_, diff --git a/src/ol/tile.js b/src/ol/tile.js index c75479acad..6c29cab579 100644 --- a/src/ol/tile.js +++ b/src/ol/tile.js @@ -107,6 +107,9 @@ ol.Tile.prototype.getState = function() { /** - * FIXME empty description for jsdoc + * Load the image or retry if loading previously failed. + * Loading is taken care of by the tile queue, and calling this method is + * only needed for preloading or for reloading in case of an error. + * @api */ ol.Tile.prototype.load = goog.abstractMethod;