Skip to content

Commit

Permalink
exclude selected marker from cluster (#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
oskovran authored Sep 25, 2024
1 parent 87c2ddb commit c493ef2
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ const MapTopologyContainerDescendant: VoidFunctionComponent = () => {
{deviceData && (
<MarkerClusterGroup chunkedLoading maxClusterRadius={30}>
{deviceData?.map((node) => {
if (node?.geolocation?.latitude && node?.geolocation?.longitude) {
if (node?.geolocation?.latitude && node?.geolocation?.longitude && node.id !== selectedDeviceData?.id) {
return (
<Marker
position={[node.geolocation.latitude, node.geolocation.longitude]}
key={node.id}
icon={node.id === selectedDeviceData?.id ? RED_DEFAULT_ICON : DEFAULT_ICON}
icon={DEFAULT_ICON}
eventHandlers={{
click: handleMarkerClick(node.deviceName || ''),
}}
Expand All @@ -132,6 +132,13 @@ const MapTopologyContainerDescendant: VoidFunctionComponent = () => {
})}
</MarkerClusterGroup>
)}
{selectedDeviceData && selectedDeviceData.geolocation?.latitude && selectedDeviceData.geolocation?.longitude && (
<Marker
position={[selectedDeviceData.geolocation.latitude, selectedDeviceData.geolocation.longitude]}
key={selectedDeviceData.id}
icon={RED_DEFAULT_ICON}
/>
)}
{selectedDeviceData && (
<Card zIndex={500} minWidth={150} position="absolute" right={2} bottom={6}>
<CloseButton size="md" onClick={handlePopupClose} />
Expand Down

0 comments on commit c493ef2

Please sign in to comment.