diff --git a/apps/site/assets/ts/leaflet/bounds.ts b/apps/site/assets/ts/leaflet/bounds.ts index dee6b3dac8..4a69e91aaa 100644 --- a/apps/site/assets/ts/leaflet/bounds.ts +++ b/apps/site/assets/ts/leaflet/bounds.ts @@ -1,7 +1,8 @@ import { LatLng, latLng, LatLngBounds, latLngBounds } from "leaflet"; import { MapMarker as Marker } from "./components/__mapdata"; -const getBounds = (markers: Marker[]): LatLngBounds => { +const getBounds = (markers: Marker[]): LatLngBounds | undefined => { + if (!markers.length) return undefined; const points: LatLng[] = markers.map(m => latLng(m.latitude, m.longitude)); return latLngBounds(points); };