feat:Linien Mouse over polyline.setStyle
This commit is contained in:
@@ -1944,10 +1944,9 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
updatedPolyline.on("mouseover", () => {
|
||||
updatedPolyline.setStyle({ weight: 10 });
|
||||
updatedPolyline.bringToFront();
|
||||
console.log("Mouse over");
|
||||
});
|
||||
updatedPolyline.on("mouseout", () => {
|
||||
updatedPolyline.setStyle({ weight: 5 });
|
||||
updatedPolyline.setStyle({ weight: 3 });
|
||||
console.log("Mouse out");
|
||||
});
|
||||
|
||||
@@ -2045,10 +2044,14 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
|
||||
polyline.on("mouseover", (e) => {
|
||||
// Optional: Visualisiere, dass die Linie interaktiv ist
|
||||
polyline.setStyle({ color: "blue", weight: 10 });
|
||||
//polyline.setStyle({ color: "blue", weight: 10 });
|
||||
polyline.setStyle({ weight: 10 });
|
||||
});
|
||||
|
||||
polyline.on("mouseout", (e) => {
|
||||
//polyline.setStyle({ color: "blue", weight: 3 });
|
||||
polyline.setStyle({ weight: 3 });
|
||||
|
||||
// Setze die ursprüngliche Farbe zurück
|
||||
polyline.setStyle({ color: lineColors[lineData.idModul] || "#000000" });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user