Re: [Simile-Widgets] Re: tracking when labels become visible

2011-07-13 Thread Michael Nosal
On Jul 12, 2011, at 3:46 PM, John S wrote:

 I was just talking with one of the creators of the Timemap project,
 and he had some good ideas, but the only suggestions he had, came
 directly from their plugin, which I'm not implementing, and likely
 won't because of the specific way I'm setting this up already.
 

Curious as to why you find Timemap unacceptable for your purposes. It's a 
nicely done library. I've worked with it in the past and had no problems using 
it. 

Just because it provides one way of constructing a Timeline and a map, doesn't 
mean that's the only way to do it. Since it is built on top of Timeline 2.3.0, 
it's possible to use Timeline as you would normally, and call into Timemap's 
code as necessary. Or override parts of Timemap to do what you need instead.


 But one of the ideas he suggested that I liked the best was, would
 there be a simple way, or is there already a simple way to get a min
 and max visible date of the top timeline band? I've been searching the
 documentation, but I usually have a hard time finding stuff on there.
 

Yes, it's easy.
tl.getBand(0).getMinVisibleDate()
==Date {Mon Jun 30 2008 13:45:36 GMT-0400 (EDT)}

tl.getBand(0).getMaxVisibleDate()
== Date {Sun Nov 30 2008 01:14:24 GMT-0500 (EST)}

--Mike

-- 
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.



Re: [Simile-Widgets] Re: tracking when labels become visible

2011-07-12 Thread Michael Nosal
See Timemap, by Nick Rabinowitz:
http://code.google.com/p/timemap/
That has the code to show only items from the visible portion of the timeline 
on the map.

--Mike 

On Jul 12, 2011, at 9:57 AM, John S wrote:

 I'll give you some background on my project...
 I'm working on a google maps wizard that does... honestly a bit of
 everything. The timeline is just the latest feature. I am looking at
 creating something similar to the Timeline project that's built on top
 of Simile, but for that project, you have to load the map into the
 timeline object, and I'd rather have the map be the base of
 everything, and just create my own bridge between the two of them. The
 reasons get fairly detailed on this, but it's the best approach I can
 take.
 
 All of the map markers and and event specific items for the timeline
 are stored in the database. I make the distinction between map markers
 and timeline specific items, because I create map markers with start/
 end dates, but recognize there are times when we'll want to add
 something to a timeline that isn't a map marker. These items are
 pulled from the database and I build a 2d array of events and markers
 for JS. From there, the JS creates the JSON calls to load them into
 the timeline. I do it this way because I'm able to dynamically edit
 everything without ever having to reload the page. So far, none of
 this is the issue.
 
 The last bit of functionality that I'm looking to recreate is... as I
 scroll the timeline, I'd like to have only the items on the top tape
 be the ones that are visible on the map, so that as you scroll the
 timeline, you'll be able to see the progression of the items move
 across the map. Making the markers on the map appear/disappear isn't
 an issue, that's definitely easy enough to do, the part that I'm
 stumped on is finding an effective way to track the events on the
 timeline that are currently visible.
 
 I understand what you're talking about on the load that it could
 create, and that was my biggest worry, but I wasn't sure of a better
 approach for it all. As far as the load goes, I don't think I'll even
 hit a timeline with more than a couple hundred items on it
 realistically, though I'm sure now that I said that, I'll come up with
 one that has over 3000, lol.
 
 This is a pretty winded post, but I think it explains everything in
 pretty well detail with the exception of posting sample code, lol. I'd
 love to hear some more ideas though.
 
 On Jul 11, 5:44 pm, Michael Nosal mno...@mitre.org wrote:
 John,
 What are you trying to make Timeline do? It would help if I understood what 
 you were trying to accomplish.
 Attaching listeners to each individual event is expensive to do, and can 
 cause performance problems if done incorrectly.
 
 Timeline does support the ability to add listeners to the individual events 
 - the onSelectListener gets fired when you click on an event and the 
 eventPaintListeners get fired when the Timeline .paint() is called.
 
 Because of the expense of adding listeners, and the potential for having to 
 fire too many listeners, or check too many events, you might look at using 
 event delegation instead. Set a scroll listener on a band and let it decide 
 what to do based on the time and events shown.
 
 I'm not sure what you mean by having the server side script generate loading 
 calls for you. Better to have the server provide the data necessary for your 
 event loading, and use the client side javascript to load that data. Keeps 
 things cleaner and easier to maintain if you ever need to change formats, 
 load order, etc.
 
 --Mike
 
 On Jul 11, 2011, at 5:13 PM, John S wrote:
 
 I've been hunting around for this, but I haven't been able to find
 anything yet, and I wanted to see if anyone else had any suggestions
 for a good way to do this.
 
 I'm currently loading everything dynamically with JSON calls, and
 setting a custom class for each item. (these calls are being generated
 from a server side script that's writing the loading calls for me, so
 the names are something like, event26 where the 26 is the event ID
 in the database.)
 
 Because of the way I'm doing this I can attach a listener to each
 event individually, based on the unique class names, but I'm just not
 sure what to look for as the trigger of the listener. I'd like to have
 the listener trigger whenever the labels become visible. I know
 thats a vague way to describe a trigger, but that's half my problem of
 coming up with a better plan of attack.
 
 If anyone has any ideas on how I could go about doing this, it would
 be a serious help! I don't even need the specific code, just a push in
 the right direction should be enough for me to go on.
 
 --
 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 

Re: [Simile-Widgets] Re: tracking when labels become visible

2011-07-12 Thread Jon Crump
John,

You may find useful the way I solved this problem for my Itinerary of
John site: http://neolography.com/timelines/JohnItinerary.html

Note the updateMap() function in
http://neolography.com/timelines/js/itin-code.js

Jon

On Tue, Jul 12, 2011 at 12:46 PM, John S faceless...@gmail.com wrote:
 I was just talking with one of the creators of the Timemap project,
 and he had some good ideas, but the only suggestions he had, came
 directly from their plugin, which I'm not implementing, and likely
 won't because of the specific way I'm setting this up already.

 But one of the ideas he suggested that I liked the best was, would
 there be a simple way, or is there already a simple way to get a min
 and max visible date of the top timeline band? I've been searching the
 documentation, but I usually have a hard time finding stuff on there.

 On Jul 12, 11:08 am, Michael Nosal mno...@mitre.org wrote:
 See Timemap, by Nick Rabinowitz:http://code.google.com/p/timemap/
 That has the code to show only items from the visible portion of the 
 timeline on the map.

 --Mike

 On Jul 12, 2011, at 9:57 AM, John S wrote:

  I'll give you some background on my project...
  I'm working on a google maps wizard that does... honestly a bit of
  everything. The timeline is just the latest feature. I am looking at
  creating something similar to the Timeline project that's built on top
  of Simile, but for that project, you have to load the map into the
  timeline object, and I'd rather have the map be the base of
  everything, and just create my own bridge between the two of them. The
  reasons get fairly detailed on this, but it's the best approach I can
  take.

  All of the map markers and and event specific items for the timeline
  are stored in the database. I make the distinction between map markers
  and timeline specific items, because I create map markers with start/
  end dates, but recognize there are times when we'll want to add
  something to a timeline that isn't a map marker. These items are
  pulled from the database and I build a 2d array of events and markers
  for JS. From there, the JS creates the JSON calls to load them into
  the timeline. I do it this way because I'm able to dynamically edit
  everything without ever having to reload the page. So far, none of
  this is the issue.

  The last bit of functionality that I'm looking to recreate is... as I
  scroll the timeline, I'd like to have only the items on the top tape
  be the ones that are visible on the map, so that as you scroll the
  timeline, you'll be able to see the progression of the items move
  across the map. Making the markers on the map appear/disappear isn't
  an issue, that's definitely easy enough to do, the part that I'm
  stumped on is finding an effective way to track the events on the
  timeline that are currently visible.

  I understand what you're talking about on the load that it could
  create, and that was my biggest worry, but I wasn't sure of a better
  approach for it all. As far as the load goes, I don't think I'll even
  hit a timeline with more than a couple hundred items on it
  realistically, though I'm sure now that I said that, I'll come up with
  one that has over 3000, lol.

  This is a pretty winded post, but I think it explains everything in
  pretty well detail with the exception of posting sample code, lol. I'd
  love to hear some more ideas though.

  On Jul 11, 5:44 pm, Michael Nosal mno...@mitre.org wrote:
  John,
  What are you trying to make Timeline do? It would help if I understood 
  what you were trying to accomplish.
  Attaching listeners to each individual event is expensive to do, and can 
  cause performance problems if done incorrectly.

  Timeline does support the ability to add listeners to the individual 
  events - the onSelectListener gets fired when you click on an event and 
  the eventPaintListeners get fired when the Timeline .paint() is called.

  Because of the expense of adding listeners, and the potential for having 
  to fire too many listeners, or check too many events, you might look at 
  using event delegation instead. Set a scroll listener on a band and let 
  it decide what to do based on the time and events shown.

  I'm not sure what you mean by having the server side script generate 
  loading calls for you. Better to have the server provide the data 
  necessary for your event loading, and use the client side javascript to 
  load that data. Keeps things cleaner and easier to maintain if you ever 
  need to change formats, load order, etc.

  --Mike

  On Jul 11, 2011, at 5:13 PM, John S wrote:

  I've been hunting around for this, but I haven't been able to find
  anything yet, and I wanted to see if anyone else had any suggestions
  for a good way to do this.

  I'm currently loading everything dynamically with JSON calls, and
  setting a custom class for each item. (these calls are being generated
  from a server side script that's writing the loading calls for me, so