Skip to content

feat(TimestampedGeoJson): support marker-only animation without redrawing paths - #2323

Open
senanurcetin wants to merge 3 commits into
python-visualization:mainfrom
senanurcetin:fix/1945-timestamped-markers-without-paths
Open

senanurcetin wants to merge 3 commits into
python-visualization:mainfrom
senanurcetin:fix/1945-timestamped-markers-without-paths

Conversation

@senanurcetin

Copy link
Copy Markdown

Summary

Addresses #1945.

This PR adds an opt-in show_path=False option to TimestampedGeoJson, 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_path parameter to TimestampedGeoJson, defaulting to True for 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 | 175

The 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.py

  • tests/plugins/test_timestamped_geo_json.py

Browser-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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant