Kombination für 30, Linien ausblenden, und checkbox in localStorage mergen
This commit is contained in:
36
.env.local
36
.env.local
@@ -1,17 +1,17 @@
|
|||||||
#.env.local
|
#.env.local
|
||||||
#je nach dem Mysql Server, ob localhost freigegeben ist oder die IP Adresse des Servers, manchmal die beide und manchmal nur eine
|
#je nach dem Mysql Server, ob localhost freigegeben ist oder die IP Adresse des Servers, manchmal die beide und manchmal nur eine
|
||||||
|
|
||||||
#DB_HOST=10.10.0.30
|
DB_HOST=10.10.0.30
|
||||||
#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_BASE_URL="http://10.10.0.30/talas5/devices/"
|
||||||
#NEXT_PUBLIC_SERVER_URL="http://10.10.0.30"
|
NEXT_PUBLIC_SERVER_URL="http://10.10.0.30"
|
||||||
#NEXT_PUBLIC_PROXY_TARGET="http://10.10.0.30"
|
NEXT_PUBLIC_PROXY_TARGET="http://10.10.0.30"
|
||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.30:3000/mapTiles/{z}/{x}/{y}.png"
|
NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.30:3000/mapTiles/{z}/{x}/{y}.png"
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
|
|
||||||
@@ -29,17 +29,17 @@
|
|||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"
|
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
DB_HOST=192.168.10.168
|
#DB_HOST=192.168.10.168
|
||||||
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
|
||||||
#########################
|
#########################
|
||||||
#URLs für den Client (clientseitig)
|
#URLs für den Client (clientseitig)
|
||||||
NEXT_PUBLIC_BASE_URL="http://192.168.10.168/talas5/devices/"
|
#NEXT_PUBLIC_BASE_URL="http://192.168.10.168/talas5/devices/"
|
||||||
NEXT_PUBLIC_SERVER_URL="http://192.168.10.168"
|
#NEXT_PUBLIC_SERVER_URL="http://192.168.10.168"
|
||||||
NEXT_PUBLIC_PROXY_TARGET="http://192.168.10.168"
|
#NEXT_PUBLIC_PROXY_TARGET="http://192.168.10.168"
|
||||||
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"
|
||||||
|
|
||||||
######################### online
|
######################### online
|
||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
#NEXT_PUBLIC_ONLINE_TILE_LAYER="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||||
@@ -32,43 +32,22 @@ export function enablePolylineEvents(polylines, lineColors) {
|
|||||||
// Falls Polylinien vorhanden sind, wende die Events an
|
// Falls Polylinien vorhanden sind, wende die Events an
|
||||||
polylines.forEach((polyline) => {
|
polylines.forEach((polyline) => {
|
||||||
polyline.on("mouseover", (e) => {
|
polyline.on("mouseover", (e) => {
|
||||||
|
//console.log("Mouseover on polyline", polyline.options);
|
||||||
polyline.setStyle({ weight: 14 });
|
polyline.setStyle({ weight: 14 });
|
||||||
const link = `${process.env.NEXT_PUBLIC_BASE_URL}cpl.aspx?id=${polyline.options.idLD}`;
|
const link = `${process.env.NEXT_PUBLIC_BASE_URL}cpl.aspx?id=${polyline.options.idLD}`;
|
||||||
// Verwende den Link oder speichere ihn, falls nötig
|
//localStorage.setItem("lastElementType", "polyline");
|
||||||
|
//localStorage.setItem("polylineLink", link);
|
||||||
});
|
});
|
||||||
|
|
||||||
polyline.on("mouseout", (e) => {
|
polyline.on("mouseout", (e) => {
|
||||||
|
//console.log("Mouseout from polyline", polyline.options);
|
||||||
polyline.setStyle({ weight: 3 });
|
polyline.setStyle({ weight: 3 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funktion zum Schließen des Kontextmenüs vor dem Intervall
|
export const setupPolylines = (map, linePositions, lineColors, tooltipContents, setNewCoords, tempMarker, currentZoom, currentCenter, polylineVisible) => {
|
||||||
const closeContextMenuBeforeInterval = (map) => {
|
polylineVisible = localStorage.getItem("polylineVisible") === "true";
|
||||||
if (map && map.contextmenu && map.contextmenu.isVisible && map.contextmenu.isVisible()) {
|
|
||||||
console.log("Schließe Kontextmenü 2 Sekunden vor dem Intervall");
|
|
||||||
map.contextmenu.hide();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Zeitintervall mit Schließen des Kontextmenüs 2 Sekunden vorher
|
|
||||||
export const startIntervalWithContextMenuHandling = (map) => {
|
|
||||||
setInterval(() => {
|
|
||||||
remainingTime = 20; // Zeit zurücksetzen für den neuen Durchlauf
|
|
||||||
// Kontextmenü überwachen
|
|
||||||
monitorContextMenu(map);
|
|
||||||
|
|
||||||
// Schließe das Kontextmenü 2 Sekunden vor dem API-Aufruf
|
|
||||||
setTimeout(() => {
|
|
||||||
closeContextMenuBeforeInterval(map);
|
|
||||||
}, 18000); // 18 Sekunden warten, dann schließen
|
|
||||||
|
|
||||||
// API-Aufruf oder Logik, die alle 20 Sekunden ausgeführt wird
|
|
||||||
fetchData();
|
|
||||||
}, 20000); // 20-Sekunden-Intervall
|
|
||||||
};
|
|
||||||
|
|
||||||
export const setupPolylines = (map, linePositions, lineColors, tooltipContents, setNewCoords, tempMarker, polylineVisible) => {
|
|
||||||
if (!polylineVisible) {
|
if (!polylineVisible) {
|
||||||
// Entferne alle Polylinien, wenn sie ausgeblendet werden sollen
|
// Entferne alle Polylinien, wenn sie ausgeblendet werden sollen
|
||||||
if (window.polylines) {
|
if (window.polylines) {
|
||||||
@@ -265,12 +244,6 @@ export const setupPolylines = (map, linePositions, lineColors, tooltipContents,
|
|||||||
console.log("Link der Linie (via Rechtsklick):", link);
|
console.log("Link der Linie (via Rechtsklick):", link);
|
||||||
localStorage.setItem("lastElementType", "polyline");
|
localStorage.setItem("lastElementType", "polyline");
|
||||||
localStorage.setItem("polylineLink", link);
|
localStorage.setItem("polylineLink", link);
|
||||||
if (editMode) {
|
|
||||||
polyline.bindContextMenu({
|
|
||||||
contextmenuItems: polyline.options.contextmenuItems,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
closeContextMenuBeforeInterval(map);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
polylines.push(polyline);
|
polylines.push(polyline);
|
||||||
|
|||||||
Reference in New Issue
Block a user