feat: marker entfernen und polylines aktualisieren
This commit is contained in:
@@ -2382,7 +2382,15 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
|||||||
contextmenuItems: [
|
contextmenuItems: [
|
||||||
{
|
{
|
||||||
text: "Marker entfernen",
|
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) => {
|
polyline.on("mouseover", (e) => {
|
||||||
// Optional: Visualisiere, dass die Linie interaktiv ist
|
// Optional: Visualisiere, dass die Linie interaktiv ist
|
||||||
polyline.setStyle({ color: "blue" });
|
polyline.setStyle({ color: "blue", weight: 10 });
|
||||||
});
|
});
|
||||||
|
|
||||||
polyline.on("mouseout", (e) => {
|
polyline.on("mouseout", (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user