fix: GMA Tooltip -> Kontextmenü -> "Station öffnen (Tab)" zu richtige Link verlinken

This commit is contained in:
ISA
2024-12-19 11:21:58 +01:00
parent b4243a4467
commit cb5e7cb396

View File

@@ -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");
},
},