[Pkg-javascript-commits] [leaflet-markercluster] 233/479: Fix up adding just 1 marker. Fixes #60

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:34 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 96aeac0496e35dbf9768b5ab08f2d6b0c22ab6cd
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Sep 13 09:45:14 2012 +1200

    Fix up adding just 1 marker. Fixes #60
---
 src/MarkerCluster.js      | 2 +-
 src/MarkerClusterGroup.js | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index fe5fad3..9744ec3 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -185,7 +185,7 @@ L.MarkerCluster = L.Marker.extend({
 	},
 
 	_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {
-		this._recursively(bounds, 0, zoomLevel,
+		this._recursively(bounds, -1, zoomLevel,
 			function (c) {
 				if (zoomLevel === c._zoom) {
 					return;
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index e7fea27..d0f94f5 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -476,6 +476,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			gridUnclustered[zoom].addObject(layer, markerPoint);
 		}
 
+		//Didn't get in anything, add us to the top
+		this._topClusterLevel._addChild(layer);
+		layer.__parent = this._topClusterLevel;
 		return;
 	},
 

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