ClockViewModel - Cesium Documentation

# ClockViewModel

#### new ClockViewModel(clock)

  A view model which exposes a `Clock` for user interfaces.

  Name | Type | Description
  --- | --- | ---
  `clock` | Clock | optional The clock object wrapped by this view model, if undefined a new instance will be created.

  ##### See:

  - Clock
  Source: Widgets/ClockViewModel.js, line 29

### Members

#### canAnimate :Boolean

  Gets or sets whether or not `Clock.tick` can advance time. This could be false if data is being buffered, for example. The clock will only tick when both `canAnimate` and `shouldAnimate` are true. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 167

#### clock :Clock

  Gets the underlying Clock.
  Source: Widgets/ClockViewModel.js, line 202

#### clockRange :ClockRange

  Gets or sets how tick should behave when `startTime` or `stopTime` is reached. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 148

#### clockStep :ClockStep

  Gets or sets whether calls to `Clock.tick` are frame dependent or system clock dependent. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 128

#### currentTime :JulianDate

  Gets or sets the current time. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 90

#### multiplier :Number

  Gets or sets how much time advances when tick is called, negative values allow for advancing backwards. If `clockStep` is set to ClockStep.TICK_DEPENDENT this is the number of seconds to advance. If `clockStep` is set to ClockStep.SYSTEM_CLOCK_MULTIPLIER this value is multiplied by the elapsed system time since the last call to tick. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 108

#### shouldAnimate :Boolean

  Gets or sets whether or not `Clock.tick` should attempt to advance time. The clock will only tick when both `canAnimate` and `shouldAnimate` are true. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 185

#### startTime :JulianDate

  Gets or sets the start time of the clock. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 56

#### stopTime :JulianDate

  Gets or sets the stop time of the clock. This property is observable.
  Default Value: `undefined`
  Source: Widgets/ClockViewModel.js, line 73

#### systemTime :JulianDate

  Gets the current system time. This property is observable.
  Default Value: `JulianDate()`
  Source: Widgets/ClockViewModel.js, line 46

### Methods

#### destroy()

  Destroys the view model. Should be called to properly clean up the view model when it is no longer needed.
  Source: Widgets/ClockViewModel.js, line 248

#### isDestroyed() → Boolean

  ##### Returns:

  true if the object has been destroyed, false otherwise.
  Source: Widgets/ClockViewModel.js, line 240

#### synchronize()

  Updates the view model with the contents of the underlying clock. Can be called to force an update of the viewModel if the underlying clock has changed and `Clock.tick` has not yet been called.
  Source: Widgets/ClockViewModel.js, line 214