feat(map): stop flyTo/panTo on champ carte by default
This commit is contained in:
parent
32dcb411ca
commit
53ae5eeb5b
2 changed files with 14 additions and 2 deletions
|
@ -26,6 +26,16 @@ export function useFitBounds() {
|
|||
);
|
||||
}
|
||||
|
||||
export function useFitBoundsNoFly() {
|
||||
const map = useMapLibre();
|
||||
return useCallback(
|
||||
(bbox: LngLatBoundsLike) => {
|
||||
map.fitBounds(bbox, { padding: 100, linear: true, duration: 0 });
|
||||
},
|
||||
[map]
|
||||
);
|
||||
}
|
||||
|
||||
export function useFlyTo() {
|
||||
const map = useMapLibre();
|
||||
return useCallback(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue