GeoLeaf Core API - v3.0.0
    Preparing search index...
    Permalink: {
        init(config: PermalinkConfig): void;
        readAndStore(): void;
        applyStoredState(map: IMapAdapter): void;
        startSync(map: IMapAdapter): void;
        stopSync(): void;
        getState(): PermalinkState | null;
        buildUrl(state?: PermalinkState | null): string;
        isEnabled(): boolean;
        getConfig(): PermalinkConfig;
    } = ...

    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

        GeoLeaf.Permalink.init({ enabled: true, mode: "hash" });
        
    • readAndStore: function
      • Read the current URL and cache the parsed state. Call this before map creation so the stored state is available for applyStoredState.

        Returns void

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

        ⚠️ A null therefore means two different things — the page was not opened through a permalink, or Permalink.readAndStore has not run yet. Only the boot order tells them apart.

        Returns PermalinkState | null

        const state = GeoLeaf.Permalink.getState();
        // → { lat: 48.857, lng: 2.347, zoom: 13, layers: [], filter: "café" }
        // → null
    • buildUrl: function
      • Serialise state (or the cached stored state) to a URL fragment / query string.

        Parameters

        • Optionalstate: PermalinkState | null

          Optional explicit state. Falls back to _storedState.

        Returns string

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

        // Current stored state
        const url = GeoLeaf.Permalink.buildUrl();
        // → "#gl_lat=48.857445&gl_lng=2.347211&gl_zoom=13"
        // Un lien partageable complet — le fragment seul ne suffit pas.
        const permalinkUrl =
        window.location.origin + window.location.pathname + GeoLeaf.Permalink.buildUrl();
    • isEnabled: function
    • getConfig: function