[Pkg-javascript-commits] [leaflet-markercluster] 321/479: Use addLayers and add some commented out timing functionality to the 50000 example.

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:47 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 0ea04bc833e312d1a880270bda808b46b190cb86
Author: danzel <danzel at localhost.geek.nz>
Date:   Tue Feb 12 09:19:04 2013 +1300

    Use addLayers and add some commented out timing functionality to the 50000 example.
---
 example/marker-clustering-realworld.50000.html | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/example/marker-clustering-realworld.50000.html b/example/marker-clustering-realworld.50000.html
index bddfe06..37c0a85 100644
--- a/example/marker-clustering-realworld.50000.html
+++ b/example/marker-clustering-realworld.50000.html
@@ -32,22 +32,31 @@
 
 			var markers = new L.MarkerClusterGroup();
 
+			var markerList = [];
+
+			//console.log('start creating markers: ' + window.performance.now());
+			
 			for (var i = 0; i < addressPoints.length; i++) {
 				var a = addressPoints[i];
 				var title = a[2];
 				var marker = new L.Marker(new L.LatLng(a[0], a[1]), { title: title });
 				marker.bindPopup(title);
-				markers.addLayer(marker);
+				markerList.push(marker);
 			}
 			for (var i = 0; i < addressPoints2.length; i++) {
 				var a = addressPoints[i];
 				var title = a[2];
 				var marker = new L.Marker(new L.LatLng(a[0], a[1]), { title: title });
 				marker.bindPopup(title);
-				markers.addLayer(marker);
+				markerList.push(marker);
 			}
 
+			//console.log('start clustering: ' + window.performance.now());
+
+			markers.addLayers(markerList);
 			map.addLayer(markers);
+
+			//console.log('end clustering: ' + window.performance.now());
 	</script>
 </body>
 </html>

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