From 0f6e5f133bf47c5b1e50576f808eda4720ab47d0 Mon Sep 17 00:00:00 2001 From: nikiv3 Date: Tue, 20 Mar 2018 17:50:54 +0300 Subject: [PATCH] canceling AnimFrame on layer remove --- L.CanvasLayer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/L.CanvasLayer.js b/L.CanvasLayer.js index 03cee50..cb3cac6 100644 --- a/L.CanvasLayer.js +++ b/L.CanvasLayer.js @@ -93,6 +93,9 @@ L.CanvasLayer = (L.Layer ? L.Layer : L.Class).extend({ var del = this._delegate || this; del.onLayerWillUnmount && del.onLayerWillUnmount(); // -- callback + if (this._frame) { + L.Util.cancelAnimFrame(this._frame); + } map.getPanes().overlayPane.removeChild(this._canvas);