From 3e9f2b8319673c1a36d69b5d99b792762ad297dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= <15726+Senen@users.noreply.github.com> Date: Tue, 23 May 2023 16:33:52 +0200 Subject: [PATCH] Load markers cluster layer by chunks In order to avoid locking the browser for a long time. when there are a lot of markers in the map: https://github.com/Leaflet/Leaflet.markercluster#handling-lots-of-markers --- app/assets/javascripts/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/map.js b/app/assets/javascripts/map.js index 0dbbf77f4..3793e2858 100644 --- a/app/assets/javascripts/map.js +++ b/app/assets/javascripts/map.js @@ -23,7 +23,7 @@ editable = $(element).data("marker-editable"); markerClustering = $(element).data("marker-clustering"); if (markerClustering) { - markers = L.markerClusterGroup(); + markers = L.markerClusterGroup({ chunkedLoading: true }); } else { markers = L.layerGroup(); }