Creates a timeline slider for timeline layers. Parameters ---------- auto_play: bool, default True Whether the animation shall start automatically at startup. start: str, int or float, default earliest 'start' in GeoJson The beginning/minimum value of the timeli
| 129 | |
| 130 | |
| 131 | class TimelineSlider(JSCSSMixin, MacroElement): |
| 132 | """ |
| 133 | Creates a timeline slider for timeline layers. |
| 134 | |
| 135 | Parameters |
| 136 | ---------- |
| 137 | auto_play: bool, default True |
| 138 | Whether the animation shall start automatically at startup. |
| 139 | start: str, int or float, default earliest 'start' in GeoJson |
| 140 | The beginning/minimum value of the timeline. |
| 141 | end: str, int or float, default latest 'end' in GeoJSON |
| 142 | The end/maximum value of the timeline. |
| 143 | date_options: str, default "YYYY-MM-DD HH:mm:ss" |
| 144 | A format string to render the currently active time in the control. |
| 145 | enable_playback: bool, default True |
| 146 | Show playback controls (i.e. prev/play/pause/next). |
| 147 | enable_keyboard_controls: bool, default False |
| 148 | Allow playback to be controlled using the spacebar (play/pause) and |
| 149 | right/left arrow keys (next/previous). |
| 150 | show_ticks: bool, default True |
| 151 | Show tick marks on the slider |
| 152 | steps: int, default 1000 |
| 153 | How many steps to break the timeline into. |
| 154 | Each step will then be (end-start) / steps. Only affects playback. |
| 155 | playback_duration: int, default 10000 |
| 156 | Minimum time, in ms, for the playback to take. Will almost certainly |
| 157 | actually take at least a bit longer -- after each frame, the next |
| 158 | one displays in playback_duration/steps ms, so each frame really |
| 159 | takes frame processing time PLUS step time. |
| 160 | |
| 161 | Examples |
| 162 | -------- |
| 163 | See the documentation for Timeline |
| 164 | |
| 165 | """ |
| 166 | |
| 167 | _template = Template( |
| 168 | """ |
| 169 | {% macro header(this,kwargs) %} |
| 170 | <style> |
| 171 | .leaflet-bottom.leaflet-left { |
| 172 | width: 100%; |
| 173 | } |
| 174 | .leaflet-control-container .leaflet-timeline-controls { |
| 175 | box-sizing: border-box; |
| 176 | width: 100%; |
| 177 | margin: 0; |
| 178 | margin-bottom: 15px; |
| 179 | } |
| 180 | </style> |
| 181 | {% endmacro %} |
| 182 | |
| 183 | {% macro script(this, kwargs) %} |
| 184 | var {{ this.get_name() }} = L.timelineSliderControl( |
| 185 | {{ this.options|tojavascript }} |
| 186 | ); |
| 187 | {{ this.get_name() }}.addTo({{ this._parent.get_name() }}); |
| 188 |
nothing calls this directly
no test coverage detected
searching dependent graphs…