Fix for coverage polygon not being removed when we are. fixes #245

This commit is contained in:
danzel
2013-10-14 13:19:02 +13:00
parent db5f0d5725
commit 1ef25fb1ae
+3 -8
View File
@@ -448,7 +448,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._spiderfierOnRemove();
}
//Clean up all the layers we added to the map
this._hideCoverage();
this._featureGroup.onRemove(map);
this._nonPointGroup.onRemove(map);
@@ -579,7 +582,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this.on('clustermouseover', this._showCoverage, this);
this.on('clustermouseout', this._hideCoverage, this);
map.on('zoomend', this._hideCoverage, this);
map.on('layerremove', this._hideCoverageOnRemove, this);
}
},
@@ -615,12 +617,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
}
},
_hideCoverageOnRemove: function (e) {
if (e.layer === this) {
this._hideCoverage();
}
},
_unbindEvents: function () {
var spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,
showCoverageOnHover = this.options.showCoverageOnHover,
@@ -634,7 +630,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this.off('clustermouseover', this._showCoverage, this);
this.off('clustermouseout', this._hideCoverage, this);
map.off('zoomend', this._hideCoverage, this);
map.off('layerremove', this._hideCoverageOnRemove, this);
}
},