highlight selection on map

This commit is contained in:
Daniel Barlow 2024-11-27 18:43:56 +00:00
parent c294add7e2
commit 0b1aa29f41

View File

@ -461,6 +461,17 @@ trackView leftedge topedge zoom selection points =
in (String.fromInt x_) ++ ", " ++ in (String.fromInt x_) ++ ", " ++
(String.fromInt y_) ++ ", " (String.fromInt y_) ++ ", "
line = String.concat (List.map plot points) line = String.concat (List.map plot points)
selectedPoints =
Maybe.map
(\(s, e) ->
List.filter (\p -> p.time >= s && p.time <= e) points)
selection
selectionLine =
case selectedPoints of
Just spoints ->
polyline [ S.points (String.concat (List.map plot spoints)) ] []
Nothing -> g [] []
in in
svg svg
[ H.style "width" "100%" [ H.style "width" "100%"
@ -470,13 +481,15 @@ trackView leftedge topedge zoom selection points =
[ g [ g
[ fill "none" [ fill "none"
, stroke "blue" , stroke "blue"
, strokeWidth "7" , strokeWidth "5"
, strokeOpacity "0.5"] , strokeOpacity "0.5"]
[ [
polyline polyline
[ fill "none" [ fill "none"
, S.points line , S.points line
] [] ] []
, g [ stroke "red", strokeWidth "7", strokeOpacity "0.9" ]
[ selectionLine ]
] ]
] ]