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:** @@ -36,7 +37,7 @@ Calculate color depending on temperature telemetry value: ```javascript let customColor; for (let markerData of data) { - if (markerData.options.tbMarkerData.temperature > 40) { + if (markerData.temperature > 40) { customColor = 'red' } }