Layers with the 'alpha' flag set to true never register proper load events, so

they never fire loadend events. r=euz (Closes #1336)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6068 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-02-08 04:18:13 +00:00
parent 99f3fa0d26
commit db0e03e2bd

View File

@@ -77,7 +77,11 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
*/
destroy: function() {
if (this.imgDiv != null) {
OpenLayers.Event.stopObservingElement(this.imgDiv.id);
if (this.layerAlphaHack) {
OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id);
} else {
OpenLayers.Event.stopObservingElement(this.imgDiv.id);
}
if (this.imgDiv.parentNode == this.frame) {
this.frame.removeChild(this.imgDiv);
this.imgDiv.map = null;
@@ -246,8 +250,15 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
this.events.triggerEvent("loadend");
}
};
OpenLayers.Event.observe(this.imgDiv, 'load',
OpenLayers.Function.bind(onload, this));
if (this.layerAlphaHack) {
OpenLayers.Event.observe(this.imgDiv.childNodes[0], 'load',
OpenLayers.Function.bind(onload, this));
} else {
OpenLayers.Event.observe(this.imgDiv, 'load',
OpenLayers.Function.bind(onload, this));
}
// Bind a listener to the onerror of the image div so that we
// can registere when a tile has finished loading with errors.