diff --git a/components/MapComponent.js b/components/MapComponent.js index 16695c27c..16501840d 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -2382,7 +2382,15 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { contextmenuItems: [ { text: "Marker entfernen", - callback: () => removeMarker(marker, lineData), + callback: () => { + const newCoords = marker.getLatLng(); + const newCoordinates = [...lineData.coordinates]; + newCoordinates[index] = [newCoords.lat, newCoords.lng]; + + removeMarker(marker, lineData); + newPolylines[lineIndex].remove(); + lineData.coordinates = newCoordinates; + }, }, ], }); @@ -2416,7 +2424,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { polyline.on("mouseover", (e) => { // Optional: Visualisiere, dass die Linie interaktiv ist - polyline.setStyle({ color: "blue" }); + polyline.setStyle({ color: "blue", weight: 10 }); }); polyline.on("mouseout", (e) => {