Improve navigation control
This commit is contained in:
parent
c9a56504ce
commit
88d27dbf6b
@ -121,6 +121,8 @@ export const ColouringMap: FC<ColouringMapProps> = ({
|
||||
zoom: zoom,
|
||||
});
|
||||
|
||||
map.current.addControl(new mapboxgl.NavigationControl());
|
||||
|
||||
map.current.on("move", () => {
|
||||
setLng(map.current.getCenter().lng.toFixed(4));
|
||||
setLat(map.current.getCenter().lat.toFixed(4));
|
||||
@ -128,8 +130,6 @@ export const ColouringMap: FC<ColouringMapProps> = ({
|
||||
});
|
||||
});
|
||||
|
||||
map.addControl(new mapboxgl.NavigationControl());
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={mapContainer}
|
||||
|
Loading…
Reference in New Issue
Block a user