Class: TimeFlowControl

SuperMap.TimeFlowControl

The TimeFlowControl class.

new SuperMap.TimeFlowControl(callback, options)

TimeFlowControl.js, line 4

This class is only responsible for time control. The specific execution needs to be implemented within the callback function when the user initialized.
If setting the start time is 1000, the end time is 2000, the step length is 1, then it will change every 1 years (which can be modified by setSpeed). From 1000 to 2000, the default will be 1 times per second, which is modified by setFrequency.

Name Type Description
callback function

Callback function for each refresh. Required. The specific effect need the user to implement it in this callback function.

options Object

The open optional attributes of this class.

Name Type Default Description
speed number 1 optional

Step length (unit MS). Not less than 0 (indicating that the interval between each refresh data is 1ms).

frequency number 1000 optional

Refresh frequency (unit MS).

startTime number 0 optional

The start time, must be a number, and less than or equal to endTime. If it is not be set, the initialization is 0, and it is recommended to be set.

endTime number optional

The end time, must be a number, and more than or equal to startTime. If it is not be set, the initialization is set at the current time, and it is recommended to be set.

repeat boolean true optional

Whether or not to repeat the cycle.

reverse boolean false optional

Whether or not it is reverse.

Extends

Members

callbackfunction

Callback function for each refresh.

currentTimenumber

Record the time, that is, the time that the current frame is running.

endTimenumber

The ending time of the record must be a number, If it is not set up, the initialization is set at the current time, and it is recommended to set up.

frequencynumber

Refresh rate (in ms), the interval at which the server is refreshed.

Default Value:
1000

oldTimenumber

Record time of the last frame. That is the time to run before.

repeatboolean

Whether or not to repeat the cycle.

Default Value:
true

reverseboolean

Whether or not it is reverse.

runningboolean

Record whether the current is running.

speednumber

Speed. Can't less than 0(Express the interval between the data rendered for each frame is 1).

Default Value:
1

startTimenumber

The starting time of the record must be a number, If it is not set up, the initialization is 0, and it is recommended to set up.

Methods

inherited destroy()

TimeControlBase.js, line 404

destroy animator object, release resources.

inherited destroy()

TimeControlBase.js, line 404

destroy animator object, release resources.

inherited getCurrentTime(){number}

TimeControlBase.js, line 344

Get current time.

Returns:
Type Description
number Return to the current time.

inherited getEndTime(){number}

TimeControlBase.js, line 314

Get the endTime.

Returns:
Type Description
number Return to the current endTime.

inherited getFrequency(){number}

TimeControlBase.js, line 248

Get frequency.

Returns:
Type Description
number Return to the current frequency.

inherited getRepeat(){boolean}

TimeControlBase.js, line 364

Get whether to repeat the cycle.

Returns:
Type Description
boolean Return to whether to repeat the cycle.

inherited getReverse(){boolean}

TimeControlBase.js, line 384

Get whether or not it is reverse.

Returns:
Type Description
boolean The true meaning is running, and the false meaning is not running .

inherited getRunning(){boolean}

TimeControlBase.js, line 394

Get the running state.

Returns:
Type Description
boolean The true meaning is running, and the false meaning is not running.

inherited getSpeed(){number}

TimeControlBase.js, line 222

Get speed.

Returns:
Type Description
number Return to the current speed.

inherited getStartTime(){number}

TimeControlBase.js, line 281

Get startTime.

Returns:
Type Description
number Return to the current startTime.

inherited pause()

TimeControlBase.js, line 164

Pause.

inherited setCurrentTime(currentTime){boolean}

TimeControlBase.js, line 324

Set current time.

Name Type Description
currentTime number

The current time that needs to be set.

Returns:
Type Description
boolean True meaning set success, false meaning set failed.

inherited setEndTime(endTime){boolean}

TimeControlBase.js, line 291

Set endTime. When the setting is complete, if the current time is greater than the endTime, it starts from the start time.

Name Type Description
endTime number

The end time that needs to be set.

Returns:
Type Description
boolean True meaning set success, false meaning set failed .(it's failure when the endTime less than the start time).

inherited setFrequency(frequency){boolean}

TimeControlBase.js, line 232

Set frequency

Name Type Default Description
frequency number 1000 optional

Refresh frequency. The unit is ms.

Returns:
Type Description
boolean True meaning set success, false meaning set failed (it's failure when the frequency less than 0).

inherited setRepeat(repeat)

TimeControlBase.js, line 354

Set whether or not it is reverse.

Name Type Default Description
repeat boolean true optional

Whether or not it is reverse.

inherited setReverse(reverse)

TimeControlBase.js, line 374

Set whether or not it is reverse.

Name Type Default Description
reverse boolean false optional

Whether or not it is reverse.

inherited setSpeed(speed){boolean}

TimeControlBase.js, line 206

Set speed.

Name Type Default Description
speed number 1 optional

Speed, Can't less than 0.

Returns:
Type Description
boolean True meaning set success, false meaning set failed(it's failure when the speed less than 0).

inherited setStartTime(startTime){boolean}

TimeControlBase.js, line 258

Set start time. When the setting is completed, if the current time is less than the start time, it starts from the start time.

Name Type Description
startTime number

Start time that needs to be set.

Returns:
Type Description
boolean True meaning set success, false meaning set failed (it's failure when the startTime greater than the end time).

inherited start()

TimeControlBase.js, line 149

Start.

inherited start()

TimeControlBase.js, line 149

Start.

inherited stop()

TimeControlBase.js, line 175

Stop. Return to start state after stopping

inherited stop()

TimeControlBase.js, line 175

Stop. Return to start state after stopping

tick()

TimeFlowControl.js, line 128

Timed refresh.

inherited toggle()

TimeControlBase.js, line 191

Switch switching, Switching is the start and pause.

update()

TimeFlowControl.js, line 140

inherited updateOptions(options)

TimeControlBase.js, line 111
Name Type Description
options Object

Set optional parameters of the parameters. Set step length, refresh frequency, startTime, endTime, repeat, reverse.

inherited updateOptions(options)

TimeControlBase.js, line 111
Name Type Description
options Object

Set optional parameters of the parameters. Set step length, refresh frequency, startTime, endTime, repeat, reverse.