Add new Station go to newMap instead initialMap
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user