Skip to content

Commit

Permalink
hotfix(Leaflet): prevent nonsense bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen committed Sep 20, 2023
1 parent f212a20 commit 8fd2caa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/site/assets/ts/leaflet/bounds.ts
Original file line number Diff line number Diff line change
@@ -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);
};
Expand Down

0 comments on commit 8fd2caa

Please sign in to comment.