From ccdb2765f867fda295b18eab239d8ace1dd63415 Mon Sep 17 00:00:00 2001 From: gman Date: Wed, 25 Oct 2023 09:42:09 +0300 Subject: [PATCH] fix flyTo --- src/KartaPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/KartaPage.tsx b/src/KartaPage.tsx index a60ab60..2630a8a 100644 --- a/src/KartaPage.tsx +++ b/src/KartaPage.tsx @@ -43,7 +43,8 @@ export function KartaPage() { const handleAddressClick = (id) => { setSelected(id) - id > 0 && articles && mapRef.current?.flyTo({ center: Object.values(articles.find(e => e.id == id).attributes.coordinates).slice(1) }) + const { longitude, latitude } = articles.find(e => e.id == id).attributes + id > 0 && articles && mapRef.current?.flyTo({ center: [longitude, latitude] }) } return (