From 93bf7a5cac109a5a35fb7d5cd60470cdce8bbd38 Mon Sep 17 00:00:00 2001 From: ISA Date: Thu, 12 Dec 2024 09:36:50 +0100 Subject: [PATCH] =?UTF-8?q?WIP:=20neu=20Tab=20mit=20icon=20f=C3=BCr=20Tool?= =?UTF-8?q?Tip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/layers/useGmaMarkersLayer.js | 31 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hooks/layers/useGmaMarkersLayer.js b/hooks/layers/useGmaMarkersLayer.js index 0c6dd40e2..815fe0034 100644 --- a/hooks/layers/useGmaMarkersLayer.js +++ b/hooks/layers/useGmaMarkersLayer.js @@ -2,6 +2,8 @@ import { addContextMenuToMarker } from "../../utils/addContextMenuToMarker"; const useGmaMarkersLayer = (map, markers, GisStationsMeasurements, GMA, oms, isVisible) => { + const host = window.location.origin; + const url = `${host}/talas5/devices/`; useEffect(() => { if (!map || !isVisible) return; @@ -70,10 +72,25 @@ const useGmaMarkersLayer = (map, markers, GisStationsMeasurements, GMA, oms, isV menu.style.padding = "8px"; menu.style.zIndex = "1000"; - // Menüeinträge hinzufügen + // Menüeintrag mit Icon erstellen const openStation = document.createElement("div"); - openStation.textContent = "Station öffnen (Tab)"; + openStation.style.display = "flex"; + openStation.style.alignItems = "center"; openStation.style.cursor = "pointer"; + + const icon = document.createElement("img"); + icon.src = "/img/screen_new.png"; // Pfad zum Icon + icon.alt = "Icon"; + icon.style.width = "16px"; + icon.style.height = "16px"; + icon.style.marginRight = "8px"; + + const text = document.createElement("span"); + text.textContent = "Station öffnen (Tab)"; + + openStation.appendChild(icon); + openStation.appendChild(text); + openStation.onclick = () => { if (marker.options.link) { window.open(marker.options.link, "_blank"); @@ -83,18 +100,8 @@ const useGmaMarkersLayer = (map, markers, GisStationsMeasurements, GMA, oms, isV document.body.removeChild(menu); // Menü entfernen }; - const showDetails = document.createElement("div"); - showDetails.textContent = "Details anzeigen"; - showDetails.style.cursor = "pointer"; - showDetails.onclick = () => { - alert(`Details für ${area_name}`); - document.body.removeChild(menu); // Menü entfernen - }; - // Menüeinträge zum Menü hinzufügen menu.appendChild(openStation); - menu.appendChild(document.createElement("hr")); - menu.appendChild(showDetails); // Menü zum DOM hinzufügen document.body.appendChild(menu);