Improve the handling of tile events with regard to tiles being unloaded before

their load events fire by adding an 'unload' event to the tile, and calling
it from the places where we're about to stop listening to events. In the longer
term, it might make sense to have this be automatic, but this resolves issues
with map resizes screwing with tile events, and reverts a previous,
incomplete solution to solve a problem with untiled tiles not resizing when
the map size changes. r=ahocevar, checked out by bartvde (Closes #1417) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6495 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-03-12 12:53:34 +00:00
parent 819825d8c3
commit cde39e98ae
3 changed files with 22 additions and 1 deletions

View File

@@ -341,6 +341,7 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
}
};
tile.events.register("loadend", tile, tile.onLoadEnd);
tile.events.register("unload", tile, tile.onLoadEnd);
},
/**
@@ -352,9 +353,11 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
* tile - {<OpenLayers.Tile>}
*/
removeTileMonitoringHooks: function(tile) {
tile.unload();
tile.events.un({
"loadstart": tile.onLoadStart,
"loadend": tile.onLoadEnd,
"unload": tile.onLoadEnd,
scope: tile
});
},