@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/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to