javascript - How to stop a scheduled ontick event on Cesium -
i have 2 buttons on code add , delete primitives when clicked. on other hand, have event listener ontick
method input active primitive , variable indicating index, , supposed used primitive particular index event.
when did debugging saw although input argument updated parameter used event listener not updated. , got error object destroyed.
do know how can update these arguments or stop scheduled events?
ontick cesium event addeventlistener function returns hook unsubscribe. call return value, later, when want end subscription event.
var unsubscribe = viewer.clock.ontick.addeventlistener(mycallback); // ... later ... // stop ontick callback. unsubscribe();
Comments
Post a Comment