contexmenu handle in MapComponent wegen error contextmenu nicht vorhanden

This commit is contained in:
ISA
2024-09-11 10:35:38 +02:00
parent fdd8f13a3a
commit a43fbff4f8
3 changed files with 40 additions and 39 deletions

View File

@@ -655,6 +655,20 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
// Setze die Karteninstanz in den Recoil-Atom
}
}, [map]);
//--------------------------------------------
// contextmenü Error "Contextmenu ist nicht vorhanden"
useEffect(() => {
if (map) {
// Überprüfe, ob die Karte und das Contextmenu existieren
if (map.contextmenu) {
console.log("Contextmenu ist vorhanden");
// Hier kannst du deine Logik für das Contextmenu hinzufügen
map.contextmenu.hide(); // Beispiel: Contextmenu verstecken
} else {
console.warn("Contextmenu ist nicht vorhanden");
}
}
}, [map]);
return (
<>