Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Forgot to implement onRemove().
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanSanchez committed Apr 17, 2015
1 parent d730359 commit 6b0484b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Leaflet.LayerGroup.Collision.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,16 @@ function extensions(parentClass) { return {
map.on('zoomend', this._onZoomEnd, this);
},

onRemove: function(map) {
for (var i in this._staticLayers) {
map.removeLayer(this._staticLayers[i]);
}
map.off('zoomend', this._onZoomEnd, this);
parentClass.prototype.onRemove.call(this, map);
},

_maybeAddLayerToRBush: function(layer) {

var z = this._map.getZoom();
var bush = this._rbush;

Expand Down Expand Up @@ -191,8 +199,6 @@ function extensions(parentClass) { return {

this._rbush = rbush();

var z = this._map.getZoom();

for (var i=0; i < this._originalLayers.length; i++) {
this._maybeAddLayerToRBush(this._originalLayers[i]);
}
Expand Down

0 comments on commit 6b0484b

Please sign in to comment.