Repository navigation
feat(TimestampedGeoJson): support marker-only animation without redrawing paths - #2323
Open
senanurcetin wants to merge 3 commits into
Open
senanurcetin wants to merge 3 commits into
senanurcetin wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #1945.
This PR adds an opt-in
show_path=Falseoption toTimestampedGeoJson, allowing moving markers to be animated without repeatedly recreating their associated LineString paths.Previously, Leaflet.TimeDimension reconstructed the animated polylines on each frame. When no explicit style was provided, these paths appeared as blue lines and introduced unnecessary rendering overhead.
The existing behavior remains unchanged by default (
show_path=True).Changes
Add the
show_pathparameter toTimestampedGeoJson, defaulting toTruefor backward compatibility.When
show_path=False, prevent LineString paths from being constructed in animated frame layers.Preserve the original LineString features for timestamp indexing and marker positioning.
Keep generated last-point markers visible and animated.
Add regression tests for the new option and existing default behavior.
Testing
Validated locally against the Folium upstream source on Windows.
Results:
Relevant Folium plugin and map tests: 23 passed.
Ruff lint: passed.
git diff --check: passed.Verified behavior by executing the Leaflet.TimeDimension 1.1.1 update logic against the original issue dataset.
Original dataset verification:
Behavior | Default | show_path=False -- | -- | -- Animated LineString paths | 175 | 0 Moving markers | 115 | 115 Original source tracks retained | 175 | 175The implementation eliminates per-frame polyline construction in marker-only mode while preserving marker animation and the original timestamp data.
Scope and Limitations
The changes are limited to two files:
folium/plugins/timestamped_geo_json.pytests/plugins/test_timestamped_geo_json.pyBrowser-level FPS and CPU benchmarks have not been performed. The verification confirms that animated path creation is skipped; it does not establish a measured frame-rate or CPU improvement.
AI Assistance
AI assistance was used for issue investigation, implementation, and regression-test development. The changes were validated locally and are submitted for maintainer review.