-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Timeline control 'setDate' not work correctly #355
Comments
I think it's a rounding problem. I'll try to investigate on it. |
@Viglino Any updates on this ? |
I think it's a rounding problem... |
So ? Is there anything can I do to solve this ? |
Do you have an online example (jsFiddle/codepen/codesandbox or so) ? |
Currently no! |
Hi, what the status now ? is it bug in the library ? or in my code ? |
Can't say till I get a code to test... |
The problem is this issue is part of big project and my map relay on private geoserver, I tried to do my best to prepare an example that is close to my real code: https://stackblitz.com/edit/angular-44bssk If you open it, you will see first the slider is not on the first day of the period which specified by the |
The problem is console.log((date - this.timelineCtrl.getDate())/1000/60);
// > 14.4 You have to store the date to make sure it's the one you expect. // let date = this.timelineCtrl.getDate();
let date = new Date(Math.round(this.timelineCtrl.getDate()/1000/60/60/24)*1000*60*60*24); or rounddate to 1h00 (that stick to the day separation) let date = this.timelineCtrl.getDate();
date.setHours(1,0,0,0); |
First, I think the control must snap to slider ticks, there is no point for allowing the user to move the slider a couple mins or hours, if Second, I test your suggestions on the example, it doesn't fix the problem. |
Up? |
Sticking to graduation would be a little constraining (some may not want to stick or stick to other intervals). |
@Viglino Any good news on this? |
No time yet to work on it... |
Hi @Viglino, any news ? I need this fix badly. |
Hi NB: when scrolling the date is sticked to nearest pixel and one pixel is a fraction of date. |
Nice! I will give it a try. Thanks. |
Hello,
When use
setDate
, the timeline will not go to the date perfectly, it will go to older date with (some sec and even some minutes) shift. Example:setDate(new Date(2019,9,1))
will make the time at2019-8-31 23:25:08
.Timeline setup:
See this GIF, I think it will clearly show the problem.
The text was updated successfully, but these errors were encountered: