GeoLeaf Core API - v3.0.0
    Preparing search index...
    LayerManager: {
        init(options?: Partial<LayerManagerOptions>): LMControlInstance | null;
        _registerGeoJsonLayer(
            layerId: string,
            options?: RegisterLayerOptions,
        ): void;
        refresh(immediate?: boolean): void;
        _reset(): void;
    } = LayerManagerModule

    Type Declaration

    • init: function
      • Mounts the layer-manager panel.

        Called without arguments, everything comes from the profile configuration — the recommended path. Anything passed here overrides that, field by field.

        Parameters

        • options: Partial<LayerManagerOptions> = {}

          Position, title, and collapsible/collapsed state.

        Returns LMControlInstance | null

        // Initialisation depuis config (recommandé)
        GeoLeaf.LayerManager.init();

        // Avec options personnalisées
        GeoLeaf.LayerManager.init({
        position: "bottomleft",
        collapsible: true,
        collapsed: false,
        title: "Couches",
        });
    • _registerGeoJsonLayer: function
      • Registers a GeoJSON layer in the legend

        Parameters

        • layerId: string

          The layer id

        • options: RegisterLayerOptions = {}

          Layer options

        Returns void

    • refresh: function
      • Redraws the panel to match the current layer state.

        Debounced by default, so a burst of layer changes costs one redraw. Passing immediate cancels any pending debounce and redraws synchronously — needed when the caller is about to read the rendered DOM.

        A no-op, logged at debug, when the control is not yet mounted (early boot).

        Parameters

        • immediate: boolean = false

          Skip the debounce and redraw now. Defaults to false.

        Returns void

        // Rafraîchissement debouncé (groupé par défaut)
        GeoLeaf.LayerManager.refresh();

        // Rafraîchissement immédiat
        GeoLeaf.LayerManager.refresh(true);
    • _reset: function
      • Resets the module back to its post-import state.

        Run on map teardown so the control, the map handle and the accumulated sections do not survive a destroy → recreate cycle. A pending debounced refresh is cancelled too: its callback closes over the old control and would fire against a detached DOM node.

        Idempotent — safe to call more than once.

        Returns void