Hi ! >From my personal feeling:This is not really well documented and I had the same stress. Here a snippet, which I made working in my first example:
var evt = new Timeline.DefaultEventSource.Event ({ id: null, start: Timeline.DateTime.parseGregorianDateTime(startdate), end: Timeline.DateTime.parseGregorianDateTime(enddate), latestStart: null, earliestEnd: null, instant: durationEvent, text: taskname, description: taskdesc, image: eventimage, link: "http://www.somewhere.com", icon: eventicon, color: eventcolor, textColor: eventtextcolor, className: null, tapeImage: null, tapeRepeat: null, caption: "Just a hint !", eventID: null, trackNum: null }); var es = tl.getBand(0).getEventSource(); es.add(evt); tl.layout(); This code refers to alreading existing variables elsewhere on my code. This is a scripted event. What you are using is to use the ajax interface to load from a url. I use this to update my panel for new incoming events: tlEventSource.loadJSON(json, document.location.href); But this is json, not a scripted insert and so - naturally - you cannot refer to local variables! Hope, this helps! br++mabra On Jun 16, 10:16 pm, John S <faceless...@gmail.com> wrote: > I feel like I'm hung up on one big step right now. Since this is all > done through ajax, I'm updating/creating/editing on the client side, > and I've been digging through the discussion pages and documentation, > and I found this code to help with dynamically handling events, but I > can't get them to load, and I'm really stumped on why. > > var eventsJson = [ > { > "start": timestart, > "title": title, > "icon": icon} > > ]; > > eventSource.loadJSON({ "events": eventsJson }, > document.location.href); > > timestamp, title, and icon are all variables. the date is formatted > like this, 2007-05-05 22:00:00. > > There aren't any errors being generated either, so I'm really not sure > why this isn't working, but I'd definitely appreciate any feedback > anyone might have. > > On Jun 15, 11:53 am, John S <faceless...@gmail.com> wrote: > > > Mike, thanks for the response. I'm really starting to play around with > > SIMILE and get my feet wet with it. > > > I'm currently working on a way to load content more dynamically. Right > > now I'm loading it with a JSON call, and I wanted to see if there was > > a way to clear the current events and assign all new ones? This will > > reflect filtering by category options that I have in place for my maps > > already. I am able to rebuild the JSON string without any problems, > > but I'm having a hard time finding any very specific documentation. > > > I also wanted to see, does anyone know a page that shows all of the > > event params that gives a desc of them? I'm currently going by example > > just viewing the sample timelines, but I was hoping there was > > something a bit more official and complete. > > > Thanks! > > > On Jun 13, 9:08 am, Michael Nosal <mno...@mitre.org> wrote: > > > > John, > > > This is perfectly fine to do. > > > All that the Simile loaders do is extract data from a data source (JSON, > > > XML, SPARQL) create new Event objects and push into an EventSource > > > object. It's really easy to write your own function to do the same. > > > > With a little extra work, creating/editing/removing timeline elements is > > > also straightforward to do. You don't need to wipe out the entire > > > timeline, just manipulate the Events inside an EventSource and call > > > .paint() when you're ready to update the timeline display. You can create > > > new events, edit existing ones and remove old ones. This can be done with > > > a little UI for the user inside the browser, or you could be fetching > > > updates from a server (e.g. an RSS feed of events) for a dynamic display. > > > > --Mike > > > > On Jun 10, 2011, at 11:15 AM, John S wrote: > > > > > I'm just getting started with SIMILE, and I have to express that I'm > > > > very impressed with this. I'm currently working on a project that > > > > initially took me to the TIMEMAP project, but after looking at how it > > > > integrates with google maps, I decided this is where I should be > > > > working from directly. > > > > > I wanted to just get a bit of conversation moving on how feasible this > > > > sounds.. My project at the moment is a google maps wizard using v3 of > > > > their api. The wizard does a bit of everything, clustering, category > > > > filters, 2d sortable arrays of all visible markers, and a slew of > > > > other smaller features. I initially looked into TIMEMAP because it's > > > > built to use SIMILE, but after looking closer, they create a timemap, > > > > and create the map inside of it, which doesn't work for the additional > > > > functionality that I have in place already. > > > > > What I'd like to do.. I'd like to be create a custom loader that > > > > doesn't use xml, instead I'd like to send it an array of map markers. > > > > All of the same data from the xml can be inside the markers, and I'd > > > > just create my own loader. > > > > > The extended functionality I'd need would be the ability to load, > > > > modify, and remove items in the timeline on an individual basis - > > > > dynamically. As a worst case, I could wipe the timeline and have it > > > > reload the new info, though I'd rather not go that route. > > > > > I wanted to see what you guys thought about this, and if it's very > > > > possible? I know SIMILE is a pretty impressive tool, but I haven't > > > > been able to dig through it enough yet to see if some of these > > > > features already exist or not. What does everyone think about this? Do > > > > you see a lot of issues with something like this or does this sound > > > > like something pretty feasible? -- You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to simile-widgets@googlegroups.com. To unsubscribe from this group, send email to simile-widgets+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en.