Station öffnen (Tab) funktioniert für polylines und Stationen(Markers)
This commit is contained in:
@@ -52,6 +52,7 @@ export const setupMarkers = async (
|
||||
id: location.idPoi,
|
||||
name: location.name,
|
||||
description: location.description,
|
||||
link: location.link, // Marker-specific link
|
||||
}).bindContextMenu({
|
||||
contextmenu: true,
|
||||
contextmenuWidth: 140,
|
||||
@@ -91,6 +92,7 @@ export const setupMarkers = async (
|
||||
this.openPopup();
|
||||
|
||||
localStorage.setItem("lastElementType", "marker");
|
||||
localStorage.setItem("markerLink", this.options.link); // Store the marker-specific link
|
||||
});
|
||||
|
||||
marker.on("mouseout", function () {
|
||||
|
||||
@@ -45,11 +45,10 @@ export const initializeMap = (mapRef, setMap, setOms, setMenuItemAdded, addItems
|
||||
console.log("Opening polyline link:", storedLink);
|
||||
window.open(storedLink, "_blank");
|
||||
}
|
||||
} else if (lastElementType === "marker") {
|
||||
const clickedItem = e.relatedTarget;
|
||||
if (clickedItem instanceof L.Marker) {
|
||||
openInNewTab(e, clickedItem);
|
||||
}
|
||||
//} else if (lastElementType === "marker") {
|
||||
} else {
|
||||
const clickedMarker = e.relatedTarget;
|
||||
openInNewTab(e, clickedMarker);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user