fix: GMA Tooltip -> Kontextmenü -> "Station öffnen (Tab)" zu richtige Link verlinken
This commit is contained in:
@@ -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");
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user