From bffcea1642749782a04cd664b058a5d899ea7df3 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 7 Dec 2021 20:42:24 +0000 Subject: [PATCH] Only pan to markers with popups on second click --- src/util/markers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/markers.ts b/src/util/markers.ts index 082a48d..5c8df23 100644 --- a/src/util/markers.ts +++ b/src/util/markers.ts @@ -26,7 +26,9 @@ export const createMarker = (options: LiveAtlasMarker, converter: Function): Mar const marker = new GenericMarker(converter(options.location), options); marker.on('click', (e: LeafletMouseEvent) => { - e.target._map.panTo(e.target.getLatLng()); + if(!e.target.getPopup() || e.target.isPopupOpen()) { + e.target._map.panTo(e.target.getLatLng()); + } }); if(options.popupContent) {