From a70db1bdee7cfbcbe881fec92933145412606399 Mon Sep 17 00:00:00 2001 From: g Date: Tue, 21 Mar 2023 12:42:50 +0300 Subject: [PATCH] popup to center of clicked point --- src/Points.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Points.jsx b/src/Points.jsx index 4514d60..b160a44 100644 --- a/src/Points.jsx +++ b/src/Points.jsx @@ -833,11 +833,11 @@ export default function Points({ mapOptions, onMapOptionClick }) { setOpen(false) setPopupInfo(null) if (event.features[0]) { - + console.log(event.features[0].geometry) // event.originalEvent.stopPropagation(); setPopupInfo({ - lon: event.lngLat.lng, - lat: event.lngLat.lat, + lon: event.features[0].geometry.coordinates[0], + lat: event.features[0].geometry.coordinates[1], ...event.features[0].properties }) setOpen(true)