Skip to content

Commit c727293

Browse files
committed
Fix FE linting warnings
1 parent 734f59d commit c727293

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

frontend/components/Details/Jurisdiction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Chip, Typography } from "@mui/material"
1+
import { Typography } from "@mui/material"
22
import DetailCard from "./DetailCard"
33
import Map from "../Map/Map"
44

frontend/components/Map/Map.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,32 @@ export default function MapComponent({ center, zoom }: MapProps) {
1313
const mapRef = useRef<Map | null>(null)
1414
const markerRef = useRef<Marker | null>(null)
1515

16+
const initialCenterRef = useRef(center)
17+
const initialZoomRef = useRef(zoom)
18+
1619
useEffect(() => {
1720
if (!mapContainerRef.current || mapRef.current) return
1821

1922
const map = new Map({
2023
container: mapContainerRef.current,
2124
style: "https://tiles.openfreemap.org/styles/bright",
22-
center,
23-
zoom,
25+
center: initialCenterRef.current,
26+
zoom: initialZoomRef.current,
2427

25-
// disable panning / movement
2628
dragPan: false,
2729
dragRotate: false,
2830
keyboard: false,
2931
touchPitch: false,
3032
boxZoom: false,
3133

32-
// allow zoom, but always around the map center
3334
scrollZoom: { around: "center" },
3435
touchZoomRotate: { around: "center" },
3536
doubleClickZoom: true
3637
})
3738

3839
map.touchZoomRotate.disableRotation()
3940

40-
const marker = new Marker().setLngLat(center).addTo(map)
41+
const marker = new Marker().setLngLat(initialCenterRef.current).addTo(map)
4142

4243
mapRef.current = map
4344
markerRef.current = marker

0 commit comments

Comments
 (0)