commit 0b1aa29f4154cec7a01fe24ff713dfd08a69e480
parent c294add7e24842ddc3a67b98789ecac80a1eeb84
Author: Daniel Barlow <dan@telent.net>
Date: Wed, 27 Nov 2024 18:43:56 +0000
highlight selection on map
Diffstat:
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm
@@ -461,6 +461,17 @@ trackView leftedge topedge zoom selection points =
in (String.fromInt x_) ++ ", " ++
(String.fromInt y_) ++ ", "
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
svg
[ H.style "width" "100%"
@@ -470,13 +481,15 @@ trackView leftedge topedge zoom selection points =
[ g
[ fill "none"
, stroke "blue"
- , strokeWidth "7"
+ , strokeWidth "5"
, strokeOpacity "0.5"]
[
polyline
[ fill "none"
- , S.points line
+ , S.points line
] []
+ , g [ stroke "red", strokeWidth "7", strokeOpacity "0.9" ]
+ [ selectionLine ]
]
]