From cb5e7cb39606377f5191a8c24da831db17f49713 Mon Sep 17 00:00:00 2001 From: ISA Date: Thu, 19 Dec 2024 11:21:58 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20GMA=20Tooltip=20->=20Kontextmen=C3=BC=20?= =?UTF-8?q?->=20"Station=20=C3=B6ffnen=20(Tab)"=20zu=20richtige=20Link=20v?= =?UTF-8?q?erlinken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/layers/useGmaMarkersLayer.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hooks/layers/useGmaMarkersLayer.js b/hooks/layers/useGmaMarkersLayer.js index 76aff836b..3cf2d12a4 100644 --- a/hooks/layers/useGmaMarkersLayer.js +++ b/hooks/layers/useGmaMarkersLayer.js @@ -1,7 +1,8 @@ import { useEffect } from "react"; // [x]: 1- Bei GMA Datenfeld Rechtsklick „Station öffnen“ funktioniert nicht. //FIXME: Link zu /talas5/devices/ wird nicht korrekt erstellt. -//BUG: Add a comment + +// BUG: GMA Tooltip openInNewTab falsche brauche Refactoring zu richtige link mit .../talas5/devices/... const useGmaMarkersLayer = (map, markers, GisStationsMeasurements, GMA, oms, isVisible) => { let currentMenu = null; // Variable für das aktuelle Kontextmenü @@ -90,7 +91,12 @@ const useGmaMarkersLayer = (map, markers, GisStationsMeasurements, GMA, oms, isV text: "Station öffnen (Tab)", icon: "/img/screen_new.png", callback: () => { - const fullUrl = marker.options.link || "http://example.com"; + //hostname without port + const hostname = window.location.hostname; + const port = 80; + const correctUrl = `http://${hostname}:${port}/talas5/devices/${marker.options.link}`; + const fullUrl = correctUrl || "http://example.com"; + console.log(fullUrl); window.open(fullUrl, "_blank"); }, },