leaflet-timeline-slider
leaflet-timeline-slider copied to clipboard
Add an option for initial/starting value
Hi! First of all, amazing plugin! :)
Is it possible to add an option to initialize the value? For example, I have 3 timelineItems ("Yesterday", "Today", "Tomorrow") and I want the thumb/value to be initialized at "Today" instead of "Yesterday".
Thanks in advance!
Hi! Thank you, and great question. I will try to add that initialization option as soon as possible.
Hi, is there any improvement regarding this request? It would help me a lot as well :)
Just add options initializeValue: 1, and in slider.innerHTML replace value="1" with value="${this.options.initializeValue}"
In my case timelineItems it's a array of date timelineItems: dateTtile with initializeValue:dateTtile.length i initialise the timeline to the end
You have to add if(this.options.initializeValue>1){ that.sheet.textContent += that.getTrackStyle(this.rangeInput, that.sliderLength); } before /* When input gets changed change styles on slider and trigger user's changeMap function */ L.DomEvent.on(this.rangeInput, "input", function() { to initialise the range