diff --git a/src/ol/tile.js b/src/ol/tile.js index 6967f3e5a4..322e234f8a 100644 --- a/src/ol/tile.js +++ b/src/ol/tile.js @@ -66,6 +66,14 @@ ol.Tile = function(tileCoord, src, opt_crossOrigin) { goog.inherits(ol.Tile, goog.events.EventTarget); +/** + * @protected + */ +ol.Tile.prototype.dispatchChangeEvent = function() { + this.dispatchEvent(goog.events.EventType.CHANGE); +}; + + /** * @return {Image} Image. */ @@ -89,6 +97,7 @@ ol.Tile.prototype.handleImageError_ = function() { ol.Tile.prototype.handleImageLoad_ = function() { this.state_ = ol.TileLoadState.LOADED; this.unlistenImage_(); + this.dispatchChangeEvent(); }; @@ -101,7 +110,6 @@ ol.Tile.prototype.isLoaded = function() { /** - * @return {EventTarget} Event target. */ ol.Tile.prototype.load = function() { if (this.state_ == ol.TileLoadState.IDLE) { @@ -115,7 +123,6 @@ ol.Tile.prototype.load = function() { ]; this.image_.src = this.src_; } - return this.image_; };