feat: Stützpunkte entfernen, hinzufügen und verschieben funktioniert bei Browser-Aktualisierung, zoom in Browser Local storage

This commit is contained in:
ISA
2024-07-09 06:47:44 +02:00
parent 3fbfe1c2e0
commit 467be2c106
2 changed files with 79 additions and 5 deletions

View File

@@ -39,7 +39,13 @@ import { set } from "lodash";
import { poiLayerVisibleState } from "../store/atoms/poiLayerVisible.js";
import { data } from "autoprefixer";
import plusRoundIcon from "./PlusRoundIcon.js";
import { parsePoint, handleEditPoi, insertNewMarker } from "../utlis/utils.js";
import {
parsePoint,
handleEditPoi,
insertNewMarker,
redrawPolyline,
saveLineData,
} from "../utlis/utils.js";
import circleIcon from "./CircleIcon";
import startIcon from "./StartIcon";
import endIcon from "./EndIcon";
@@ -2298,7 +2304,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
//---------------------------------------------------------
function redrawPolyline(lineData) {
/* function redrawPolyline(lineData) {
if (lineData.polyline) map.removeLayer(lineData.polyline);
lineData.polyline = L.polyline(lineData.coordinates, {
color: lineColors[lineData.idModul] || "#000000",
@@ -2319,9 +2325,9 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
lineData.polyline.on("mouseout", () => {
lineData.polyline.setStyle({ weight: 5 });
});
}
} */
function saveLineData(lineData) {
/* function saveLineData(lineData) {
fetch("/api/talas_v5_DB/gisLines/updateLineCoordinates", {
method: "POST",
headers: {
@@ -2345,7 +2351,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
.catch((error) => {
console.error("Fehler beim Speichern der Linienänderungen:", error);
});
}
} */
function updateMarkerPosition(newLatLng, lineData, marker) {
const index = lineData.coordinates.findIndex((coord) =>