2024-11-23 16:41:04 +00:00
|
|
|
module Model exposing
|
|
|
|
(
|
|
|
|
Model
|
|
|
|
, TrackState(..)
|
2024-11-27 00:14:07 +00:00
|
|
|
, DragState(..)
|
2024-11-23 16:41:04 +00:00
|
|
|
)
|
2024-11-24 21:07:01 +00:00
|
|
|
import TileMap exposing (ZoomLevel, Coord)
|
2024-11-23 16:41:04 +00:00
|
|
|
import Point exposing (Point)
|
|
|
|
|
2024-11-27 00:14:07 +00:00
|
|
|
type DragState =
|
|
|
|
DragMap (Int, Int) Coord
|
|
|
|
| DragGraph (Int, Int) Float
|
|
|
|
| DragLeftMark (Int, Int) (Float, Float)
|
|
|
|
| DragRightMark (Int, Int) Float
|
2024-11-23 16:41:04 +00:00
|
|
|
|
|
|
|
type TrackState = Empty | Loading | Failure String | Present (List Point)
|
|
|
|
|
|
|
|
type alias Model =
|
|
|
|
{ centre: Coord
|
2024-11-24 21:07:01 +00:00
|
|
|
, zoom: ZoomLevel
|
2024-11-27 00:14:07 +00:00
|
|
|
, drag: Maybe DragState
|
2024-11-23 16:41:04 +00:00
|
|
|
, startTime : Float
|
|
|
|
, duration : Float
|
|
|
|
, markedTime : (Float, Float)
|
|
|
|
, track: TrackState }
|