GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Resolves the layer list of a profile.

      The served profile.json does NOT inline a layers array — layers live in a separate file referenced by profile.Files.layersFile (layers.json, shaped { layers: [{ id, configFile, layerManagerId }] }). This helper returns profile.layers when already present (forward-compat with an inlined array), otherwise fetches the referenced file. It never throws: any failure resolves to an empty array.

      Callers pass their own profilesBasePath and leadingSlash/validateUrl so the URL is built with the exact convention their other fetches use (the display path uses a leading slash + base "profiles"; the download path uses a relative base "../profiles" guarded by validateFetchUrl).

      Parameters

      • profile: ProfileWithLayers | null | undefined

        Parsed profile.json object.

      • profileId: string

        Active profile id.

      • profilesBasePath: string

        Base path for profiles (caller's convention).

      • opts: ResolveLayersOptions = {}

        Path/guard options matching the caller's fetch convention.

      Returns Promise<LayerLike[]>

      The resolved layer descriptors (possibly empty).