Version 1.0.11
fix: openInNewTab.js
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
// utils/openInNewTab.js
|
||||
|
||||
import SERVER_URL from "../config/urls";
|
||||
export function openInNewTab(e, target) {
|
||||
const BASE_URL = SERVER_URL;
|
||||
const url = new URL(window.location.origin);
|
||||
const originWithoutPort = `${url.protocol}//${url.hostname}`; // Protokoll und Hostname, ohne Port
|
||||
const BASE_URL = originWithoutPort;
|
||||
let link;
|
||||
|
||||
// Prüfen, ob der Kontextmenü-Eintrag aufgerufen wird, ohne dass ein Marker oder Polyline direkt angesprochen wird
|
||||
@@ -15,12 +16,12 @@ export function openInNewTab(e, target) {
|
||||
}
|
||||
|
||||
if (target instanceof L.Marker && target.options.link) {
|
||||
link = `${BASE_URL}${target.options.link}`;
|
||||
link = `${originWithoutPort}/talas5/devices/${target.options.link}`;
|
||||
} else if (target instanceof L.Polyline) {
|
||||
const idLD = target.options.idLD;
|
||||
console.log("idLD der Linie", idLD);
|
||||
if (idLD) {
|
||||
link = `${BASE_URL}cpl.aspx?id=${idLD}`;
|
||||
link = `${originWithoutPort}/talas5/devices/cpl.aspx?id=${idLD}`;
|
||||
} else {
|
||||
console.error("Keine gültige 'idLD' für die Linie gefunden.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user