It is quite simple to add events dynamically through Javascript.
Create a new event, add it to the eventSource for the band(s) and update the
timeline:
var evt = new Timeline.DefaultEventSource.Event ({
start: new Date("May 03 2013 00:00:00 GMT-0600"),
instant : true,
text : "An event",
description : "A description",
});
tl.getBand(0).getEventSource().add(evt);
tl.paint();
If you have already created an array of events, you can use the addMany method
of the event source. You can add many events before repainting the timeline to
improve performance.
var myEvents = [];
myEvents.push(evt);
myEvents.push(evt2); // etc.
tl.getBand(0).getEventSource().addMany(myEvents);
--Mike
On Jun 10, 2013, at 5:11 PM, Jörn Clausen wrote:
> Hi!
>
> I finally caved in: I am trying to port my Live Earthquake Mashup from
> Timeline v1 to version 2 of the API.
>
> I am looking for a replacement of the addMany method. Actually, I am
> even looking for a method to add single events to a timeline. The Wiki
> explains only adding events from JSON or XML files (through PHP, which
> does not help me understand what's going on).
>
> Is it no longer possible to add events that are computed on-the-fly in
> JavaScript?
>
> --
> Joern Clausen
> http://thebloeg.blogspot.com/
> http://www.oe-files.de/photography/
>
> --
> You received this message because you are subscribed to the Google Groups
> "SIMILE Widgets" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/simile-widgets?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/groups/opt_out.