GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Subscribes to active-basemap-key changes. Returns an unsubscribe function.

      Exists because the UI cannot learn about activation any other way at boot: setBaseLayer defers until the map is idle (style + sources still in flight), and both boot call sites pass silent: true, which suppresses the public geoleaf:basemap:change event. The UI therefore rendered its buttons, ran refreshUI() against a still-null key, and never re-synced — leaving no button highlighted until the user clicked one.

      Hooking _setActiveKey rather than the event keeps this path-agnostic: it fires for the sync raster, WMTS and vector (setStyle) paths alike, and regardless of silent. State owns no UI import, so no cycle is created.

      Parameters

      • listener: ActiveKeyListener

      Returns () => void