[Pkg-javascript-commits] [leaflet-markercluster] 277/479: Fix addLayers not working with singleMarkerMode.

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:39 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 1f09009349fced5da0789fd2d23afd55381c02d0
Author: Duncan Parkes <duncan at mysociety.org>
Date:   Tue Oct 16 22:17:49 2012 +0100

    Fix addLayers not working with singleMarkerMode.
    
    (cherry picked from commit 02c75f164f1bb85f61329e0f3e89b0dc527301ee)
    
    Conflicts:
    
    	dist/leaflet.markercluster.js
---
 dist/leaflet.markercluster-src.js | 22 +++++++++++-----------
 src/MarkerClusterGroup.js         | 22 +++++++++++-----------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index d390e85..2c4a3e6 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -57,17 +57,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			return this.addLayers(array);
 		}
 
-		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;
@@ -536,6 +525,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		    gridUnclustered = this._gridUnclustered,
 		    markerPoint, z;
 
+		if (this.options.singleMarkerMode) {
+			layer.options.icon = this.options.iconCreateFunction({
+				getChildCount: function () {
+					return 1;
+				},
+				getAllChildMarkers: function () {
+					return [layer];
+				}
+			});
+		}
+
 		//Find the lowest zoom level to slot this one in
 		for (; zoom >= 0; zoom--) {
 			markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 7a6c262..c4affab 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -50,17 +50,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			return this.addLayers(array);
 		}
 
-		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;
@@ -529,6 +518,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		    gridUnclustered = this._gridUnclustered,
 		    markerPoint, z;
 
+		if (this.options.singleMarkerMode) {
+			layer.options.icon = this.options.iconCreateFunction({
+				getChildCount: function () {
+					return 1;
+				},
+				getAllChildMarkers: function () {
+					return [layer];
+				}
+			});
+		}
+
 		//Find the lowest zoom level to slot this one in
 		for (; zoom >= 0; zoom--) {
 			markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position

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