[Pkg-javascript-commits] [leaflet-markercluster] 193/479: Fixups for singleMarkerMode with new cluster icon bits

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:28 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 40441542d2b429fecc61fd3e9c4ebf002466b26c
Author: danzel <danzel at localhost.geek.nz>
Date:   Mon Sep 3 09:22:28 2012 +1200

    Fixups for singleMarkerMode with new cluster icon bits
---
 src/MarkerCluster.js      |  4 ----
 src/MarkerClusterGroup.js | 11 +++++++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index c30d4ba..2f08939 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -52,10 +52,6 @@ L.MarkerCluster = L.Marker.extend({
 			this._childClusters.push(new1);
 			this._childCount += new1._childCount;
 		} else {
-			if (this._group.options.singleMarkerMode === true) {
-				new1.options.icon = this._group.options.iconCreateFunction(1);
-			}
-
 			this._markers.push(new1);
 			this._childCount++;
 		}
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 3ed33d3..2bd0770 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -43,6 +43,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			return this;
 		}
 
+		if (this.options.singleMarkerMode) {
+			layer.options.icon = this.options.iconCreateFunction({
+				getChildCount: function () {
+					return 1;
+				},
+				getAllChildMarkers: function () {
+					return [layer];
+				}
+			});
+		}
+
 		if (!this._map) {
 			this._needsClustering.push(layer);
 			return 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