Station öffnen (Tab) funktioniert für polylines und Stationen(Markers)

This commit is contained in:
ISA
2024-09-02 20:20:22 +02:00
parent 17a8075d73
commit 8500be8d5a
3 changed files with 27 additions and 26 deletions

View File

@@ -17,30 +17,30 @@
######################### #########################
DB_HOST=10.10.0.70 #DB_HOST=10.10.0.70
DB_USER=root
DB_PASSWORD="root#$"
DB_NAME=talas_v5
DB_PORT=3306
#########################
NEXT_PUBLIC_BASE_URL="http://10.10.0.30/talas5/devices/"
NEXT_PUBLIC_SERVER_URL="http://10.10.0.70"
NEXT_PUBLIC_PROXY_TARGET="http://10.10.0.70"
NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"
#NEXT_PUBLIC_ONLINE_TILE_LAYER="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
#########################
#DB_HOST=192.168.10.167
#DB_USER=root #DB_USER=root
#DB_PASSWORD="root#$" #DB_PASSWORD="root#$"
#DB_NAME=talas_v5 #DB_NAME=talas_v5
#DB_PORT=3306 #DB_PORT=3306
#########################
#NEXT_PUBLIC_BASE_URL="http://10.10.0.30/talas5/devices/"
#NEXT_PUBLIC_SERVER_URL="http://10.10.0.70"
#NEXT_PUBLIC_PROXY_TARGET="http://10.10.0.70"
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"
#NEXT_PUBLIC_ONLINE_TILE_LAYER="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
#########################
DB_HOST=192.168.10.167
DB_USER=root
DB_PASSWORD="root#$"
DB_NAME=talas_v5
DB_PORT=3306
######################### #########################
#URLs für den Client (clientseitig) #URLs für den Client (clientseitig)
#NEXT_PUBLIC_BASE_URL="http://192.168.10.167/talas5/devices/" NEXT_PUBLIC_BASE_URL="http://192.168.10.167/talas5/devices/"
#NEXT_PUBLIC_SERVER_URL="http://192.168.10.167" NEXT_PUBLIC_SERVER_URL="http://192.168.10.167"
#NEXT_PUBLIC_PROXY_TARGET="http://192.168.10.167" NEXT_PUBLIC_PROXY_TARGET="http://192.168.10.167"
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://192.168.10.14:3000/mapTiles/{z}/{x}/{y}.png" NEXT_PUBLIC_ONLINE_TILE_LAYER="http://192.168.10.14:3000/mapTiles/{z}/{x}/{y}.png"

View File

@@ -52,6 +52,7 @@ export const setupMarkers = async (
id: location.idPoi, id: location.idPoi,
name: location.name, name: location.name,
description: location.description, description: location.description,
link: location.link, // Marker-specific link
}).bindContextMenu({ }).bindContextMenu({
contextmenu: true, contextmenu: true,
contextmenuWidth: 140, contextmenuWidth: 140,
@@ -91,6 +92,7 @@ export const setupMarkers = async (
this.openPopup(); this.openPopup();
localStorage.setItem("lastElementType", "marker"); localStorage.setItem("lastElementType", "marker");
localStorage.setItem("markerLink", this.options.link); // Store the marker-specific link
}); });
marker.on("mouseout", function () { marker.on("mouseout", function () {

View File

@@ -45,11 +45,10 @@ export const initializeMap = (mapRef, setMap, setOms, setMenuItemAdded, addItems
console.log("Opening polyline link:", storedLink); console.log("Opening polyline link:", storedLink);
window.open(storedLink, "_blank"); window.open(storedLink, "_blank");
} }
} else if (lastElementType === "marker") { //} else if (lastElementType === "marker") {
const clickedItem = e.relatedTarget; } else {
if (clickedItem instanceof L.Marker) { const clickedMarker = e.relatedTarget;
openInNewTab(e, clickedItem); openInNewTab(e, clickedMarker);
}
} }
}, },
}, },