Play and stop controls

162 views
Skip to first unread message

Mateusz Woźniak

unread,
Apr 2, 2013, 12:25:38 PM4/2/13
to timemap-d...@googlegroups.com
Hi,
I saw on this website: http://gap.alexandriaarchive.org/gapvis/index.html#book/1/read/-1 play and stop controls in timeline (the upper left corner). I've tried to find how it works but unfortunately I couldn't find. Can you show me the way how to code this? I want to add this feature to website I'm working on. If there was already similar topic, forgive me, but I didn't find one. Thank you for your help. 
Mateusz Woźniak.
Message has been deleted

Alan Leslie

unread,
Apr 9, 2013, 6:53:44 AM4/9/13
to timemap-d...@googlegroups.com
I tried to reply but got a "This message has been deleted.".
Dunno why.

Alan Leslie

unread,
Apr 9, 2013, 6:56:31 AM4/9/13
to timemap-d...@googlegroups.com
So I'll try again.

Moving the timeline programatically can be done using timeline band moveEther.
See http://www.alfi2fe.co.uk/EdSciTimemap.html and TimelineBandPanControl.js for an example.


On Tuesday, April 2, 2013 5:25:38 PM UTC+1, Mateusz Woźniak wrote:

Alan Leslie

unread,
Apr 9, 2013, 7:00:13 AM4/9/13
to timemap-d...@googlegroups.com
You can animate the timeline by putting the moveEther call into a setTimeout.
I have an example of animating a map (not a Timemap so it doesn't do exactly what you want) at http://www.alfi2fe.co.uk/kml_front_mxn.html?scifest=true.
The animateTracks function does the work.


On Tuesday, April 2, 2013 5:25:38 PM UTC+1, Mateusz Woźniak wrote:

Nick Rabinowitz

unread,
Apr 9, 2013, 4:04:18 PM4/9/13
to alan...@gmail.com, Timemap.js Development
You can see the code that runs the GapVis controls here: https://github.com/nrabinowitz/gapvis/blob/master/app/views/TimeMapView.js#L271

Some pieces of this are specific to that application, but most of it should work in a standard Timemap.js app.

-Nick


--
You received this message because you are subscribed to the Google Groups "Timemap.js Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to timemap-develop...@googlegroups.com.
To post to this group, send email to timemap-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/timemap-development?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rafael Fraga

unread,
Sep 10, 2013, 6:19:51 PM9/10/13
to timemap-d...@googlegroups.com, alan...@gmail.com, ni...@nickrabinowitz.com
Please, does anybody have a very simple example of something running with an autoplay button? I'm VERY newbie and it's VERY important to me to get this working asap, I would appreciate a lot any kind of help, that's the last thing I have to do in my timeline. THANKS A LOT!

Tiosi

unread,
Sep 10, 2013, 11:52:36 PM9/10/13
to timemap-d...@googlegroups.com
I'm also kinda new at js and very interested in this simple example with play/pause controls... hopefully someone will help us out.

Tiosi

unread,
Sep 10, 2013, 11:53:49 PM9/10/13
to timemap-d...@googlegroups.com, alan...@gmail.com, ni...@nickrabinowitz.com
I'm also kinda new at js and very interested in this simple example with play/pause controls... hopefully someone will help us out.

Rafael Fraga

unread,
Sep 12, 2013, 7:26:41 PM9/12/13
to timemap-d...@googlegroups.com
That's what I've done so far, I'm very new in js, so needed a lot of help to get here. Thanks A LOT for every help :)


As you can see, the play/pause button works, but it's playing backwards :( any thoughts on how I can solve this? I've being trying all day and got no success... besides, I also tried to speed up the animation changing the "time" value (it's running quite slow now), but it seems to slow down even more as I increase the value.

Thanks very very much, I'm so close to finish this :)

Rafael

Nguyen Hoang Long

unread,
Sep 13, 2013, 6:40:35 AM9/13/13
to raf...@gmail.com, timemap-d...@googlegroups.com
I have checked your code. You put the code "step=0"
have you tried to put "step=1 or higher".
Sorry for not fully explain the code for you.
The higher the time, the slower the animation.
The higher the step, the faster the animation.
You can also add some sliders to control the speed of the animation.

Good Luck
Nguyen Hoang Long


--
You received this message because you are subscribed to the Google Groups "Timemap.js Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to timemap-develop...@googlegroups.com.
To post to this group, send email to timemap-d...@googlegroups.com.

Rafael Fraga

unread,
Sep 13, 2013, 1:54:38 PM9/13/13
to timemap-d...@googlegroups.com, raf...@gmail.com
Thanks a lot for your answer... I'd have never been able to get here without your support, THANK YOU!
About the timeline, my idea is to make only a few hours of plot, so my timebands are in hour/minute/seconds. So, I don't want to skip any days (that's why I put step=0), I just want to play it in 1 or 5 seconds increments. Any ideas on how I can achieve that?
Thanks again,

Rafael

On Friday, September 13, 2013 6:40:35 AM UTC-4, Nguyen Hoang Long wrote:
I have checked your code. You put the code "step=0"
have you tried to put "step=1 or higher".
Sorry for not fully explain the code for you.
The higher the time, the slower the animation.
The higher the step, the faster the animation.
You can also add some sliders to control the speed of the animation.

Good Luck
Nguyen Hoang Long
On Fri, Sep 13, 2013 at 6:26 AM, Rafael Fraga <raf...@gmail.com> wrote:
That's what I've done so far, I'm very new in js, so needed a lot of help to get here. Thanks A LOT for every help :)


As you can see, the play/pause button works, but it's playing backwards :( any thoughts on how I can solve this? I've being trying all day and got no success... besides, I also tried to speed up the animation changing the "time" value (it's running quite slow now), but it seems to slow down even more as I increase the value.

Thanks very very much, I'm so close to finish this :)

Rafael

--
You received this message because you are subscribed to the Google Groups "Timemap.js Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to timemap-development+unsub...@googlegroups.com.

To post to this group, send email to timemap-d...@googlegroups.com.

Rafael Fraga

unread,
Sep 13, 2013, 1:55:25 PM9/13/13
to timemap-d...@googlegroups.com

Rafael Fraga

unread,
Sep 15, 2013, 3:07:20 AM9/15/13
to timemap-d...@googlegroups.com
After trying a lot, finally got it :) Here it is (below)... solved the problem by substituting setDate and getDate for setTime and getTime, at line 5. Thanks a lot for all the help, specially from Nguyen Hoang Long, I'm truly happy now :).

function play(){
d1= tm.timeline.getBand(0).getCenterVisibleDate();
step=100
time=1
d1.setTime(d1.getTime()+ step);
tm.timeline.getBand(0).setCenterVisibleDate(d1);
t=setTimeout("play()",time);
};
Reply all
Reply to author
Forward
0 new messages