From 8500be8d5a4adcebd44fd051270a0d5080eef5ee Mon Sep 17 00:00:00 2001 From: ISA Date: Mon, 2 Sep 2024 20:20:22 +0200 Subject: [PATCH] =?UTF-8?q?Station=20=C3=B6ffnen=20(Tab)=20funktioniert=20?= =?UTF-8?q?f=C3=BCr=20polylines=20und=20Stationen(Markers)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local | 42 +++++++++++++++++++------------------- utils/mapFeatures.js | 2 ++ utils/mapInitialization.js | 9 ++++---- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.env.local b/.env.local index bda81a792..96139ffad 100644 --- a/.env.local +++ b/.env.local @@ -17,30 +17,30 @@ ######################### -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_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_PASSWORD="root#$" +DB_NAME=talas_v5 +DB_PORT=3306 ######################### #URLs für den Client (clientseitig) -#NEXT_PUBLIC_BASE_URL="http://192.168.10.167/talas5/devices/" -#NEXT_PUBLIC_SERVER_URL="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_BASE_URL="http://192.168.10.167/talas5/devices/" +NEXT_PUBLIC_SERVER_URL="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" diff --git a/utils/mapFeatures.js b/utils/mapFeatures.js index 89006586c..1d5e6a539 100644 --- a/utils/mapFeatures.js +++ b/utils/mapFeatures.js @@ -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 () { diff --git a/utils/mapInitialization.js b/utils/mapInitialization.js index 5ec1d6030..f4c0b5946 100644 --- a/utils/mapInitialization.js +++ b/utils/mapInitialization.js @@ -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); } }, },