Avoid busy-waiting while images load
This is to be in conformance with the work done with #184.
This commit is contained in:
@@ -3,6 +3,8 @@ goog.provide('ol.renderer.Layer');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('ol.FrameState');
|
||||
goog.require('ol.Image');
|
||||
goog.require('ol.ImageState');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.TileCoord');
|
||||
@@ -119,6 +121,19 @@ ol.renderer.Layer.prototype.handleLayerContrastChange = goog.nullFunction;
|
||||
ol.renderer.Layer.prototype.handleLayerHueChange = goog.nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
* Handle changes in image state.
|
||||
* @param {goog.events.Event} event Image change event.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.Layer.prototype.handleImageChange = function(event) {
|
||||
var image = /** @type {ol.Image} */ (event.target);
|
||||
if (image.getState() === ol.ImageState.LOADED) {
|
||||
this.getMap().requestRenderFrame();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user