GeoLeaf Core API - v3.0.0
    Preparing search index...

    Function bindUIOnce

    • Wires the basemap-switcher listeners, once per lifecycle.

      Binds three things: a delegated click on [data-gl-baselayer], a debounced resize, and a subscription to the active-key state. Guarded by a flag, so repeated calls are no-ops until destroyUI clears it.

      ⚠️ The handlers are kept in refs rather than inlined because destroyUI resets that flag: with anonymous listeners, a destroy/re-init cycle would re-add them and fire setBaseLayer once per past cycle. The state subscription is what keeps a button highlighted at boot — setBaseLayer defers until the map is idle, and that late activation is silent, so nothing else would mark the control.

      Returns void