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