Leaflet.timeline icon indicating copy to clipboard operation
Leaflet.timeline copied to clipboard

Display range

Open GXBlary opened this issue 7 years ago • 3 comments

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

GXBlary avatar Oct 28 '17 20:10 GXBlary

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.

skeate avatar Nov 02 '17 18:11 skeate

Thanks for replying.

I meant at the same time and did what you suggested. Thus it also trimmed my timeline :)

GXBlary avatar Nov 03 '17 15:11 GXBlary

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.

skeate avatar Nov 03 '17 16:11 skeate