diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index cc39f293..0bb181b1 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -191,6 +191,10 @@ L.GridLayer = L.Layer.extend({ }); } + if (this._abortLoading) { + this._abortLoading(); + } + this._tiles = {}; this._tilesToLoad = 0; this._tilesTotal = 0; diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index 5c259f59..2e5aa9d5 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -143,11 +143,11 @@ L.TileLayer = L.GridLayer.extend({ for (i in this._tiles) { tile = this._tiles[i]; - if (!tile.complete) { - tile.onload = L.Util.falseFn; - tile.onerror = L.Util.falseFn; - tile.src = L.Util.emptyImageUrl; + tile.onload = L.Util.falseFn; + tile.onerror = L.Util.falseFn; + if (!tile.complete) { + tile.src = L.Util.emptyImageUrl; L.DomUtil.remove(tile); } }