Builds the toggle button for a layer and attaches it to the controls container.
Called by the layer manager on first render of a layer item.
Layer the button drives.
Element the button is appended to.
The button, or null when the layer carries no label configuration.
Re-reads a layer's state and repaints its button now, bypassing the debounce.
The urgent path, for changes the user just caused — a visibility toggle, a theme
switch. The debounced counterpart is the private _doSync.
Layer whose button is repainted.
Removes every injected button and releases their listeners.
⚠️ Not cosmetic: each button carries two listeners that nothing else releases, so a destroy without this leaves clickable toggles wired to a torn-down singleton.
The 🏷️ toggle buttons the layer manager injects next to each labelled layer.
Mounted on the global as
GeoLeaf._LabelButtonManager. ⚠️ There is nosync()member, despite whatdocs/labels/LABEL_BUTTON_MANAGER.mddocuments: the surface is LabelButtonManagerApi.syncImmediate plus the private_doSync, and every real caller uses the former. The phantom went unnoticed because the global declares_LabelButtonManager?: unknown, so no call through it is type-checked (B-13).