Select to view content in your preferred language

Time Slider Widget Customization - WAB Developers

1504
2
Jump to solution
06-21-2017 08:26 AM
JohnMcEwen__GISP
Regular Contributor

I would like to alter the TS so that when the web app starts, the widget is already 1) playing and 2) moving at 2x speed. the default is not playing and when you do click the play button it runs at 1x speed.

I'm not a developer, but I know enough to poke around in the widget files and Googled, but I have not found anything that indicates what I could change to achieve this. HELP!?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

John,

   In the timeslider Widget.js find the showTimeSlider function and add lines 9 and 10:

      showTimeSlider: function() {
        html.setStyle(this.noTimeContentNode, 'display', 'none');
        this.createTimeSlider().then(lang.hitch(this, function() {
          html.setStyle(this.timeContentNode, 'display', 'block');
          html.addClass(this.domNode, 'show-time-slider');

          this._adaptResponsive();

          this.timeSlider.setThumbMovingRate(2000);
          this.timeSlider.play();

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

John,

   In the timeslider Widget.js find the showTimeSlider function and add lines 9 and 10:

      showTimeSlider: function() {
        html.setStyle(this.noTimeContentNode, 'display', 'none');
        this.createTimeSlider().then(lang.hitch(this, function() {
          html.setStyle(this.timeContentNode, 'display', 'block');
          html.addClass(this.domNode, 'show-time-slider');

          this._adaptResponsive();

          this.timeSlider.setThumbMovingRate(2000);
          this.timeSlider.play();
JohnMcEwen__GISP
Regular Contributor

Robert,

Awesome! that worked exactly the way I wanted. Except I think 

this.timeSlider.setThumbMovingRate(2000);

made it go .5x speed. 1000 made it go 1x speed and 500 set it to 2x speed.

Many thanks.

- John

0 Kudos