Skip to content

Layout: bottom float zones clear the basemap logo and attribution - #575

Closed
sandesh-sp wants to merge 2 commits into
feature/570-scale-barfrom
feature/570-map-chrome-insets
Closed

sandesh-sp wants to merge 2 commits into
feature/570-scale-barfrom
feature/570-map-chrome-insets

Conversation

@sandesh-sp

@sandesh-sp sandesh-sp commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #570. Stacked on #574 (feature/570-scale-bar). Merge that first, then retarget this PR to development.

Summary

  • Bottom float zones clear the basemap chrome. In deck.gl overlay mode the MapLibre/Mapbox logo and attribution sit in the map's bottom corners, and bottom float panels (e.g. the scale bar in float-bottom-left) could overlap them. The modern layout now lifts bottom-left, bottom-right and bottom-center zones by how far that chrome reaches up (bottom-center uses the taller of the two sides).
  • Engine contract: IMapEngine.getChromeInsets() returns, in CSS pixels, how far each bottom corner's chrome reaches up (bottomLeft, bottomRight) and in from its side (bottomLeftWidth, bottomRightWidth). DeckGLAdapter measures the basemap's bottom control corners with a ResizeObserver (they're filled after the map is created) and emits chromeinsetschange when the rounded values change. LeafletAdapter returns zeros, because its attribution control is removed at init.
  • Bus API: map:getChromeInsets (request) and map:chromeInsetsChange (event). Documented in Event-Bus-API.md.
  • Layout: UserInterfaceModern_ subscribes to the event, asks once on init in case the map reported first, and writes --ui-map-chrome-bottom-left/right on :root. A zone is lifted only for chrome beneath it: chrome beside the center region (under a side panel, in the overlay layout) is ignored, and any part a bottom panel already covers is subtracted, and the lift is recomputed when the center area resizes. Everything is cleaned up on teardown.

Test plan

  • npx vitest run: 216 files, 3,648 tests pass (deckGLOverlayChrome.spec.js and userInterfaceModern.mapChrome.spec.js cover the measurement and the lift)
  • deck.gl dashboard with a float-bottom-left panel (e.g. ScaleBar): the panel sits just above the MapLibre logo
  • A float-bottom-right panel sits above the attribution, and stays clear when the attribution is expanded or collapsed
  • With a bottom panel docked over the map, float panels aren't lifted more than necessary
  • Overlay layout with a left panel open: the bottom-left float zone stays on the edge (the logo is under the panel)
  • Leaflet engine: bottom float zones stay at the bottom edge

The deck.gl engine measures how far the basemap's bottom control corners
reach up from the map's edge and reports it as map:getChromeInsets and
map:chromeInsetsChange. The modern layout lifts the bottom float zones by
that much, less any part a panel already covers.
@sandesh-sp
sandesh-sp force-pushed the feature/570-map-chrome-insets branch from ed60e6b to e13ce6d Compare October 15, 2026 19:58
The engine also reports how far each corner's chrome reaches in from its
side, so a zone beside the logo or attribution (in the overlay layout, where
it sits under a side panel) stays on the edge. Inset changes are announced
only when the rounded values change, and the zero insets are one shared
constant.
@sandesh-sp

Copy link
Copy Markdown
Collaborator Author

Replaced by #577: an admin-configured bottom offset for floating panels instead of measuring the basemap's logo and attribution at runtime.

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.

1 participant