Permalink
Browse files

Use addLayers and add some commented out timing functionality to the …

…50000 example.
  • Loading branch information...
1 parent c738664 commit 0ea04bc833e312d1a880270bda808b46b190cb86 @danzel danzel committed Feb 11, 2013
Showing with 11 additions and 2 deletions.
  1. +11 −2 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>

0 comments on commit 0ea04bc

Please sign in to comment.