Recoil Statefpr polylines and Devices in process
This commit is contained in:
@@ -5,6 +5,7 @@ import "leaflet.smooth_marker_bouncing";
|
||||
import { toast } from "react-toastify";
|
||||
import * as config from "../config/config.js";
|
||||
import { disablePolylineEvents, enablePolylineEvents } from "./setupPolylines"; // Importiere die Funktion zum Deaktivieren der Polyline-Ereignisse
|
||||
import { setPolylineEventsDisabled } from "../store/atoms/polylineEventsDisabledState"; // Importiere den Recoil-Atom-Zustand
|
||||
|
||||
// Funktion zum Bestimmen der Priorität basierend auf dem Icon-Pfad
|
||||
const determinePriority = (iconPath, priorityConfig) => {
|
||||
@@ -53,14 +54,29 @@ export const createAndSetDevices = async (systemId, setMarkersFunction, GisSyste
|
||||
});
|
||||
|
||||
// Verwende das `contextmenu`-Ereignis für den Rechtsklick
|
||||
marker.on("contextmenu", function (event) {
|
||||
/* marker.on("contextmenu", function (event) {
|
||||
if (event && event.preventDefault) {
|
||||
event.preventDefault(); // Verhindert das Standard-Kontextmenü
|
||||
}
|
||||
disablePolylineEvents(window.polylines);
|
||||
this.openPopup();
|
||||
});
|
||||
*/
|
||||
marker.on("contextmenu", function (event) {
|
||||
if (event && event.preventDefault) {
|
||||
event.preventDefault(); // Verhindert das Standard-Kontextmenü
|
||||
}
|
||||
//setPolylineEventsDisabled(true);
|
||||
disablePolylineEvents(window.polylines);
|
||||
this.openPopup();
|
||||
});
|
||||
|
||||
document.addEventListener("mouseout", function (event) {
|
||||
if (event.relatedTarget === null || event.relatedTarget.nodeName === "BODY") {
|
||||
//setPolylineEventsDisabled(false);
|
||||
enablePolylineEvents(window.polylines, window.lineColors);
|
||||
}
|
||||
});
|
||||
marker.on("mouseout", function () {
|
||||
this.closePopup();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user