Remove state enum from tile constructor

This commit is contained in:
Tim Schaub
2016-12-27 09:49:21 -07:00
parent 3852c0da83
commit 895a506025
22 changed files with 134 additions and 128 deletions
+9 -8
View File
@@ -2,6 +2,7 @@ goog.provide('ol.ImageTile');
goog.require('ol');
goog.require('ol.Tile');
goog.require('ol.TileState');
goog.require('ol.events');
goog.require('ol.events.EventType');
@@ -10,7 +11,7 @@ goog.require('ol.events.EventType');
* @constructor
* @extends {ol.Tile}
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {ol.Tile.State} state State.
* @param {ol.TileState} state State.
* @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin.
* @param {ol.TileLoadFunctionType} tileLoadFunction Tile load function.
@@ -56,13 +57,13 @@ ol.inherits(ol.ImageTile, ol.Tile);
* @inheritDoc
*/
ol.ImageTile.prototype.disposeInternal = function() {
if (this.state == ol.Tile.State.LOADING) {
if (this.state == ol.TileState.LOADING) {
this.unlistenImage_();
}
if (this.interimTile) {
this.interimTile.dispose();
}
this.state = ol.Tile.State.ABORT;
this.state = ol.TileState.ABORT;
this.changed();
ol.Tile.prototype.disposeInternal.call(this);
};
@@ -92,7 +93,7 @@ ol.ImageTile.prototype.getKey = function() {
* @private
*/
ol.ImageTile.prototype.handleImageError_ = function() {
this.state = ol.Tile.State.ERROR;
this.state = ol.TileState.ERROR;
this.unlistenImage_();
this.changed();
};
@@ -105,9 +106,9 @@ ol.ImageTile.prototype.handleImageError_ = function() {
*/
ol.ImageTile.prototype.handleImageLoad_ = function() {
if (this.image_.naturalWidth && this.image_.naturalHeight) {
this.state = ol.Tile.State.LOADED;
this.state = ol.TileState.LOADED;
} else {
this.state = ol.Tile.State.EMPTY;
this.state = ol.TileState.EMPTY;
}
this.unlistenImage_();
this.changed();
@@ -121,8 +122,8 @@ ol.ImageTile.prototype.handleImageLoad_ = function() {
* @api
*/
ol.ImageTile.prototype.load = function() {
if (this.state == ol.Tile.State.IDLE || this.state == ol.Tile.State.ERROR) {
this.state = ol.Tile.State.LOADING;
if (this.state == ol.TileState.IDLE || this.state == ol.TileState.ERROR) {
this.state = ol.TileState.LOADING;
this.changed();
ol.DEBUG && console.assert(!this.imageListenerKeys_,
'this.imageListenerKeys_ should be null');