diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm index 5368b34..0324b3d 100644 --- 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"