Skip to content

Commit 470ef7f

Browse files
feat: update cursor when user hover on valhalla tiles (#318)
1 parent d3f55f3 commit 470ef7f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/map/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,17 @@ export const MapComponent = () => {
700700
features.length > 0 &&
701701
features[0]?.layer?.id === 'routes-line';
702702

703+
const isOverTiles =
704+
features &&
705+
features.length > 0 &&
706+
(features[0]?.layer?.id === VALHALLA_EDGES_LAYER_ID ||
707+
features[0]?.layer?.id === VALHALLA_NODES_LAYER_ID);
708+
703709
if (isOverRoute) {
704710
onRouteLineHover(event);
711+
} else if (isOverTiles) {
712+
const map = mapRef.current.getMap();
713+
map.getCanvas().style.cursor = 'pointer';
705714
} else {
706715
// Clear popup and cursor when not over route
707716
if (routeHoverPopup) {
@@ -853,7 +862,6 @@ export const MapComponent = () => {
853862
longitude={tilesPopup.lng}
854863
latitude={tilesPopup.lat}
855864
closeButton={false}
856-
// closeOnClick={false}
857865
maxWidth="none"
858866
onClose={() => setTilesPopup(null)}
859867
>

0 commit comments

Comments
 (0)