Skip to content

Commit

Permalink
slow down map panning
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed May 29, 2024
1 parent 87aea76 commit bf505a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/actions/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function setMapCenter(map /* MapRef */, location) {
const { lat, lon } = location
if (map && !isNaN(lat) && !isNaN(lon)) {
const center = [lon, lat]
map.panTo(center)
map.panTo(center, { speed: 0.8 })
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/components/app/responsive-webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ResponsiveWebapp extends Component {
}
} else if (query.from && query.to && mainPanelContent === null) {
map?.fitBounds([query.from, query.to], {
duration: 500,
duration: 600,
padding: getFitBoundsPadding(map, 0.2)
})
} else if (query.from && !query.to) {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/map/route-preview-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const RoutePreviewOverlay = ({
useEffect(() => {
if (visible && mainPanelContent === null) {
map?.fitBounds([from, to], {
duration: 500,
duration: 600,
padding: getFitBoundsPadding(map, 0.2)
})
}
Expand Down

0 comments on commit bf505a4

Please sign in to comment.