TimeSlider Wait for Layers to Load

555
1
07-25-2013 09:13 AM
deleted-user-4RbHy6ryQ4a8
New Contributor III
Currently, the TimeSlider does not wait for layers to load before advancing.  Besides setting a large thumbMovingRate, is there a way to prevent advancement before all layers have loaded?
0 Kudos
1 Reply
deleted-user-4RbHy6ryQ4a8
New Contributor III
Here was my solution.  When the map starts loading, set the thumbMovingRate high, when the map is done loading, return thumbMovingRate to normal:

        if (this._isVisible && this._timeSlider.playing){
            if (!this._playShortCircuited){
                this._timeSlider.setThumbMovingRate(999999999);

                var self = this;
                this._playShortCircuitStartSignal = this._esriMap.on('update-start', function(){
                    self._timeSlider.setThumbMovingRate(999999999);
                });
                this._playShortCircuitEndSignal = this._esriMap.on('update-end', function(){
                    self._timeSlider.setThumbMovingRate(self._thumbMovingRate);
                });

                this._playShortCircuited = true;
            }
        } else {
            if (this._playShortCircuited){
                this._timeSlider.setThumbMovingRate(this._thumbMovingRate);
                this._playShortCircuitEndSignal.remove();
                this._playShortCircuitStartSignal.remove();
                this._playShortCircuitEndSignal = null;
                this._playShortCircuitStartSignal = null;
                this._playShortCircuited = false;
            }
        }
0 Kudos