Skip to content

Commit

Permalink
fix: resize
Browse files Browse the repository at this point in the history
  • Loading branch information
MaGOs92 committed Oct 10, 2023
1 parent 6fb9deb commit 33d4cdb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions components/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,15 @@ function Map({commune, isAddressFormOpen, handleAddressForm}) {
padding: 100
})

setViewport(viewport => ({
...viewport,
bearing: camera.bearing,
longitude: camera.center.lng,
latitude: camera.center.lat,
zoom: camera.zoom
}))
if (camera) {
setViewport(viewport => ({
...viewport,
bearing: camera.bearing,
longitude: camera.center.lng,
latitude: camera.center.lat,
zoom: camera.zoom
}))
}
}
}, [map, bounds, setViewport])

Expand Down

0 comments on commit 33d4cdb

Please sign in to comment.