Leaflet.timeline
Leaflet.timeline copied to clipboard
Display range
Hello,
Is it possible to display a range with Leaflet.timeline? The idea would be to display all the earthquakes which happened between 14:00:00 and 16:30:00.
Thanks
Do you mean at the same time or cutting down the timeline to that range?
At the same time -- I wouldn't use L.Timeline for this; instead, I'd have another control or controls to determine the range, and just draw a layer with all the events filtered to what exists in that range.
Trimming down the timeline -- Right now, the only way would be to filter (like above) what is sent to L.Timeline. I could add a setStart and setEnd method, though.
Thanks for replying.
I meant at the same time and did what you suggested. Thus it also trimmed my timeline :)
If you want to keep both a timeline and also toggle to a range view, you might be able to take advantage of the IntervalTree
(from one of my other libraries, diesal) inside the Leaflet.Timeline
layer. The ranges
property is an instance of one. You could use the overlap(start, end)
method to efficiently find all events between start and end.