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) {