fly up when none selected

master
gman 2 years ago
parent ce93ba9605
commit a17d1e50f6

@ -6,6 +6,7 @@ import Map, {
ScaleControl,
GeolocateControl,
} from "react-map-gl/maplibre";
import 'maplibre-gl/dist/maplibre-gl.css';
import { useState, useEffect, useRef } from "react";
import Fuse from "fuse.js";
@ -89,6 +90,11 @@ export function KartaPage() {
],
zoom: 10,
});
} else {
mapRef.current?.flyTo({
center: [35, 57],
zoom: 5,
});
}
}, [selected]);

Loading…
Cancel
Save