Avoid busy-waiting while images load
This is to be in conformance with the work done with #184.
This commit is contained in:
@@ -69,20 +69,13 @@ ol.renderer.dom.ImageLayer.prototype.renderFrame =
|
||||
if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.PANNING]) {
|
||||
var image_ = imageSource.getImage(frameState.extent, viewResolution);
|
||||
var imageState = image_.getState();
|
||||
var animate = false;
|
||||
if (imageState == ol.ImageState.ERROR) {
|
||||
// pass
|
||||
} else if (imageState == ol.ImageState.IDLE) {
|
||||
animate = true;
|
||||
if (imageState == ol.ImageState.IDLE) {
|
||||
goog.events.listenOnce(image_, goog.events.EventType.CHANGE,
|
||||
this.handleImageChange, false, this);
|
||||
image_.load();
|
||||
} else if (imageState == ol.ImageState.LOADING) {
|
||||
animate = true;
|
||||
} else if (imageState == ol.ImageState.LOADED) {
|
||||
image = image_;
|
||||
}
|
||||
if (animate) {
|
||||
frameState.animate = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!goog.isNull(image)) {
|
||||
|
||||
Reference in New Issue
Block a user