Skip to content

feat: add smooth fade-in transition for route polylines#461

Open
sejalkutriyar wants to merge 1 commit intoOneBusAway:developfrom
sejalkutriyar:feature/polyline-animation-sejal
Open

feat: add smooth fade-in transition for route polylines#461
sejalkutriyar wants to merge 1 commit intoOneBusAway:developfrom
sejalkutriyar:feature/polyline-animation-sejal

Conversation

@sejalkutriyar
Copy link
Copy Markdown

Summary

  • Add opt-in opacity-based fade-in animation for route polylines in the OpenStreetMap provider using requestAnimationFrame.
  • Enable the animation only for route-shape rendering flows (keeping other polyline callers unchanged).

Implementation details

  • Added animatePolylineOpacity helper to smoothly animate polyline opacity on the client.
    • Includes safety guards (SSR, map/layer presence, and layer still attached).
  • Updated createPolyline(points, options) to accept { animate } (default: false).
    • When enabled, the polyline starts at opacity 0 and fades to the target opacity.
  • Route flows that display primary route shapes now pass { animate: true }:
    • route modal
    • search route selection

Testing

  • npm run lint (passes)
  • npm test -- src/tests/lib/serverCache.test.js --run (passes, all 37 tests)
  • Manual verification done on local dev map view.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 31, 2026

CLA assistant check
All committers have signed the CLA.

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.

2 participants