contexmenu handle in MapComponent wegen error contextmenu nicht vorhanden
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user