From 097773553a62ba666968649363ac7932e96d52d4 Mon Sep 17 00:00:00 2001 From: ISA Date: Mon, 24 Jun 2024 13:11:08 +0200 Subject: [PATCH] =?UTF-8?q?edit:=20Ger=C3=A4t=20dropdown=20men=C3=BC=20in?= =?UTF-8?q?=20modal=20=20POi=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MapComponent.js | 11 +++++++++-- components/ShowAddStationPopup.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/MapComponent.js b/components/MapComponent.js index 89730a6d2..db91a8952 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -1231,6 +1231,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { const { latitude, longitude } = parsePoint(location.position); const poiTypName = poiTypMap.get(location.idPoiTyp) || "Unbekannt"; const deviceName = await fetchDeviceNameById(location.idLD); + console.log("deviceName:", deviceName); // Das ist in Modal POI hinzufügen const canDrag = userRights ? userRights.includes(56) : false; const matchingIcon = poiData.find( @@ -2233,12 +2234,17 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { return marker; }); - // Erstellen der Polyline + // Erstellen der Polyline und Einrichten eines Tooltips const polyline = L.polyline(lineData.coordinates, { color: lineColors[lineData.idModul] || "#000000", }).addTo(map); - // Einrichten der mouseover- und mouseout-Event-Handler + // Hinzufügen eines Tooltips + polyline.bindTooltip("Informationen oder Name der Linie", { + permanent: false, // true, wenn Sie möchten, dass der Tooltip immer sichtbar ist + direction: "auto", // Kann 'right', 'left', 'top' oder 'bottom' sein + }); + polyline.on("mouseover", () => { polyline.setStyle({ weight: 8 }); polyline.bringToFront(); @@ -2254,6 +2260,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { setMarkers(newMarkers); setPolylines(newPolylines); }, [map, linePositions, lineColors]); + //--------------------------------------------------------- //--------------------------------------------------------- diff --git a/components/ShowAddStationPopup.js b/components/ShowAddStationPopup.js index 09bd1d87d..a303772fe 100644 --- a/components/ShowAddStationPopup.js +++ b/components/ShowAddStationPopup.js @@ -64,7 +64,7 @@ const ShowAddStationPopup = ({ onClose, map, latlng }) => { // Funktion zum Abrufen der Daten von der API -> DB talas_v5.location_device const fetchData = async () => { try { - const response = await fetch("/api/talas_v5/location_device"); + const response = await fetch("/api/talas5/location_device"); const data = await response.json(); setLocationDeviceData(data); if (data.length > 0) {