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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user