Skip to content

Commit

Permalink
canceling AnimFrame on layer remove
Browse files Browse the repository at this point in the history
  • Loading branch information
nikiv3 authored and nikiv3 committed Mar 20, 2018
1 parent 1f34772 commit 0f6e5f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions L.CanvasLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0f6e5f1

Please sign in to comment.