Skip to content

Commit

Permalink
Reset zoom when flying to a new location
Browse files Browse the repository at this point in the history
  • Loading branch information
hanapotski committed Sep 27, 2024
1 parent bce2004 commit 2e3931d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/hooks/useMapbox.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defaultViewport } from "helpers/Configuration";
import { useRef } from "react";
import { useMap } from "react-map-gl";
import { useListPanel } from "../appReducer";
import useBreakpoints from "./useBreakpoints";
import { useMap } from "react-map-gl";

export const useMapbox = () => {
const mapRef = useRef();
Expand Down Expand Up @@ -32,6 +33,7 @@ export const useMapbox = () => {
isListPanelOpen && isDesktop ? longitude - 0.08 : longitude,
isMobile ? latitude - 0.04 : latitude,
],
zoom: defaultViewport.zoom,
duration: 2000,
});
};
Expand Down

0 comments on commit 2e3931d

Please sign in to comment.