[Pkg-javascript-commits] [leaflet-markercluster] 110/479: Fix removeLayer updating count on icon

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:16 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 fee3c02705f008bff99b68cf512e444a92eb538f
Author: danzel <danzel at localhost.geek.nz>
Date:   Wed Jul 25 16:35:19 2012 +1200

    Fix removeLayer updating count on icon
---
 src/MarkerCluster.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 37012ec..fd96dad 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -182,7 +182,7 @@ L.MarkerCluster = L.Marker.extend({
 				this._recalculateBounds();
 		
 				this._childCount--;
-				if (this._icon) {
+				if (!('_zoom' in this)) {
 					this.setIcon(group.options.iconCreateFunction(this._childCount));
 				}
 				return true;
@@ -195,6 +195,9 @@ L.MarkerCluster = L.Marker.extend({
 
 			if (child._bounds.contains(layer._latlng) && child._recursivelyRemoveLayer(layer)) {
 				this._childCount--;
+				if (!('_zoom' in this)) {
+					this.setIcon(group.options.iconCreateFunction(this._childCount));
+				}
 
 				//if our child cluster is no longer a cluster, remove it and replace with just the marker
 				if (child._childCount === 1) {

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