pass zoom to trackView

This commit is contained in:
Daniel Barlow 2024-11-10 20:58:14 +00:00
parent dc46300f05
commit 1346971962

View File

@ -216,10 +216,10 @@ tileImg zoom tilenumber = img [ width 256,
height 256, height 256,
src (tileUrl tilenumber zoom) ] [] src (tileUrl tilenumber zoom) ] []
trackView : List Point -> Int -> Int -> Svg Msg trackView : List Point -> Int -> Int -> Zoom -> Svg Msg
trackView points leftedge topedge = trackView points leftedge topedge zoom =
let plot p = let plot p =
let (x, y) = pixelFromCoord (toCoord p.pos.lat p.pos.lon) 13 let (x, y) = pixelFromCoord (toCoord p.pos.lat p.pos.lon) zoom
x_ = x - leftedge x_ = x - leftedge
y_ = y - topedge y_ = y - topedge
in (String.fromInt x_) ++ ", " ++ in (String.fromInt x_) ++ ", " ++
@ -269,7 +269,7 @@ canvas centre zoom width height track =
ys = List.range mintile.y maxtile.y ys = List.range mintile.y maxtile.y
epos e = Tuple.mapBoth floor floor e.pointer.clientPos epos e = Tuple.mapBoth floor floor e.pointer.clientPos
tv = case track of tv = case track of
Present t -> trackView t leftedge topedge Present t -> trackView t leftedge topedge zoom
Failure f -> Debug.log f (div [] [ text "failure", text f]) Failure f -> Debug.log f (div [] [ text "failure", text f])
Loading -> div [] [text "loading"] Loading -> div [] [text "loading"]
Empty -> div [] [text "no points"] Empty -> div [] [text "no points"]