Baselayers: {
    init: ((options?: BaselayersInitOptions) => {
        activeKey: string | null;
        layers: Record<string, unknown>;
    });
    registerBaseLayer: ((key: any, definition: any) => void);
    registerBaseLayers: ((definitions: any) => void);
    setBaseLayer: ((key: any, options?: any) => void);
    setActive: ((key: any, options?: any) => void);
    getBaseLayers: (() => any);
    getActiveKey: (() => null | string);
    getActiveId: (() => null | string);
    getActiveLayer: (() => any);
    destroy: (() => void);
} = ...

Type declaration

  • init: ((options?: BaselayersInitOptions) => {
        activeKey: string | null;
        layers: Record<string, unknown>;
    })
      • (options?): {
            activeKey: string | null;
            layers: Record<string, unknown>;
        }
      • Initialises the basemaps system: registers default layers, applies custom layers from options, sets the active layer, and renders the basemap UI controls.

        Parameters

        • Optionaloptions: BaselayersInitOptions

          Initialisation options.

        Returns {
            activeKey: string | null;
            layers: Record<string, unknown>;
        }

        An object with the active key and the full layers registry.

        • activeKey: string | null
        • layers: Record<string, unknown>
  • registerBaseLayer: ((key: any, definition: any) => void)
      • (key, definition): void
      • Registers a single basemap definition by key. No map API calls are made at registration time — the definition is stored and applied lazily when setBaseLayer() is called.

        Parameters

        • key: any
        • definition: any

        Returns void

  • registerBaseLayers: ((definitions: any) => void)
      • (definitions): void
      • Parameters

        • definitions: any

        Returns void

  • setBaseLayer: ((key: any, options?: any) => void)
      • (key, options?): void
      • Activates a registered basemap by key.

        For raster basemaps: injects a MapLibre raster source + layer. For vector basemaps: calls map.setStyle(styleUrl).

        If the map style is not yet loaded, activation is deferred until the map emits the load event.

        Parameters

        • key: any
        • options: any = {}

        Returns void

  • setActive: ((key: any, options?: any) => void)
      • (key, options?): void
      • Activates a registered basemap by key.

        For raster basemaps: injects a MapLibre raster source + layer. For vector basemaps: calls map.setStyle(styleUrl).

        If the map style is not yet loaded, activation is deferred until the map emits the load event.

        Parameters

        • key: any
        • options: any = {}

        Returns void

  • getBaseLayers: (() => any)
      • (): any
      • Returns any

  • getActiveKey: (() => null | string)
      • (): null | string
      • Returns null | string

  • getActiveId: (() => null | string)
      • (): null | string
      • Returns null | string

  • getActiveLayer: (() => any)
      • (): any
      • Returns the BasemapConfig definition of the currently active basemap. Returns null when no basemap is active.

        NOTE: unlike the pre-Sprint-3 version, this no longer returns a layer instance. The layer field on each _baseLayers entry is always null and exists only for backward compatibility.

        Returns any

  • destroy: (() => void)
      • (): void
      • Returns void