Skip to content

Commit

Permalink
feat: lifts the currently focused loo up to the map state
Browse files Browse the repository at this point in the history
removes the focused loo from the leaflet loo group so that the marker overlap issue is avoided
  • Loading branch information
ob6160 committed Jan 9, 2022
1 parent 5291148 commit ccb957b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/LooMap/Markers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const Markers = () => {
zIndexOffset: 0,
icon: new ToiletMarkerIcon({
toiletId: toilet.id,
isHighlighted: toilet.id === mapState?.focus?.id,
}),
alt: 'Public Toilet',
keyboard: false,
Expand All @@ -62,12 +63,12 @@ const Markers = () => {
}
});
},
[router]
[mapState?.focus?.id, router]
);

const getLooGroupLayers = useMemo(() => {
if (!data?.ukLooMarkers) {
return null;
return {};
}

const parsedAndFilteredMarkers = data?.ukLooMarkers
Expand Down

0 comments on commit ccb957b

Please sign in to comment.