Add new Station go to newMap instead initialMap

This commit is contained in:
2024-04-21 14:42:26 +02:00
parent 50863d3015
commit bba29e04ea

View File

@@ -403,7 +403,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
//-----Kontextmenu----ende------------ //-----Kontextmenu----ende------------
// Ensure this function is only called when map is initialized and available // Ensure this function is only called when map is initialized and available
const showAddStationPopup = (e) => { const showAddStationPopup = (e) => {
if (!initialMap) { if (!newMap) {
return; return;
} }
@@ -465,7 +465,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
</form> </form>
`; `;
L.popup().setLatLng(e.latlng).setContent(popupContent).openOn(initialMap); L.popup().setLatLng(e.latlng).setContent(popupContent).openOn(newMap);
// Attach event listener here // Attach event listener here
L.DomEvent.on(popupContent, "submit", handleSubmit); L.DomEvent.on(popupContent, "submit", handleSubmit);