feat: Kontextmenü-Link für Marker, Linien und GMA vereinheitlicht – openInNewTab verwendet, Port entfernt, /devices/ ergänzt
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// utils/contextMenuUtils.js
|
||||
import { BASE_URL } from "../config/urls";
|
||||
import { BASE_URL } from "../config/paths";
|
||||
import { store } from "../redux/store"; // Redux-Store importieren
|
||||
import { openInNewTab } from "./openInNewTab";
|
||||
|
||||
export function addContextMenuToMarker(marker) {
|
||||
marker.unbindContextMenu(); // Entferne das Kontextmenü, um Duplikate zu vermeiden
|
||||
@@ -30,15 +31,3 @@ export function addContextMenuToMarker(marker) {
|
||||
contextmenuItems: contextMenuItems,
|
||||
});
|
||||
}
|
||||
|
||||
// Funktion zum Öffnen in einem neuen Tab
|
||||
export function openInNewTab(e, marker) {
|
||||
const baseUrl = BASE_URL;
|
||||
console.log("baseUrl:", baseUrl);
|
||||
|
||||
if (marker && marker.options && marker.options.link) {
|
||||
window.open(baseUrl + marker.options.link, "_blank");
|
||||
} else {
|
||||
console.error("Fehler: Marker hat keine gültige 'link' Eigenschaft");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user