GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Creates a collapse/expand toggle button inside a control header.

      The button uses the BEM modifier <classPrefix>__toggle, an i18n aria-label and the "⟱" glyph. Clicking it stops propagation and invokes onToggle. A teardown that detaches the listener (clone-replace) is pushed into cleanups so the control can dispose it on removal.

      Parameters

      • header: HTMLElement

        The header element the button is appended to.

      • classPrefix: string

        BEM block prefix, e.g. "gl-layer-manager" or "gl-map-legend".

      • onToggle: () => void

        Invoked on click, after stopPropagation.

      • cleanups: (() => void)[]

        Array collecting teardown callbacks.

      Returns HTMLButtonElement

      The created button element.