From cd758801927786c56a932cc74c873c571db82a45 Mon Sep 17 00:00:00 2001 From: Alexander Tedeschi Date: Tue, 5 Nov 2024 16:28:57 -0500 Subject: [PATCH] call setZoom before setCenter --- src/mapbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapbox.js b/src/mapbox.js index 54af003..1142caa 100644 --- a/src/mapbox.js +++ b/src/mapbox.js @@ -44,8 +44,8 @@ const Mapbox = ({ pitchWithRotate: false, touchZoomRotate: true, }) - if (center) map.current.setCenter(center) if (zoom) map.current.setZoom(zoom) + if (center) map.current.setCenter(center) map.current.touchZoomRotate.disableRotation() map.current.touchPitch.disable() map.current.on('styledata', () => {