From cc8c5edae9656b928d31ed76f9192e58b20b8ca0 Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Mon, 18 Dec 2023 20:05:41 +0530 Subject: [PATCH] fixed mapbox zoom for single waypoint --- src/CONST.ts | 1 + src/components/MapView/MapView.tsx | 2 +- src/components/MapView/MapView.website.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index b29456ba170b..862cc25efbf2 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -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', }, diff --git a/src/components/MapView/MapView.tsx b/src/components/MapView/MapView.tsx index 7b3d73479dde..577325e53e7c 100644 --- a/src/components/MapView/MapView.tsx +++ b/src/components/MapView/MapView.tsx @@ -98,7 +98,7 @@ const MapView = forwardRef( if (waypoints.length === 1) { cameraRef.current?.setCamera({ - zoomLevel: 15, + zoomLevel: CONST.MAPBOX.SINGLE_MARKER_ZOOM, animationDuration: 1500, centerCoordinate: waypoints[0].coordinate, }); diff --git a/src/components/MapView/MapView.website.tsx b/src/components/MapView/MapView.website.tsx index 7910d7f93a29..55e99110737d 100644 --- a/src/components/MapView/MapView.website.tsx +++ b/src/components/MapView/MapView.website.tsx @@ -109,7 +109,7 @@ const MapView = forwardRef( if (waypoints.length === 1) { mapRef.flyTo({ center: waypoints[0].coordinate, - zoom: CONST.MAPBOX.DEFAULT_ZOOM, + zoom: CONST.MAPBOX.SINGLE_MARKER_ZOOM, }); return; }