Seite neu laden wenn die Fehler kommt , aber wird kurz angezeigt
This commit is contained in:
@@ -303,21 +303,27 @@ export const setupPolylines = (map, linePositions, lineColors, tooltipContents,
|
||||
|
||||
polyline.setStyle({ weight: 14 });
|
||||
const link = `${process.env.NEXT_PUBLIC_BASE_URL}cpl.aspx?ver=35&kue=24&id=${lineData.idLD}`;
|
||||
console.log("Link der Linie:", link);
|
||||
// console.log("Link der Linie:", link);
|
||||
});
|
||||
|
||||
polyline.on("mouseout", (e) => {
|
||||
polyline.setStyle({ weight: 3 });
|
||||
console.log("🚀 Maus hat die Polyline verlassen - Warten auf Klick außerhalb des Menüs.");
|
||||
// console.log("🚀 Maus hat die Polyline verlassen - Warten auf Klick außerhalb des Menüs.");
|
||||
|
||||
document.addEventListener("click", function handleOutsideClick(event) {
|
||||
if (!event.target.closest(".leaflet-contextmenu")) {
|
||||
console.log("🛑 Klick außerhalb des Kontextmenüs erkannt - Schließe Menü.");
|
||||
store.dispatch(closePolylineContextMenu());
|
||||
store.dispatch(forceCloseContextMenu());
|
||||
|
||||
if (window.map?.contextmenu) {
|
||||
window.map.contextmenu.hide();
|
||||
try {
|
||||
store.dispatch(closePolylineContextMenu());
|
||||
store.dispatch(forceCloseContextMenu());
|
||||
|
||||
if (window.map?.contextmenu) {
|
||||
window.map.contextmenu.hide();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("❌ Fehler beim Schließen des Kontextmenüs:", error);
|
||||
window.location.reload(); // **Seite neu laden, wenn ein Fehler auftritt**
|
||||
}
|
||||
|
||||
document.removeEventListener("click", handleOutsideClick);
|
||||
|
||||
Reference in New Issue
Block a user