From 2940cfb86b973d48037889cfd97c00b5eca547b6 Mon Sep 17 00:00:00 2001 From: CloudLun Date: Sat, 23 Mar 2024 11:44:41 -0400 Subject: [PATCH] add zoomin for the click site event --- hooks/useOnClickSites.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hooks/useOnClickSites.tsx b/hooks/useOnClickSites.tsx index 32d1d16..c5695c2 100644 --- a/hooks/useOnClickSites.tsx +++ b/hooks/useOnClickSites.tsx @@ -21,16 +21,20 @@ const useOnClickSites = () => { useEffect(() => { map?.on("click", 'sites', (e: MapMouseEvent & EventData) => { - + setId(e.features[0].properties.ID) if (!openStreetView) { setOpenStreetView(prevOpenStreetView => { if (!prevOpenStreetView) { setTimeout(() => { map?.flyTo({ - center: [e.lngLat.lng, e.lngLat.lat-0.08], + center: [e.lngLat.lng, e.lngLat.lat-0.05], duration: 1500, + zoom:12 }); + // map?.zoomIn({ + // duration:1500 + // }) }, 1500); } return true;