[Pkg-javascript-commits] [leaflet-markercluster] 59/479: removeLayer works now. addLayer still needs fixing to be clustering aware

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:09 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 003fceab1485e29dd1bc72614bd5fccc17809267
Author: danzel <danzel at localhost.geek.nz>
Date:   Fri Jul 20 11:49:40 2012 +1200

    removeLayer works now. addLayer still needs fixing to be clustering aware
---
 src/MarkerCluster.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 080a94b..3f99495 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -119,6 +119,10 @@ L.MarkerCluster = L.Marker.extend({
 		//Check our children
 		for (i = markers.length - 1; i >= 0; i--) {
 			if (markers[i] == layer) {
+				if (markers[i]._icon) {
+					L.FeatureGroup.prototype.removeLayer.call(group, markers[i]);
+				}
+
 				markers.splice(i, 1);
 				this._recalculateBounds();
 		

-- 
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