[Pkg-javascript-commits] [leaflet-markercluster] 178/479: Add enough layers support that you can use geojson to add your maptags. fixes #45 refs #13

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:27 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 8ac19a8f65bc461f5613309f746528b39927ac98
Author: danzel <danzel at localhost.geek.nz>
Date:   Mon Aug 27 11:47:51 2012 +1200

    Add enough layers support that you can use geojson to add your maptags. fixes #45 refs #13
---
 src/MarkerClusterGroup.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index f685d8d..37a2f77 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -31,6 +31,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 	},
 
 	addLayer: function (layer) {
+
+		if (layer instanceof L.LayerGroup)
+		{
+			for (var i in layer._layers) {
+				if (layer._layers.hasOwnProperty(i)) {
+					this.addLayer(layer._layers[i]);
+				}
+			}
+			return this;
+		}
+
 		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