Merge pull request #285 from CartoDB/unbind-move-event

Unbind map's 'move' event properly when layer is removed from the map
This commit is contained in:
Pablo Alonso 2017-03-27 13:05:03 +02:00 committed by GitHub
commit 813b3b60dc
6 changed files with 28560 additions and 1606 deletions

25
dist/torque.full.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
dist/torque.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -161,7 +161,7 @@ L.CanvasLayer = L.Layer.extend({
this._container.parentNode.removeChild(this._container);
map.off({
'viewreset': this._reset,
'move': this._render,
'move': this.redraw,
'moveend': this._reset,
'resize': this._reset,
'zoomanim': this._animateZoom,

View File

@ -514,5 +514,10 @@ L.TorqueLayer = L.CanvasLayer.extend({
getStepsRange: function() {
return this.animator.stepsRange();
},
onRemove: function(map) {
L.CanvasLayer.prototype.onRemove.apply(this, arguments);
this.animator.stop();
}
});