Repository navigation
fix(jupyter-widget): size MapLibre map to the widget and load its CSS - #10951
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummarySizes detached MapLibre maps once their containers become visible and loads the matching stylesheet.
No new actionable issues were found. Tests were inspected but not run. Reviews (4) · Last reviewed commit: "Merge branch 'master' into chr/fix-widge..." · Reviewed by Greptile |
ibgreen
left a comment
There was a problem hiding this comment.
Approved with a non-blocking lifecycle follow-up. The one-time resize handles attachment after construction, and the version-matched MapLibre stylesheet plus stylesheet deduplication look appropriate. All reported CI checks pass at this commit; no local test rerun.
I agree with the existing observer cleanup concern: playground teardown calls deck.finalize(), while MapLibreOverlay.finalize() only removes the control, so it does not trigger the map's remove event. Closing a still-hidden widget before its container gains a size leaves this new observer connected. Please wire observer disconnection into widget finalization as a follow-up and cover finalization before sizing in a regression test. This is modest enough not to block the resize/CSS fix.
…idget closes Widget teardown finalizes the overlay, which does not remove the map, so the resize observer stayed connected for widgets closed before they had a size.
|
Released in deck.gl 9.4.2. |
Closes #10943
Background
The widget creates the MapLibre map before Jupyter attaches the view's element, so MapLibre falls back to 400x300. The element is attached before MapLibre's
trackResizeobserver sends its first notification, which MapLibre skips, so the map is never resized.Change List
createMapLibreDeckOverlay: resize the map once its container has a sizemaplibre-gl.cssfor themaplibreproviderloadCSS: skip stylesheets that are already loadedVerified in classic Notebook 6.5.7 with ipywidgets 7.8.5.
Before:

After:
