@@ -214,10 +214,13 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
214
214
} ;
215
215
216
216
// Custom cluster icon
217
- const createClusterCustomIcon = ( cluster ) => {
217
+ const createClusterCustomIcon = ( cluster , selectedData ) => {
218
218
const childCount = cluster . getChildCount ( ) ;
219
219
const childMarkers = cluster . getAllChildMarkers ( ) ;
220
220
221
+ const isSelected = Array . isArray ( selectedData ) && selectedData . length == childMarkers . length &&
222
+ selectedData . every ( ( marker , index ) => marker . options . options . instanceObj . id == childMarkers [ index ] . options . options . instanceObj . id ) ;
223
+
221
224
const avgScore = (
222
225
childMarkers
223
226
. map ( ( marker ) => {
@@ -230,7 +233,11 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
230
233
) . toFixed ( 2 ) ;
231
234
232
235
let size = Math . min ( 36 + childCount * 2 , 96 ) ;
233
- const color = getPinColor ( avgScore ) ;
236
+ let color = getPinColor ( avgScore ) ;
237
+ if ( isSelected ) {
238
+ size += 12 ;
239
+ color = "var(--magenta)" ;
240
+ }
234
241
235
242
return L . divIcon ( {
236
243
className : "dummy" ,
@@ -280,11 +287,11 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
280
287
281
288
{ /* Clustered Markers */ }
282
289
< MarkerClusterGroup
283
- key = { "map-" + selectedKPI + searchTerm }
290
+ key = { "map-" + selectedKPI + searchTerm + ( Array . isArray ( selectedData ) ? ( selectedData . length + selectedData [ 0 ] . options . options . instanceObj . id ) : ( selectedData ? selectedData . id : "" ) ) }
284
291
showCoverageOnHover = { false }
285
292
spiderfyOnMaxZoom = { false }
286
293
zoomToBoundsOnClick = { false }
287
- iconCreateFunction = { ( cluster ) => createClusterCustomIcon ( cluster ) }
294
+ iconCreateFunction = { ( cluster ) => createClusterCustomIcon ( cluster , selectedData ) }
288
295
eventHandlers = { {
289
296
clusterclick : ( e ) => {
290
297
const cluster = e . layer ;
@@ -294,7 +301,7 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
294
301
return ;
295
302
}
296
303
const notChanged = Array . isArray ( selectedData ) && selectedData . length == markers . length &&
297
- selectedData . every ( ( marker , index ) => marker . _leaflet_id === markers [ index ] . _leaflet_id ) || false ;
304
+ selectedData . every ( ( marker , index ) => marker . options . options . instanceObj . id == markers [ index ] . options . options . instanceObj . id ) ;
298
305
if ( ! notChanged ) {
299
306
setSelectedData ( markers ) ;
300
307
} else {
0 commit comments