Leaflet / Leaflet

🍃 JavaScript library for mobile-friendly interactive maps 🇺🇦
https://leafletjs.com
BSD 2-Clause "Simplified" License
40.17k stars 5.75k forks source link

Leaflet - adding the capability to update the title dynamically based on animation frames #9313

Closed Celtics33 closed 1 month ago

Celtics33 commented 1 month ago

Checklist

Motivation

Create a map visualization with leaflet that takes a geojson with time properties and displays not only the time slider which you can with Folium or Leaflet Timestampedgeojson but also the title of the map will update based on the timestampedgeojson text. For example, if the time slider is on 1980 while playing the animation then the title of the map will be set to 1980. The title will get updated frame by frame. I already posted to the Folium GitLab and they said it is not possible within the Python wrapper for Leaflet.

Suggested solution

I am not sure if there is a property within Leaflet to access frame by frame properties but I did not see anything in documentation pertaining to API properties for this capability.

Alternatives considered

I have looked at other python based libraries and not leaflet seems to best one in JS to use.

IvanSanchez commented 1 month ago

This is core Leaflet, which doesn't implement any time sliders. Besides, you should be able to set up your own frame loop, query the relevant properties, and set document.title.