Thanks Mike, that helped a lot. I still used the old constructor for the Event, with a fixed list of parameters. I found the list of attributes at
http://simile-widgets.org/wiki/Timeline_EventSources#Event_attributes but the use of the constructor is not explained in the Wiki, as far as I can see. I have updated the new version of my mashup at http://www.oe-files.de/gmaps/eqmashup-ng.html http://www.oe-files.de/gmaps/eqmashup-ng.js and everything works, except for the coloring of the events on the bands. The text on the upper band should be black (at the moment I set the color only to verify that the correct one is actually passed to the event), and the markers in the lower band should be colored instead, just like in the original mashup. http://www.simile-widgets.org/timeline/examples/test_example2/test_example2.html demonstrates that a band with layout "overview" can contain colored markers, but I think these are only events with duration. Is there a way to colorize events without duration in an overview? On Thu, Jun 13, 2013 at 7:56 PM, Michael Nosal <[email protected]> wrote: > 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. > > -- 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. For more options, visit https://groups.google.com/groups/opt_out.
