Syncronizing Timeline Placemarks with Map Zoom

92 views
Skip to first unread message

Brendan Ferguson

unread,
Oct 1, 2012, 12:28:25 PM10/1/12
to timemap-d...@googlegroups.com
Good Day

I was looking at the timemap and wondering it would be feasible to code an option to have place marks on the timeline removed when the zoom on the map removes them from the map view, so only the place marks that appear at any point in time on the viewed area of the map appear on the timeline.

I am of course not asking that you code this, but perhaps some insight into if its posable and perhaps some advice on roughly where I should start would be appreciated.

It looks like TimeMapFilterChain could make the effects to the timeline place marks, but retrieving the data of what place marks are currently being viewed on the map is where I am stuck.

Any assistance would be greatly appreciated.

Thanks.

Nick Rabinowitz

unread,
Oct 1, 2012, 12:41:59 PM10/1/12
to drsas...@gmail.com, timemap-d...@googlegroups.com
This comes up periodically. I have mixed feelings about it from a UI perspective, as things tend to jump around a bit, but it's not too hard to implement:

* Add a filter to the "timeline" filter chain - see https://code.google.com/p/timemap/wiki/FilterTutorial for more info here. The filter should look roughly like this (just pseudocode):

function myFilter(item) {
  return item.getInfoPoint() within tm.map.getBounds();
}

* Then add a handler to the map to call the filter. You can either add the handler using the mapstraction endPan and endZoom events, or if you're using Google I think there's a boundschanged event that covers both (you can access the Google map with tm.getNativeMap().) The handler would look something like this:

tm.map.endPan(function() {
  tm.filter('timeline');
});

Let me know how it goes -

-Nick


--
You received this message because you are subscribed to the Google Groups "Timemap.js Development" group.
To view this discussion on the web visit https://groups.google.com/d/msg/timemap-development/-/ZhKEPbtm4uAJ.
To post to this group, send email to timemap-d...@googlegroups.com.
To unsubscribe from this group, send email to timemap-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/timemap-development?hl=en.

Reply all
Reply to author
Forward
0 new messages