Adding tileloadstart event to layer.

For this to be useful (i.e. so listeners can see/modify the tile url), a change in Tile.Image is required so we do not fire the loadstart event before we have the url to load.
This commit is contained in:
ahocevar
2012-03-06 14:40:08 +01:00
parent 81b2b524ec
commit a05eab29db
3 changed files with 12 additions and 6 deletions

View File

@@ -506,7 +506,7 @@
}
function test_Layer_Grid_addTileMonitoringHooks(t) {
t.plan(17);
t.plan(18);
layer = new OpenLayers.Layer.Grid();
layer.events = {
@@ -546,10 +546,11 @@
t.eq(g_events[0][0], "loadstart", "loadstart event triggered when numLoadingTiles is 0");
t.eq(layer.numLoadingTiles, 1, "numLoadingTiles incremented");
t.eq(g_events[1][0], "tileloadstart", "tileloadstart event triggered");
g_events = [];
tile.onLoadStart.apply(layer);
t.eq(g_events.length, 0, "loadstart event not triggered when numLoadingTiles is not 0");
t.eq(g_events.length, 1, "tileloadstart, but not loadstart triggered when numLoadingTiles is not 0");
t.eq(layer.numLoadingTiles, 2, "numLoadingTiles incremented");