Skip to content

Commit 0fc1c9a

Browse files
committed
fix: hover over cluster
1 parent 6cda91e commit 0fc1c9a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/app/map/[id]/hooks/useMapHover.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,17 @@ export function useMapHoverEffect({
144144

145145
if (features?.length) {
146146
const feature = features[0];
147-
setHoverMarker({
148-
coordinates: [e.lngLat.lng, e.lngLat.lat],
149-
properties: feature.properties || {},
150-
});
151-
if (map.getCanvas().style.cursor !== "pointer") {
152-
prevPointer.cursor = map.getCanvas().style.cursor || "";
147+
if (!feature?.properties?.cluster) {
148+
setHoverMarker({
149+
coordinates: [e.lngLat.lng, e.lngLat.lat],
150+
properties: feature.properties || {},
151+
});
152+
if (map.getCanvas().style.cursor !== "pointer") {
153+
prevPointer.cursor = map.getCanvas().style.cursor || "";
154+
}
155+
map.getCanvas().style.cursor = "pointer";
156+
return true;
153157
}
154-
map.getCanvas().style.cursor = "pointer";
155-
return true;
156158
}
157159

158160
setHoverMarker(null);

0 commit comments

Comments
 (0)