Skip to content

Commit

Permalink
when selecting multiple alerts, force those alerts to be hovered
Browse files Browse the repository at this point in the history
  • Loading branch information
owenjs committed Feb 16, 2023
1 parent 8be0150 commit 3524286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface IProps {
points: IPoint[];
pointStyle?: Record<any, any>;
onSquareSelect?: (ids: string[], point: mapboxgl.Point) => void;
forceHoveredSquareIds?: string[] | null;
selectedSquareIds?: string[] | null;
mapRef: MapInstance | null;
goToPoints?: boolean;
Expand All @@ -48,6 +49,7 @@ const SquareClusterMarkers: FC<IProps> = props => {
pointDataType = EPointDataTypes.Reports,
points,
onSquareSelect,
forceHoveredSquareIds,
selectedSquareIds,
mapRef,
pointStyle = defaultPointStyle,
Expand Down Expand Up @@ -85,7 +87,7 @@ const SquareClusterMarkers: FC<IProps> = props => {
id: point.id,
icon: iconGenerator(
point.type || "",
point.id === hoveredPoint,
point.id === hoveredPoint || forceHoveredSquareIds?.includes(point.id),
selectedPoints?.length
? canMultiSelect
? selectedPoints.includes(point.id)
Expand All @@ -96,7 +98,7 @@ const SquareClusterMarkers: FC<IProps> = props => {
})
)
),
[hoveredPoint, iconGenerator, points, selectedPoints, canMultiSelect]
[hoveredPoint, iconGenerator, points, selectedPoints, forceHoveredSquareIds, canMultiSelect]
);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const AreaAlertMapSource: FC<IProps> = props => {
id="alerts"
pointDataType={EPointDataTypes.Alerts}
points={alertPoints}
forceHoveredSquareIds={multipleAlertsToPick}
selectedSquareIds={selectedAlertIds}
pointStyle={{
...pointStyle,
Expand Down

0 comments on commit 3524286

Please sign in to comment.