I'm writing a custom layer in order to have animated circles. I'm having trouble understanding how the TimeDimension.Layer class actually works. I thought that the mechanism was the following:
_onNewTimeLoading(ev) runs to prepare for the next frame.
At the end of _onNewTimeLoading(ev), it fires "timeload" and sets a variable like this._currentTime
isReady(time) will test if time == this._currentTime
_update() is triggered by the "timeload" event from _onNewTimeLoading() and changes the _currentLayer
But when I add logging to these functions. I don't see what I expect as the times out of step and the times from onNewTimeLoading get far in advance of the time shown on the time controller.
Should I instead be
Using _onNewTimeLoading to create a cache of layers or parameters for all requested times.
Using isReady(time) to test if the layer for that time exists.
Using update to load from the cache the layer for the time retrieved from timeDimension.getCurrentTime()
But where and when should the timeload event be fired if there is no direct link between onNewTimeLoading and update
I'm writing a custom layer in order to have animated circles. I'm having trouble understanding how the
TimeDimension.Layer
class actually works. I thought that the mechanism was the following:_onNewTimeLoading(ev)
runs to prepare for the next frame._onNewTimeLoading(ev)
, it fires "timeload" and sets a variable likethis._currentTime
isReady(time)
will test iftime == this._currentTime
_update()
is triggered by the "timeload" event from_onNewTimeLoading()
and changes the_currentLayer
But when I add logging to these functions. I don't see what I expect as the times out of step and the times from
onNewTimeLoading
get far in advance of the time shown on the time controller.Should I instead be Using
_onNewTimeLoading
to create a cache of layers or parameters for all requested times. UsingisReady(time)
to test if the layer for that time exists. Usingupdate
to load from the cache the layer for the time retrieved fromtimeDimension.getCurrentTime()
But where and when should the
timeload
event be fired if there is no direct link betweenonNewTimeLoading
andupdate