diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts index 56e247e3dd..2301a8c47a 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts @@ -140,9 +140,10 @@ export default abstract class LeafletMap { if (markerClusteringSettings.useIconCreateFunction && markerClusteringSettings.clusterMarkerFunction) { this.clusteringSettings.iconCreateFunction = (cluster) => { const childCount = cluster.getChildCount(); + const formattedData = cluster.getAllChildMarkers().map(clusterMarker => clusterMarker.options.tbMarkerData); const markerColor = markerClusteringSettings.clusterMarkerFunction ? safeExecute(markerClusteringSettings.parsedClusterMarkerFunction, - [cluster.getAllChildMarkers(), childCount]) + [formattedData, childCount]) : null; if (isDefinedAndNotNull(markerColor) && tinycolor(markerColor).isValid()) { const parsedColor = tinycolor(markerColor); diff --git a/ui-ngx/src/assets/help/en_US/widget/lib/map/clustering_color_fn.md b/ui-ngx/src/assets/help/en_US/widget/lib/map/clustering_color_fn.md index d34ca44a88..ba58fa3cd3 100644 --- a/ui-ngx/src/assets/help/en_US/widget/lib/map/clustering_color_fn.md +++ b/ui-ngx/src/assets/help/en_US/widget/lib/map/clustering_color_fn.md @@ -10,10 +10,11 @@ A JavaScript function used to compute clustering marker color. **Parameters:**
FormattedData> - A FormattedData object associated with marker or data point of the route.FormattedData[]
+ - the array of total markers contained within each cluster.entityId, entityName)number - number of markers in this cluster
+ number - the total number of markers contained within that cluster