Skip to content

Commit

Permalink
Merge pull request #13 from Nikcharn/cancelingAnimFrame
Browse files Browse the repository at this point in the history
canceling AnimFrame on layer remove
  • Loading branch information
Sumbera authored Mar 20, 2018
2 parents 1f34772 + 0f6e5f1 commit 50b53a7
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 50b53a7

Please sign in to comment.