diff --git a/TODO.md b/TODO.md index c051bec..c25e758 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,8 @@ -* update to v1.9.0+ (1.9.0 adds support for a “padding” option on flyTo) - * submit bug report for map fit weirdness from 1.9.0 upgrade -* flyTo point (vs. fitBounds) doesn’t handle the padding option? * Redo visual design * Add Reset/Finish buttons * Disable Finish button when deployments incomplete * Create guided tour + + +* update to v1.9.0+ (1.9.0 adds support for a “padding” option on flyTo) + * submit bug report for map fit weirdness from 1.9.0 upgrade diff --git a/app/components/Map.jsx b/app/components/Map.jsx index 2db995a..f11fd8d 100644 --- a/app/components/Map.jsx +++ b/app/components/Map.jsx @@ -43,7 +43,7 @@ export default function Map({ switch (true) { case mapFit instanceof mapboxgl.LngLat: - map.current.flyTo({ center: mapFit, padding, zoom: 9 }); + map.current.fitBounds(collectionBounds([mapFit]), { padding, maxZoom: 9 }); break; case mapFit instanceof mapboxgl.LngLatBounds: map.current.fitBounds(mapFit, { padding, maxZoom: 9 });