[Pkg-javascript-commits] [leaflet-markercluster] 174/479: Remove coverage polygon from map when we are removed from the map. Fixes #38
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:27 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit 167ef4aa1e4e30a1f957595def95579a4b3397b0
Author: danzel <danzel at localhost.geek.nz>
Date: Mon Aug 20 10:59:27 2012 +1200
Remove coverage polygon from map when we are removed from the map. Fixes #38
---
src/MarkerClusterGroup.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index b68fdcf..f685d8d 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -192,6 +192,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
shownPolygon = null;
}
}, this);
+ map.on('layerremove', function (opt) {
+ if (shownPolygon && opt.layer === this) {
+ map.removeLayer(shownPolygon);
+ shownPolygon = null;
+ }
+ }, this);
}
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git
More information about the Pkg-javascript-commits
mailing list