contextmenu, manchmal geht manchmal nicht, Timing Problem
This commit is contained in:
19
utils/polylines/eventHandlers.js
Normal file
19
utils/polylines/eventHandlers.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// /utils/polylines/eventHandlers.js
|
||||
export function enablePolylineEvents(polylines, lineColors) {
|
||||
if (!polylines || polylines.length === 0) {
|
||||
console.warn("Keine Polylinien vorhanden oder polylines ist undefined.");
|
||||
return;
|
||||
}
|
||||
|
||||
polylines.forEach((polyline) => {
|
||||
polyline.on("mouseover", () => polyline.setStyle({ weight: 14 }));
|
||||
polyline.on("mouseout", () => polyline.setStyle({ weight: 3 }));
|
||||
});
|
||||
}
|
||||
|
||||
export function disablePolylineEvents(polylines) {
|
||||
polylines.forEach((polyline) => {
|
||||
polyline.off("mouseover");
|
||||
polyline.off("mouseout");
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user