Skip to content

Commit

Permalink
Merge pull request #127 from iskandari/bugfix/map_props
Browse files Browse the repository at this point in the history
call setZoom before setCenter
  • Loading branch information
Shane98c authored Nov 14, 2024
2 parents f22c038 + cd75880 commit cf28606
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit cf28606

Please sign in to comment.