Replace source ready flag with loading/ready/error enum

This commit is contained in:
Tom Payne
2013-09-24 15:22:23 +02:00
parent da84dd9253
commit 167b309242
12 changed files with 114 additions and 78 deletions
+3 -17
View File
@@ -15,6 +15,7 @@ goog.require('ol.TileRange');
goog.require('ol.TileUrlFunction');
goog.require('ol.extent');
goog.require('ol.proj');
goog.require('ol.source.State');
goog.require('ol.source.TileImage');
goog.require('ol.tilegrid.XYZ');
@@ -46,15 +47,10 @@ ol.source.TileJSON = function(options) {
goog.base(this, {
crossOrigin: options.crossOrigin,
projection: ol.proj.get('EPSG:3857'),
state: ol.source.State.LOADING,
tileLoadFunction: options.tileLoadFunction
});
/**
* @private
* @type {boolean}
*/
this.ready_ = false;
/**
* @private
* @type {!goog.async.Deferred}
@@ -118,16 +114,6 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function() {
]);
}
this.ready_ = true;
this.dispatchChangeEvent();
this.setState(ol.source.State.READY);
};
/**
* @inheritDoc
*/
ol.source.TileJSON.prototype.isReady = function() {
return this.ready_;
};