Not using requestAnimationFrame
Using the Timeline tab of the Chrome Developer Tools, no significant difference of Paint events can be observed when requestAnimationFrame is used. So I agree with @elemoine that there is no need to introduce asynchronous behavior here.
This commit is contained in:
@@ -379,17 +379,9 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
onImageLoad: function() {
|
||||
var img = this.imgDiv;
|
||||
OpenLayers.Event.stopObservingElement(img);
|
||||
|
||||
OpenLayers.Animation.requestFrame(OpenLayers.Function.bind(function() {
|
||||
// make sure we are not destroyed and not being reused for a
|
||||
// different image
|
||||
if (this.imgDiv === img) {
|
||||
img.style.visibility = 'inherit';
|
||||
img.style.opacity = this.layer.opacity;
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
}, this));
|
||||
|
||||
img.style.visibility = 'inherit';
|
||||
img.style.opacity = this.layer.opacity;
|
||||
this.events.triggerEvent("loadend");
|
||||
this.isLoading = false;
|
||||
this.canvasContext = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user