Skip to content

Commit

Permalink
fix: jumpy map after zoom
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Arce <raphael.arce@ts.berlin>
  • Loading branch information
raphael-arce committed May 3, 2024
1 parent 87c72f9 commit c884d86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/map/hooks/use-map-trees-interaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ export function useMapTreesInteraction(map: mapboxgl.Map | undefined) {
}
map.on("zoomend", () => {
setZoom(map.getZoom());
setLat(map.getCenter().lat);
setLng(map.getCenter().lng);
});
map.on("moveend", () => {
setLat(map.getCenter().lat);
Expand Down

0 comments on commit c884d86

Please sign in to comment.