[ol.Tile] add a isLoaded function
This commit is contained in:
@@ -24,6 +24,12 @@ ol.Tile = function(url, bounds) {
|
||||
*/
|
||||
this.bounds_ = bounds;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.loaded_ = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {HTMLImageElement}
|
||||
@@ -77,6 +83,7 @@ ol.Tile.prototype.getImg = function() {
|
||||
* @param {goog.events.BrowserEvent} evt Event.
|
||||
*/
|
||||
ol.Tile.prototype.handleImageLoad = function(evt) {
|
||||
this.loaded_ = true;
|
||||
this.events_.triggerEvent('load');
|
||||
};
|
||||
|
||||
@@ -88,6 +95,14 @@ ol.Tile.prototype.handleImageError = function(evt) {
|
||||
this.events_.triggerEvent('error');
|
||||
};
|
||||
|
||||
/**
|
||||
* Is the tile loaded already?
|
||||
* @return {boolean}
|
||||
*/
|
||||
ol.Tile.prototype.isLoaded = function() {
|
||||
return this.loaded_;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user