leaflet-timeline-slider
leaflet-timeline-slider copied to clipboard
How to use dynamic timelineItems?
I want to use different timelineItems
in different positions, I tried to use the following code:
var timelineSlider = L.control.timelineSlider({
timelineItems: ["Day 1", "The Next Day", "Amazing Event", "1776", "12/22/63", "1984"],
extraChangeMapParams: {greeting: "Hello World!"},
changeMap: getDataAddMarkers
});
timelineSlider.addTo(map);
... ...
// Change timelineItems in a callback function
timelineSlider.remove();
timelineSlider = L.control.timelineSlider({
timelineItems: timelineItems,
extraChangeMapParams: {greeting: "Hello World!"},
changeMap: getDataAddMarkers
});
timelineSlider.addTo(map);
I used the method of removing and adding to update. The user interface display is updated, but the click operation is no longer possible at the time.
What do you mean by the click operation? Can you show me a reprex?
What do you mean by the click operation? Can you show me a reprex?
Click the point on the timeline.
Cannot click the point on the timeline after modification.
I'm really sorry for getting back to this so late, other things have come up and I am just getting around to fixing issues for this. Could you go into more detail about how you are changing the timelineItems
parameter in a callback? Have you found a resolution for this issue in the meantime?