feat: Geräteauswahl und Anzeige beim POI-Handling auf WebService umgestellt
- setupPOIs.js angepasst: Gerätedaten (LD_Name) aus GisStationsStaticDistrict verwendet - MapComponent.js übergibt WebService-Geräte (`Points`) als gisDevices an setupPOIs - PoiUpdateModal.js nutzt LD_Name für react-select Dropdown statt name aus DB - Dropdown-Anzeige und Tooltip-Daten für POIs nun konsistent mit WebService-Geräteliste
This commit is contained in:
@@ -21,7 +21,7 @@ export const setupPOIs = async (
|
||||
toast,
|
||||
setShowPoiUpdateModal,
|
||||
setCurrentPoiData,
|
||||
deviceName,
|
||||
gisDevices,
|
||||
dispatch
|
||||
) => {
|
||||
const editMode = localStorage.getItem("editMode") === "true";
|
||||
@@ -45,9 +45,13 @@ export const setupPOIs = async (
|
||||
|
||||
for (const poi of pois) {
|
||||
try {
|
||||
// console.log("👉 poi an Modal übergeben:", poi);
|
||||
|
||||
const { latitude, longitude } = parsePoint(poi.position);
|
||||
const poiTypName = poiTypMap.get(poi.idPoiTyp) || "Unbekannt";
|
||||
const canDrag = userRights ? userRights.some(r => r.IdRight === 56) : false;
|
||||
const matchingDevice = gisDevices.find(d => d.IdLD === poi.idLD);
|
||||
const deviceLabel = matchingDevice?.LD_Name || "unbekannt";
|
||||
|
||||
// ✅ Icon korrekt über idPoi auflösen
|
||||
const iconPath = iconMap.get(poi.idPoi);
|
||||
@@ -97,7 +101,7 @@ export const setupPOIs = async (
|
||||
`
|
||||
<div class="bg-white text-gray-800 text-sm rounded-xl px-4 py-2 w-56">
|
||||
<div class="font-semibold text-blue-500 mb-1">${poi.description || "Unbekannt"}</div>
|
||||
<div class="text-gray-600 text-sm">Gerät: ${deviceName || "unbekannt"}</div>
|
||||
<div class="text-gray-600 text-sm">Gerät: ${deviceLabel || "unbekannt"}</div>
|
||||
<div class="text-gray-600 text-sm">Typ: ${poiTypName}</div>
|
||||
</div>
|
||||
`,
|
||||
@@ -111,6 +115,7 @@ export const setupPOIs = async (
|
||||
|
||||
marker.on("mouseover", function () {
|
||||
dispatch(setSelectedPoi(poi));
|
||||
dispatch(setCurrentPoi(poi));
|
||||
localStorage.setItem("lastElementType", "marker");
|
||||
localStorage.setItem("markerLink", this.options.link);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user