From e62f028d1dab9b9879621f193e52e88aaa567f98 Mon Sep 17 00:00:00 2001 From: rcpinheiro Date: Wed, 15 Jul 2020 18:39:15 +0100 Subject: [PATCH] Add "number" parameter to MarkerCluster When you add markers to MarkerCluster add a optional "number" parameter to the MarkerOptions (default: number=1). That way, MarkerCluster instead of showing the count of Markers, will show the sum of the "number" field in the Markers. Very useful when you try to add lots and lots of identifical markes. For instance, if you have 100 markers in the same location, you only have to add one marker with "number=100" instead of adding 100 markers. --- www/MarkerCluster.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index 4f3cd9b25..b84672386 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -1003,10 +1003,15 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', { } unionedMarkers.forEach(function (cluster) { - + var number=0; + for (var f=0;f