From b31a1e8be6c43b95d4f14006fb5bd636b3520b55 Mon Sep 17 00:00:00 2001 From: Alex Fedosov Date: Tue, 9 Jun 2015 21:19:32 +0600 Subject: [PATCH] fix GridLayer move event handler, fixes #3522 --- src/layer/tile/GridLayer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index fca852df..99f13ad7 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -104,7 +104,11 @@ L.GridLayer = L.Layer.extend({ if (!this.options.updateWhenIdle) { // update tiles on move, but not more often than once per given interval - events.move = L.Util.throttle(this._onMoveEnd, this.options.updateInterval, this); + if (!this._onMove) { + this._onMove = L.Util.throttle(this._onMoveEnd, this.options.updateInterval, this); + } + + events.move = this._onMove; } if (this._zoomAnimated) {