mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Highlight on hover
This commit is contained in:
parent
64b141fa24
commit
3ba42dceaf
1 changed files with 16 additions and 4 deletions
|
|
@ -214,10 +214,22 @@ export function addHighlightOnHover(polylineGroup, map, polylineCoordinates, use
|
|||
}
|
||||
}
|
||||
|
||||
layer.setStyle({
|
||||
weight: 8,
|
||||
opacity: 0.8,
|
||||
color: '#FFD700'
|
||||
// Apply style to all segments in the group
|
||||
polylineGroup.eachLayer((segment) => {
|
||||
if (segment instanceof L.Polyline) {
|
||||
const newStyle = {
|
||||
weight: 8,
|
||||
opacity: 0.8
|
||||
};
|
||||
|
||||
// Only change color if speed-colored routes are not enabled
|
||||
console.log("speed_colored_routes", userSettings.speed_colored_routes);
|
||||
if (!userSettings.speed_colored_routes) {
|
||||
newStyle.color = "yellow"
|
||||
}
|
||||
|
||||
segment.setStyle(newStyle);
|
||||
}
|
||||
});
|
||||
|
||||
startMarker.addTo(map);
|
||||
|
|
|
|||
Loading…
Reference in a new issue