aboutsummaryrefslogtreecommitdiff
path: root/mavigator-dashboard/src/main/scala/mavigator/dashboard/ui/instruments/Compass.scala
blob: 117c7a358fc6350c3c7310dc9a3b9a5069fdb169 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package mavigator.dashboard.ui.instruments

import org.scalajs.dom.html
import rx._
import mavigator.util.Environment

class Compass(val value: Rx[Double])(implicit env: Environment) extends SvgInstrument[Double] {
  import SvgInstrument._
  
  lazy val element = svgObject("compass")
  lazy val plate = part("heading")
  lazy val moveable = Seq(plate)
  
  protected def update(heading: Double) = {
    rotate(plate, heading)
  }
}