Handle aborted tiles in ol.TileQueue
This commit is contained in:
@@ -72,6 +72,8 @@ ol.ImageTile.prototype.disposeInternal = function() {
|
|||||||
if (this.interimTile) {
|
if (this.interimTile) {
|
||||||
this.interimTile.dispose();
|
this.interimTile.dispose();
|
||||||
}
|
}
|
||||||
|
this.state = ol.TileState.ABORT;
|
||||||
|
this.changed();
|
||||||
goog.base(this, 'disposeInternal');
|
goog.base(this, 'disposeInternal');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -15,7 +15,8 @@ ol.TileState = {
|
|||||||
LOADING: 1,
|
LOADING: 1,
|
||||||
LOADED: 2,
|
LOADED: 2,
|
||||||
ERROR: 3,
|
ERROR: 3,
|
||||||
EMPTY: 4
|
EMPTY: 4,
|
||||||
|
ABORT: 5
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -95,7 +95,7 @@ ol.TileQueue.prototype.handleTileChange = function(event) {
|
|||||||
var tile = /** @type {ol.Tile} */ (event.target);
|
var tile = /** @type {ol.Tile} */ (event.target);
|
||||||
var state = tile.getState();
|
var state = tile.getState();
|
||||||
if (state === ol.TileState.LOADED || state === ol.TileState.ERROR ||
|
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,
|
ol.events.unlisten(tile, ol.events.EventType.CHANGE,
|
||||||
this.handleTileChange, this);
|
this.handleTileChange, this);
|
||||||
var tileKey = tile.getKey();
|
var tileKey = tile.getKey();
|
||||||
|
|||||||
Reference in New Issue
Block a user