From a17d1e50f6cbd111170bc4caf3bbb55f57a680ce Mon Sep 17 00:00:00 2001 From: gman Date: Mon, 6 Nov 2023 00:29:37 +0300 Subject: [PATCH] fly up when none selected --- src/KartaPage.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/KartaPage.tsx b/src/KartaPage.tsx index b46fc02..dd22c00 100644 --- a/src/KartaPage.tsx +++ b/src/KartaPage.tsx @@ -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]);