Skip to content

Commit

Permalink
fixed mapbox zoom for single waypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra committed Dec 18, 2023
1 parent c96a209 commit cc8c5ed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,7 @@ const CONST = {
MAPBOX: {
PADDING: 50,
DEFAULT_ZOOM: 10,
SINGLE_MARKER_ZOOM: 15,
DEFAULT_COORDINATE: [-122.4021, 37.7911],
STYLE_URL: 'mapbox://styles/expensify/cllcoiqds00cs01r80kp34tmq',
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/MapView/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const MapView = forwardRef<MapViewHandle, ComponentProps>(

if (waypoints.length === 1) {
cameraRef.current?.setCamera({
zoomLevel: 15,
zoomLevel: CONST.MAPBOX.SINGLE_MARKER_ZOOM,
animationDuration: 1500,
centerCoordinate: waypoints[0].coordinate,
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/MapView/MapView.website.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const MapView = forwardRef<MapViewHandle, ComponentProps>(
if (waypoints.length === 1) {
mapRef.flyTo({
center: waypoints[0].coordinate,
zoom: CONST.MAPBOX.DEFAULT_ZOOM,
zoom: CONST.MAPBOX.SINGLE_MARKER_ZOOM,
});
return;
}
Expand Down

0 comments on commit cc8c5ed

Please sign in to comment.