Skip to content

ChromeLayout

Defined in: packages/core/src/renderer/chrome-layout.ts:66

new ChromeLayout(host): ChromeLayout

Defined in: packages/core/src/renderer/chrome-layout.ts:69

ParameterType
hostHTMLElement

ChromeLayout

collapseCompactAttribution(): boolean

Defined in: packages/core/src/renderer/chrome-layout.ts:161

Keep MapLibre’s compact attribution from covering bottom-left chrome.

boolean

Whether an expanded attribution was collapsed.

On a narrow map (MapLibre’s threshold is 640px) the attribution control goes compact and starts EXPANDED until the first drag. Expanded, it wraps across the map’s whole bottom edge from the bottom-right corner, above the chrome (z-index 2 vs 1) — a bottom-left legend on a phone showed only its title (ml-aot.26). The bottom-left corner cannot reserve space for it (the attribution lives in the other corner and shrinks to an (i) button a moment later), so while bottom-left chrome is mounted the attribution starts collapsed, exactly as MapLibre leaves it after a drag. The (i) button still expands it on demand. Same-corner placement past MapLibre’s own controls is unchanged. MapLibre’s own controls in the bottom-left corner — the scale bar, by default — count too (ml-aot.38); its logo alone does not.


corner(corner): HTMLElement

Defined in: packages/core/src/renderer/chrome-layout.ts:72

The corner’s container, created on first use.

ParameterType
corner"top-left" | "top-right" | "bottom-left" | "bottom-right"

HTMLElement


destroy(): void

Defined in: packages/core/src/renderer/chrome-layout.ts:188

Remove every corner container (renderer destroy).

void


mount(corner, el, first?): void

Defined in: packages/core/src/renderer/chrome-layout.ts:106

Mount one chrome piece into a corner: after the current occupants, or at the corner’s edge (first).

ParameterTypeDefault value
corner"top-left" | "top-right" | "bottom-left" | "bottom-right"undefined
elHTMLElementundefined
firstbooleanfalse

void