feat: Marker hinzufügen und Marker entfernen in PolyLines und der currentZoom funktioniert
This commit is contained in:
@@ -20,6 +20,7 @@ export const insertNewMarker = (closestPoints, newPoint, lineData, map) => {
|
||||
// Event-Listener für das Verschieben des Markers hinzufügen
|
||||
newMarker.on("dragend", () => {
|
||||
const newCoords = newMarker.getLatLng();
|
||||
setNewCoords(newCoords);
|
||||
const newCoordinates = [...lineData.coordinates];
|
||||
newCoordinates[closestPoints[2]] = [newCoords.lat, newCoords.lng];
|
||||
lineData.coordinates = newCoordinates;
|
||||
@@ -66,8 +67,8 @@ export const handleEditPoi = (
|
||||
|
||||
export const removeMarker = (marker, lineData, currentZoom, currentCenter) => {
|
||||
// Save zoom and center to localStorage
|
||||
localStorage.setItem("mapZoom", currentZoom);
|
||||
localStorage.setItem("mapCenter", JSON.stringify(currentCenter));
|
||||
//localStorage.setItem("mapZoom", currentZoom);
|
||||
//localStorage.setItem("mapCenter", JSON.stringify(currentCenter));
|
||||
|
||||
// Find the index of the coordinate that matches the marker's position
|
||||
const index = lineData.coordinates.findIndex((coord) =>
|
||||
|
||||
Reference in New Issue
Block a user