leaflet-timeline-slider icon indicating copy to clipboard operation
leaflet-timeline-slider copied to clipboard

Support for larger datasets

Open tomasz-jankowski opened this issue 3 years ago • 1 comments

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?

image

tomasz-jankowski avatar Aug 31 '21 09:08 tomasz-jankowski

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);

image

tomasz-jankowski avatar Aug 31 '21 10:08 tomasz-jankowski