Auto set map bounds on load
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
|||||||
ShareIcon
|
ShareIcon
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
import { useDevice } from "@app/core/providers/useDevice.js";
|
import { useDevice } from "@app/core/providers/useDevice.js";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
export const MapControlls = (): JSX.Element => {
|
export const MapControlls = (): JSX.Element => {
|
||||||
const { current: map } = useMap();
|
const { current: map } = useMap();
|
||||||
@@ -45,6 +46,10 @@ export const MapControlls = (): JSX.Element => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getBBox();
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="absolute right-0 top-0 z-10 m-2 ">
|
<div className="absolute right-0 top-0 z-10 m-2 ">
|
||||||
<div className="divide-y divide-orange-300 overflow-hidden rounded-md bg-white shadow-md">
|
<div className="divide-y divide-orange-300 overflow-hidden rounded-md bg-white shadow-md">
|
||||||
|
|||||||
Reference in New Issue
Block a user