ChromeLayout
Defined in: packages/core/src/renderer/chrome-layout.ts:66
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ChromeLayout(
host):ChromeLayout
Defined in: packages/core/src/renderer/chrome-layout.ts:69
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
host | HTMLElement |
Returns
Section titled “Returns”ChromeLayout
Methods
Section titled “Methods”collapseCompactAttribution()
Section titled “collapseCompactAttribution()”collapseCompactAttribution():
boolean
Defined in: packages/core/src/renderer/chrome-layout.ts:161
Keep MapLibre’s compact attribution from covering bottom-left chrome.
Returns
Section titled “Returns”boolean
Whether an expanded attribution was collapsed.
Remarks
Section titled “Remarks”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()
Section titled “corner()”corner(
corner):HTMLElement
Defined in: packages/core/src/renderer/chrome-layout.ts:72
The corner’s container, created on first use.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
corner | "top-left" | "top-right" | "bottom-left" | "bottom-right" |
Returns
Section titled “Returns”HTMLElement
destroy()
Section titled “destroy()”destroy():
void
Defined in: packages/core/src/renderer/chrome-layout.ts:188
Remove every corner container (renderer destroy).
Returns
Section titled “Returns”void
mount()
Section titled “mount()”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).
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
corner | "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined |
el | HTMLElement | undefined |
first | boolean | false |
Returns
Section titled “Returns”void