GeoLeaf Core API - v3.0.0
    Preparing search index...
    ProfileLoader: {
        loadModularProfile(
            profile: ProfileWithFiles,
            baseUrl: string,
            profileId: string,
            timestamp?: number,
            fetchOptions?: LoadUrlOptions,
            skipBundle?: boolean,
        ): Promise<Record<string, unknown>>;
        _loadThemes(
            profile: ProfileWithFiles,
            baseUrl: string,
            timestamp: number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadLayersFile(
            profile: ProfileWithFiles,
            baseUrl: string,
            timestamp: number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadSectionFile(
            profile: ProfileWithFiles,
            fileKey:
                | "modules"
                | "themesFile"
                | "layersFile"
                | "basemapsFile"
                | "uiFile"
                | "featuresFile"
                | "mappingFile",
            baseUrl: string,
            timestamp: number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadModuleFiles(
            profile: ProfileWithFiles,
            baseUrl: string,
            timestamp: number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadLayerConfigs(
            layersSource: LayerRef[],
            baseUrl: string,
            timestamp: number,
            fetchOptions: LoadUrlOptions,
        ): Promise<LayerConfigResult[]>;
        _loadBundledProfile(
            profile: ProfileWithFiles,
            baseUrl: string,
            profileId: string,
            bundleFile: string,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown>>;
        _processBundle(
            bundle: Record<string, unknown>,
            profile: ProfileWithFiles,
            baseUrl: string,
            profileId: string,
        ): Record<string, unknown>;
        _mergeAndExpand(
            profile: ProfileWithFiles,
            profileId: string,
            parts: {
                basemaps?: Record<string, unknown> | null;
                ui?: Record<string, unknown> | null;
                features?: Record<string, unknown> | null;
                modulesBag?: Record<string, unknown> | null;
                layersFileData: Record<string, unknown> | null;
            },
        ): { mergedProfile: ProfileWithFiles; expandedLayers: LayerRef[] };
        _buildEnrichedProfile(
            params: EnrichedProfileParams,
        ): Record<string, unknown>;
        _validateProfile(profile: Record<string, unknown>, profileId: string): void;
        isModularProfile(profile: unknown): boolean;
    } = ...

    Type Declaration

    • loadModularProfile: function
      • Loads and hydrates a modular GeoLeaf profile by fetching the themes, layers, basemaps, ui, features and mapping files, the per-module files, and the individual layer configs.

        ⚠️ Taxonomy is NOT one of them: it is a module since the Lot 2 removal (11/07/2026) and travels through Files.modules.taxonomy like any other plugin block. The manifest has no dedicated taxonomy path entry any more, and never had an icons one; icons live under the taxonomy module's own icons.spriteUrl. The retired manifest key is a banned token in extracted-features.guard.test.js — deliberately not spelled out here.

        Parameters

        • profile: ProfileWithFiles

          The base profile object (Files manifest, or inline themes/layers properties).

        • baseUrl: string

          Base URL for resolving relative file paths.

        • profileId: string

          Identifier used for logging and the enriched profile metadata.

        • timestamp: number = ...

          Cache-busting timestamp appended to fetch URLs. Defaults to Date.now().

        • fetchOptions: LoadUrlOptions = {}

          Optional fetch configuration (headers, strictContentType).

        • skipBundle: boolean = false

          When true (debug mode), ignores profile.bundleFile and loads the modular cascade — section edits in a deployed profile are picked up without a rebuild.

        Returns Promise<Record<string, unknown>>

        The enriched profile record with resolved themes, mapping, and layer configs.

    • _loadThemes: function
      • Fetches the themes file or returns the inline themes from the profile.

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • baseUrl: string

          Base URL for resolving the themes file path.

        • timestamp: number

          Cache-busting timestamp.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The themes record, or null if unavailable.

    • _loadLayersFile: function
      • Fetches the layers index file defined in profile.Files.layersFile.

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • baseUrl: string

          Base URL for resolving the layers file path.

        • timestamp: number

          Cache-busting timestamp.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The layers file record, or null if no layersFile is defined.

    • _loadSectionFile: function
      • Fetches an optional section file referenced in profile.Files (e.g. basemapsFile, uiFile). Returns null silently if the file is not declared or fails to load.

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • fileKey:
              | "modules"
              | "themesFile"
              | "layersFile"
              | "basemapsFile"
              | "uiFile"
              | "featuresFile"
              | "mappingFile"

          Key in profile.Files pointing to the section file name.

        • baseUrl: string

          Base URL for resolving the file path.

        • timestamp: number

          Cache-busting timestamp.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The section record, or null if unavailable.

    • _loadModuleFiles: function
      • Fetches every plugin config file declared in Files.modules (profile layout v2) and returns the resulting bag { moduleId: config }. Files are fetched in parallel; a missing or invalid file logs a warning and is skipped (the module simply has no file-based config).

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • baseUrl: string

          Base URL for resolving plugin config file paths.

        • timestamp: number

          Cache-busting timestamp.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The module config bag, or null when Files.modules is absent/empty.

    • _loadLayerConfigs: function
      • Fetches individual layer configuration files for each layer reference. Supports inline configs generated from template expansion (no HTTP fetch).

        Parameters

        • layersSource: LayerRef[]

          Array of layer references with optional configFile or inlineConfig.

        • baseUrl: string

          Base URL for resolving layer config file paths.

        • timestamp: number

          Cache-busting timestamp.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<LayerConfigResult[]>

        Array of layer config results with resolved config objects and layer directories.

    • _loadBundledProfile: function
      • Loads and hydrates a profile from a pre-built bundle file, replacing the ~19-request cascade with a single HTTP fetch.

        Called automatically by loadModularProfile() when profile.bundleFile is set. The bundle must have been generated at build time by scripts/bundle-profiles.cjs.

        Parameters

        • profile: ProfileWithFiles

          The base profile object (already loaded from profile.json).

        • baseUrl: string

          Base URL for resolving the bundle file path.

        • profileId: string

          Identifier used for logging and metadata.

        • bundleFile: string

          Filename of the bundle (e.g. "profile-bundle.json").

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown>>

        The enriched profile record, equivalent to the result of loadModularProfile().

    • _processBundle: function
      • Assembles the enriched profile from an already-fetched bundle payload.

        Parameters

        • bundle: Record<string, unknown>
        • profile: ProfileWithFiles
        • baseUrl: string
        • profileId: string

        Returns Record<string, unknown>

    • _mergeAndExpand: function
      • Shared assembly tail for both load paths: spreads section-file data into the profile, merges the plugin-config bag, validates, then expands layer templates.

        Parameters

        • profile: ProfileWithFiles
        • profileId: string
        • parts: {
              basemaps?: Record<string, unknown> | null;
              ui?: Record<string, unknown> | null;
              features?: Record<string, unknown> | null;
              modulesBag?: Record<string, unknown> | null;
              layersFileData: Record<string, unknown> | null;
          }

        Returns { mergedProfile: ProfileWithFiles; expandedLayers: LayerRef[] }

    • _buildEnrichedProfile: function
      • Assembles the final enriched profile from all fetched sub-resources.

        ⚠️ The keys it sets are exactly: basePath, _profileId, themes, mapping, layers (plus the spread of the base profile). Notably NOT taxonomy and NOT icons — readers expecting either on the active profile get undefined, silently. That was bug C-8 (AddPOI category lists, fixed 16/07): consume the capability (GeoLeaf.Taxonomy.getLayerCategories) or the offline seam (CacheStorage.loadProfileConfig, which hydrates icons from Files.modules.taxonomy). Adding a key here means feeding it too — declaring one the loader never populates is precisely how the sprite went uncached for months (C-7).

        Parameters

        • params: EnrichedProfileParams

          Object containing the base profile, themes, mapping, layersSource, and layersConfigs.

        Returns Record<string, unknown>

        The enriched profile record with resolved layers, themes, mapping, and metadata.

    • _validateProfile: function
      • Validates a loaded profile object against minimum structural requirements. Logs warnings for each violation — non-blocking, does not throw.

        Checks: required id, map.bounds recommended, Files keys are strings, layers is an array if present.

        Parameters

        • profile: Record<string, unknown>

          The raw profile object to validate.

        • profileId: string

          Identifier used in warning messages.

        Returns void

    • isModularProfile: function
      • Determines whether a profile uses the modular format (has Files object or version ≥ 1.2).

        Parameters

        • profile: unknown

          The profile object to inspect.

        Returns boolean

        true if the profile is modular, false otherwise.