Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:UCF/campus-map-react into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramin Farhadi authored and Ramin Farhadi committed Jun 19, 2024
2 parents 4fd36b2 + 9206597 commit 87c825a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ function App() {
setCampus(campus);
}

const onMouseEnterInteractive = (_: MapLayerMouseEvent) => {
mapRef.current!.getCanvas().style.cursor = 'pointer';
}

const onMouseLeaveInteractive = (_: MapLayerMouseEvent) => {
mapRef.current!.getCanvas().style.cursor = '';
}

useMemo(() => {
// Location data
fetch('/data/geojson/locations/buildingPoints.geojson')
Expand Down Expand Up @@ -347,7 +355,7 @@ function App() {
...defaultLayoutProps,
'icon-image': 'location',
visibility: visibility.locations.buildings! ? 'visible': 'none'
},
}
};

const buildingShapeLayer: FillLayer = {
Expand Down Expand Up @@ -623,6 +631,8 @@ function App() {
mapStyle='mapbox://styles/mapbox/streets-v12'
mapboxAccessToken={ TOKEN }
interactiveLayerIds={['building-point-layer', 'search-result-layer']}
onMouseEnter={onMouseEnterInteractive}
onMouseLeave={onMouseLeaveInteractive}
onClick={handleOnClick}
ref={mapRef}>
<SearchResults
Expand Down

0 comments on commit 87c825a

Please sign in to comment.