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

    The shortcut methods mounted directly on globalThis.GeoLeaf.

    All members are optional: the namespace is assembled at boot (B1→B11 chain), and a consumer reading it too early sees a partial object. Same posture as GeoLeafGlobal, which references this contract member by member — inline, never via extends: the repo's AST readers (scripts/lib/ts-decl-read.cjs) iterate declared members only, and an inherited member would be invisible to them.

    interface GeoLeafTopLevelApi {
        init?: (options: Record<string, unknown>) => unknown;
        setTheme?: (theme: string) => boolean;
        loadConfig?: (input: string | Record<string, unknown>) => Promise<unknown>;
        createMap?: (id: string, options?: Record<string, unknown>) => unknown;
        getMap?: (id: string) => unknown;
        getAllMaps?: () => unknown[];
        getModule?: (name: string) => unknown;
        hasModule?: (name: string) => boolean;
        getNamespace?: (name: string) => unknown;
        getHealth?: () => unknown;
        getMetrics?: () => unknown;
    }
    Index
    init?: (options: Record<string, unknown>) => unknown

    Initialises GeoLeaf and creates the map.

    ⚠️ map.target — or its shorthand target/mapId — is required: APIInitializationManager._normalizeInitOptions throws without it. It reads { map: { target, center, zoom, mapOptions }, ui: { theme } }, or the flat shorthand { target, center, zoom, theme }. Any other key is ignored — data included: the profile is chosen by the configuration that GeoLeafTopLevelApi.boot loads.

    ⚠️ Distinct from GeoLeafTopLevelApi.boot: boot() launches the profile-driven application (config load then registry.init()), init() is the manual wrapper around GeoLeaf.Core.init(). The init of the boot path is the ModuleRegistry's, not this one.

    setTheme?: (theme: string) => boolean

    Applies a theme by identifier. Returns true when the theme was applied.

    loadConfig?: (input: string | Record<string, unknown>) => Promise<unknown>

    Loads a configuration from a URL or an object. Throws (TypeError) on anything else.

    createMap?: (id: string, options?: Record<string, unknown>) => unknown

    Creates a GeoLeaf-managed map instance. Returns null when the controller is absent.

    getMap?: (id: string) => unknown

    Returns the map instance registered under this identifier, or null.

    getAllMaps?: () => unknown[]

    Returns every registered map instance — empty array when there is none.

    getModule?: (name: string) => unknown

    Returns a registered module by name, or null.

    hasModule?: (name: string) => boolean

    true when a module of that name is registered.

    getNamespace?: (name: string) => unknown

    Returns a top-level namespace (GeoLeaf[name]), or null.

    getHealth?: () => unknown

    Health report of the APIController, or null when it is unavailable.

    getMetrics?: () => unknown

    Alias of GeoLeafTopLevelApi.getHealth.

    ⚠️ Both implementations must point at a function that does not depend on this — the this.getHealth() form threw as soon as the method was detached from the namespace.