From 03c888c20f9da7eb66b06342c4ab0437029dd3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phan=20Kochen?= Date: Wed, 8 Apr 2015 10:12:58 +0200 Subject: [PATCH] Add isLoading to GridLayer --- src/layer/tile/GridLayer.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index 7b4a04b7..9a40a1f4 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -86,6 +86,10 @@ L.GridLayer = L.Layer.extend({ return this; }, + isLoading: function () { + return this._loading; + }, + redraw: function () { if (this._map) { this._removeAllTiles(); @@ -426,7 +430,8 @@ L.GridLayer = L.Layer.extend({ if (queue.length !== 0) { // if its the first batch of tiles to load - if (this._noTilesToLoad()) { + if (!this._loading) { + this._loading = true; this.fire('loading'); } @@ -592,6 +597,7 @@ L.GridLayer = L.Layer.extend({ }); if (this._noTilesToLoad()) { + this._loading = false; this.fire('load'); } },