2024-11-23 16:41:04 +00:00
|
|
|
module Model exposing
|
|
|
|
(
|
|
|
|
Model
|
|
|
|
, TrackState(..)
|
|
|
|
, Drag(..)
|
|
|
|
, DragTarget(..)
|
|
|
|
)
|
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)
|
|
|
|
|
|
|
|
type DragTarget = Map | Graph | StartMark | EndMark | NoTarget
|
|
|
|
|
|
|
|
type Drag
|
|
|
|
= None
|
|
|
|
| Dragging DragTarget (Int, Int) (Int, Int)
|
|
|
|
|
|
|
|
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-23 16:41:04 +00:00
|
|
|
, drag: Drag
|
|
|
|
, startTime : Float
|
|
|
|
, duration : Float
|
|
|
|
, markedTime : (Float, Float)
|
|
|
|
, track: TrackState }
|