load events not working properly in OpenLayers.Tile.Image.IFrame, r=fvanderbiest (closes #2406)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10082 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -122,21 +122,6 @@ OpenLayers.Tile.Image.IFrame = OpenLayers.Class(OpenLayers.Tile.Image, {
|
||||
|
||||
// we need this reference to check back the viewRequestID
|
||||
this.imgDiv.map = this.layer.map;
|
||||
|
||||
//bind a listener to the onload of the iframe so that we
|
||||
// can register when a tile has finished loading.
|
||||
var onload = function() {
|
||||
this.show();
|
||||
//normally isLoading should always be true here but there are some
|
||||
// right funky conditions where loading and then reloading a tile
|
||||
// with the same url *really*fast*. this check prevents sending
|
||||
// a 'loadend' if the msg has already been sent
|
||||
//
|
||||
if (this.isLoading) {
|
||||
this.isLoading = false;
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -206,6 +191,23 @@ OpenLayers.Tile.Image.IFrame = OpenLayers.Class(OpenLayers.Tile.Image, {
|
||||
OpenLayers.Util.modifyDOMElement(iframe, id,
|
||||
new OpenLayers.Pixel(0,0), this.layer.getImageSize(), "absolute");
|
||||
|
||||
//bind a listener to the onload of the iframe so that we
|
||||
// can register when a tile has finished loading.
|
||||
var onload = function() {
|
||||
this.show();
|
||||
//normally isLoading should always be true here but there are some
|
||||
// right funky conditions where loading and then reloading a tile
|
||||
// with the same url *really*fast*. this check prevents sending
|
||||
// a 'loadend' if the msg has already been sent
|
||||
//
|
||||
if (this.isLoading) {
|
||||
this.isLoading = false;
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
};
|
||||
OpenLayers.Event.observe(iframe, 'load',
|
||||
OpenLayers.Function.bind(onload, this));
|
||||
|
||||
return iframe;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user