Permalink: {
    init(config: PermalinkConfig): void;
    readAndStore(): void;
    applyStoredState(map: any): void;
    startSync(map: any): void;
    getState(): null | PermalinkState;
    buildUrl(state?: null | PermalinkState): string;
} = ...

Public Permalink facade — bound to GeoLeaf.Permalink.

Type declaration

  • init:function
    • Initialise the Permalink module with the config extracted from the active profile. Must be called before readAndStore().

      Parameters

      • config: PermalinkConfig

        Permalink section of ui.permalink or an empty object.

      Returns void

  • readAndStore:function
  • applyStoredState:function
    • Apply the stored state (from readAndStore) to the given map instance. Must be called after the map and all modules are initialised.

      Parameters

      • map: any

        MapLibre map instance.

      Returns void

  • startSync:function
    • Begin continuous URL synchronisation on map move/zoom events. Call this after applyStoredState to avoid overwriting the restored state.

      Parameters

      • map: any

        MapLibre map instance.

      Returns void

  • getState:function
    • Return the currently cached permalink state (read-only). Returns null if readAndStore was not called or found no permalink in the URL.

      Returns null | PermalinkState

  • buildUrl:function
    • Serialise state (or the cached stored state) to a URL fragment / query string.

      Parameters

      • Optionalstate: null | PermalinkState

        Optional explicit state. Falls back to _storedState.

      Returns string

      URL string starting with # or ?, or empty string if no state.