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