leaflet-timeline-slider
leaflet-timeline-slider copied to clipboard
Support for larger datasets
Hi,
I'm using the plugin with dynamic data fetched from the database. However, if there are too many of them, the slider would not fit them. Is there any possibility to improve the plugin to support that?
I've managed to code a simple workaround, but it's still not good enough for datasets larger than let's say 40. I had to reduce label to just an index.
let width = document.getElementById('mapid').offsetWidth / timelineItems.length;
width *= 0.925;
width += 'px';
L.control.timelineSlider({
timelineItems,
changeMap: getDataAddMarkers,
extraChangeMapParams: { exclamation: 'Szczegóły pomiaru' },
labelWidth: width,
})
.addTo(mymap);