Skip to content

fix: Eliminate vehicle marker flicker on update#251

Merged
regeter merged 2 commits intogooglemaps:mainfrom
regeter:markerupdate
Jul 24, 2025
Merged

fix: Eliminate vehicle marker flicker on update#251
regeter merged 2 commits intogooglemaps:mainfrom
regeter:markerupdate

Conversation

@regeter
Copy link
Copy Markdown
Contributor

@regeter regeter commented Jul 24, 2025

The vehicle marker was being destroyed and recreated on every data update. During high-frequency updates, such as playing through a trip log, this caused a noticeable flicker as the marker would briefly disappear from the map between renders.

This change refactors the marker handling logic to persist the marker objects across renders. Instead of recreating the markers, their properties (e.g., position, rotation) are now updated directly using setPosition() and setIcon().

This approach is more performant, results in a smooth update without flickering, and is the recommended pattern for frequently-updated map objects.

@regeter regeter merged commit f317f92 into googlemaps:main Jul 24, 2025
9 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 24, 2025
* fix: Eliminate vehicle marker flicker on row change

* fix: excessive logging for larger files f317f92
googlemaps-bot pushed a commit that referenced this pull request Jul 24, 2025
### [1.20.5](v1.20.4...v1.20.5) (2025-07-24)

### Bug Fixes

* Eliminate vehicle marker flicker on update ([#251](#251)) ([f317f92](f317f92))
@googlemaps-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.20.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants