commit dc46300f055cd9a91e8874565998adda1340ba52
parent 4bdd103bd5a7f652b6fdfc228a5fdce924b85a53
Author: Daniel Barlow <dan@telent.net>
Date: Sun, 10 Nov 2024 20:58:05 +0000
replace circles with polyline
Diffstat:
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm
@@ -8,13 +8,14 @@ import Html.Events.Extra.Pointer as Pointer
import Maybe exposing (Maybe)
import Json.Decode as D
import Http
-import Svg exposing (Svg, svg, rect, circle, g)
+import Svg exposing (Svg, svg, rect, circle, g, polyline)
import Svg.Attributes as S exposing
( viewBox
, x, y
, r, rx, ry
, cx, cy
, fill
+ , points
, stroke, strokeWidth, strokeOpacity)
@@ -221,8 +222,9 @@ trackView points leftedge topedge =
let (x, y) = pixelFromCoord (toCoord p.pos.lat p.pos.lon) 13
x_ = x - leftedge
y_ = y - topedge
- in circle [ cx (px x_), cy (px y_), r "2" ] []
- line = List.map plot points
+ in (String.fromInt x_) ++ ", " ++
+ (String.fromInt y_) ++ ", "
+ line = String.concat (List.map plot points)
in
svg
[ H.style "width" "100%"
@@ -234,8 +236,13 @@ trackView points leftedge topedge =
, stroke "blue"
, strokeWidth "7"
, strokeOpacity "0.5"]
- line
- ]
+ [
+ polyline
+ [ fill "none"
+ , S.points line
+ ] []
+ ]
+ ]
px x = String.fromInt x ++ "px"