in src/atoms/default/stores/camera.js [131:152]
function transformCameraIfNeeded(map, camera, config) {
if (camera.center && camera.zoom) return camera;
const derivedCamera = map.cameraForBounds(
camera.bounds, {
bearing: camera.bearing,
padding: camera.padding || 0,
minZoom: camera.minZoom || 9,
maxZoom: camera.maxZoom || 15,
})
if (!derivedCamera) {
// console.log('no derived camera for', camera)
return camera;
}
return {
center: [derivedCamera.center.lng, derivedCamera.center.lat],
zoom: derivedCamera.zoom,
bearing: derivedCamera.bearing,
}
}