From c30ecace752f9e2b6d0dbca4d4103e500df38bac Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 15 Mar 2016 17:08:39 +0100 Subject: [PATCH] Handle aborted tiles in ol.TileQueue --- src/ol/imagetile.js | 2 ++ src/ol/tile.js | 3 ++- src/ol/tilequeue.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index b440e908ad..9aae36da74 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -72,6 +72,8 @@ ol.ImageTile.prototype.disposeInternal = function() { if (this.interimTile) { this.interimTile.dispose(); } + this.state = ol.TileState.ABORT; + this.changed(); goog.base(this, 'disposeInternal'); }; diff --git a/src/ol/tile.js b/src/ol/tile.js index aa59502afc..db8dc95563 100644 --- a/src/ol/tile.js +++ b/src/ol/tile.js @@ -15,7 +15,8 @@ ol.TileState = { LOADING: 1, LOADED: 2, ERROR: 3, - EMPTY: 4 + EMPTY: 4, + ABORT: 5 }; diff --git a/src/ol/tilequeue.js b/src/ol/tilequeue.js index b383b95bbf..141f54bd6c 100644 --- a/src/ol/tilequeue.js +++ b/src/ol/tilequeue.js @@ -95,7 +95,7 @@ ol.TileQueue.prototype.handleTileChange = function(event) { var tile = /** @type {ol.Tile} */ (event.target); var state = tile.getState(); if (state === ol.TileState.LOADED || state === ol.TileState.ERROR || - state === ol.TileState.EMPTY) { + state === ol.TileState.EMPTY || state === ol.TileState.ABORT) { ol.events.unlisten(tile, ol.events.EventType.CHANGE, this.handleTileChange, this); var tileKey = tile.getKey();