[Pkg-javascript-commits] [leaflet-markercluster] 173/479: Support adding markers while we aren't on the map.

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:26 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 492d8a0d27f5a160ca8df75a2e7065a647f2efcf
Author: danzel <danzel at localhost.geek.nz>
Date:   Mon Aug 20 10:38:59 2012 +1200

    Support adding markers while we aren't on the map.
---
 src/MarkerClusterGroup.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 50687c8..b68fdcf 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -93,8 +93,14 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 		if (!this._topClusterLevel) {
 			this._generateInitialClusters();
+		} else if (this._needsClustering.length > 0) {
+			for (var i = this._needsClustering.length - 1; i >= 0; i--) {
+				this.addLayer(this._needsClustering[i]);
+			}
+			this._needsClustering = [];
 		}
 
+
 		this._map.on('zoomend', this._zoomEnd, this);
 		this._map.on('moveend', this._moveEnd, 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