Don't load class leaflet-tile-loaded in case of error (#4980)

This commit is contained in:
Babajide Fowotade 2016-09-30 08:28:42 +01:00 committed by Iván Sánchez Ortega
parent c624a3ed50
commit 6b0808d6f0

View File

@ -811,14 +811,16 @@ L.GridLayer = L.Layer.extend({
this._pruneTiles();
}
L.DomUtil.addClass(tile.el, 'leaflet-tile-loaded');
if (!err) {
L.DomUtil.addClass(tile.el, 'leaflet-tile-loaded');
// @event tileload: TileEvent
// Fired when a tile loads.
this.fire('tileload', {
tile: tile.el,
coords: coords
});
// @event tileload: TileEvent
// Fired when a tile loads.
this.fire('tileload', {
tile: tile.el,
coords: coords
});
}
if (this._noTilesToLoad()) {
this._loading = false;