From bba29e04ea25df918ba57c4f5f817774b1035738 Mon Sep 17 00:00:00 2001 From: Ismail Ali Date: Sun, 21 Apr 2024 14:42:26 +0200 Subject: [PATCH] Add new Station go to newMap instead initialMap --- components/MapComponent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/MapComponent.js b/components/MapComponent.js index 9eb244cb7..8af733533 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -403,7 +403,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { //-----Kontextmenu----ende------------ // Ensure this function is only called when map is initialized and available const showAddStationPopup = (e) => { - if (!initialMap) { + if (!newMap) { return; } @@ -465,7 +465,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { `; - L.popup().setLatLng(e.latlng).setContent(popupContent).openOn(initialMap); + L.popup().setLatLng(e.latlng).setContent(popupContent).openOn(newMap); // Attach event listener here L.DomEvent.on(popupContent, "submit", handleSubmit);