Move State to ol.Tile

This commit is contained in:
Tim Schaub
2016-08-11 22:58:32 -06:00
parent ef468b3b06
commit 9e4d80b459
22 changed files with 126 additions and 131 deletions

View File

@@ -1,9 +1,9 @@
goog.provide('ol.TileQueue');
goog.require('ol');
goog.require('ol.Tile');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol.TileState');
goog.require('ol.structs.PriorityQueue');
@@ -86,8 +86,8 @@ ol.TileQueue.prototype.getTilesLoading = function() {
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.ABORT) {
if (state === ol.Tile.State.LOADED || state === ol.Tile.State.ERROR ||
state === ol.Tile.State.EMPTY || state === ol.Tile.State.ABORT) {
ol.events.unlisten(tile, ol.events.EventType.CHANGE,
this.handleTileChange, this);
var tileKey = tile.getKey();
@@ -112,7 +112,7 @@ ol.TileQueue.prototype.loadMoreTiles = function(maxTotalLoading, maxNewLoads) {
this.getCount() > 0) {
tile = /** @type {ol.Tile} */ (this.dequeue()[0]);
tileKey = tile.getKey();
if (tile.getState() === ol.TileState.IDLE && !(tileKey in this.tilesLoadingKeys_)) {
if (tile.getState() === ol.Tile.State.IDLE && !(tileKey in this.tilesLoadingKeys_)) {
this.tilesLoadingKeys_[tileKey] = true;
++this.tilesLoading_;
++newLoads;