loleaflet: notify when all empty tiles have loaded
Will be used for testing
This commit is contained in:
parent
929cf9e061
commit
d055317175
2 changed files with 10 additions and 0 deletions
|
@ -523,6 +523,7 @@ L.GridLayer = L.Layer.extend({
|
|||
delete this._tiles[key];
|
||||
}
|
||||
}
|
||||
this._emptyTilesCount = 0;
|
||||
}
|
||||
|
||||
// if its the first batch of tiles to load
|
||||
|
|
|
@ -90,6 +90,7 @@ L.TileLayer = L.GridLayer.extend({
|
|||
}),
|
||||
draggable: true
|
||||
});
|
||||
this._emptyTilesCount = 0;
|
||||
this._textArea = L.DomUtil.get('clipboard');
|
||||
this._textArea.focus();
|
||||
},
|
||||
|
@ -162,6 +163,7 @@ L.TileLayer = L.GridLayer.extend({
|
|||
http://www.w3.org/TR/WCAG20-TECHS/H67
|
||||
*/
|
||||
tile.alt = '';
|
||||
this._emptyTilesCount += 1;
|
||||
return tile;
|
||||
},
|
||||
|
||||
|
@ -386,6 +388,13 @@ L.TileLayer = L.GridLayer.extend({
|
|||
if (this._tiles[key]._invalidCount > 0) {
|
||||
this._tiles[key]._invalidCount -= 1;
|
||||
}
|
||||
if (!tile.loaded) {
|
||||
this._emptyTilesCount -= 1;
|
||||
if (this._emptyTilesCount === 0) {
|
||||
console.log('alltilesloaded');
|
||||
this._map.fire('alltilesloaded');
|
||||
}
|
||||
}
|
||||
tile.el.src = img;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue