Avoid busy-waiting while images load

This is to be in conformance with the work done with #184.
This commit is contained in:
Éric Lemoine
2013-02-15 18:02:15 +01:00
parent a3c65978d1
commit 85eec4e9b8
4 changed files with 24 additions and 30 deletions

View File

@@ -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
*/