diff --git a/src/app/student/map/_components/MapComponent.tsx b/src/app/student/map/_components/MapComponent.tsx index 9e4c2ad..17a36e0 100644 --- a/src/app/student/map/_components/MapComponent.tsx +++ b/src/app/student/map/_components/MapComponent.tsx @@ -54,10 +54,13 @@ export function MapComponent({ // Fly to location center on change useEffect(() => { const { longitude, latitude, zoom } = location.center - mapRef.current?.flyTo({ - center: [longitude, latitude], - zoom: zoom - }) + const timeout = setTimeout(() => { + mapRef.current?.flyTo({ + center: [longitude, latitude], + zoom + }) + }, 300) + return () => clearTimeout(timeout) setMarkerScale(0.6) }, [location]) diff --git a/src/app/student/map/lib/locations.ts b/src/app/student/map/lib/locations.ts index 951ff3e..556941c 100644 --- a/src/app/student/map/lib/locations.ts +++ b/src/app/student/map/lib/locations.ts @@ -21,12 +21,12 @@ const libraryCenter = { export const locations: Location[] = [ { id: "nymble/2", - label: "Nymble - floor 2", + label: "Nymble-F2", center: nymbleCenter }, { id: "nymble/3", - label: "Nymble - floor 3", + label: "Nymble-F3", center: nymbleCenter }, {