Hendrik Nijmeijer wrote:
> Hey David,
>
> Thanks for your reply. However I do not have much code at this time,
> since I can't find a way to do what I explained. I just want to create
> a SpanHighlight áfter I initialized the Timeline. This is what I'd
> like to see:
>
> - Timeline is created
> - User scrolls to another date
> - An addOnScrollListener gets the date that is currently selected.
> - A spanhighlight is created on that date by the onscrolllistener.
>
> So if the timeline is selected on 11 pm on 11/01/2008, the whole day
> 11/01/2008 has to get a spanhighlight in it.
> I can't seem to find any useful documentation on this matter.
>
> Could you please provide me with some usefull information?
If you want to keep on adding decorators, then try something like this
inside the onscroll listener:
var band = tl.getBand(0)
var decorator = new Timeline.SpanHighlightDecorator({ /* parameters
*/ });
band._decorators.push(decorator);
decorator.initialize(band, tl);
decorator.paint();
But I'd recommend using the same decorator and changing its dates. So,
at the beginning, create a decorator and keep a reference to it. Then
whenever you need to shift its dates, do something like this
decorator._startDate = // some date here
decorator._endDate = // some date here
decorator.paint();
David
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general