[openstreetmap/openstreetmap-website] Fix vector map route offset and marker sync race condition #6684 (PR #6731)
Swayam
notifications at github.com
Fri Jan 23 03:45:38 UTC 2026
@SinghSwayam commented on this pull request.
> + map.eachLayer((layer) => {
+ if (layer._glMap) {
+ layer._glMap.resize();
+ }
+ });
+ map.invalidateSize({ animate: false });
@tomhughes
**Re: Upstream Issue**
You are spot on. Ideally, the plugin should listen for `invalidateSize` and handle the context resize automatically. I saw that **[PR #76 (Fix resize issue of vector maps)](https://github.com/maplibre/maplibre-gl-leaflet/pull/76)** was merged upstream, but it clearly didn't cover this specific race condition involving CSS transitions. I haven't found an open issue tracking this specific "transition desync" scenario, so I can certainly open one to track it.
**Re: Generalization**
That sounds like a much more robust approach. Moving the `transitionend` listener into `OSM.loadSidebarContent` (or the sidebar controller) would solve this class of race condition for all sidebar interactions, not just routing.
Would you prefer I update this PR to refactor `OSM.loadSidebarContent` to fire a "sidebarReady" event that we can listen to? Or should we keep this PR focused on the routing fix and handle the architecture change separately?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6731#discussion_r2719472728
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6731/review/3695547052 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260122/285f4548/attachment-0001.htm>
More information about the rails-dev
mailing list