GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Resolves the data path a layer configuration declares, in either shape.

      Accepts the normalised dataFile as-is when present — a caller that already ran the profile loader must not see its value rebuilt underneath it — and derives it from data.file otherwise.

      Parameters

      • config: LayerDataShape | null | undefined

        A layer configuration, raw from disk or normalised by the profile loader.

      Returns string | null

      The path relative to the layer directory (e.g. "data/sites.geojson"), or null when the layer declares no data file at all — which is legitimate: a tile layer or a layer with a direct url has none.

      layerDataPath({ data: { directory: "data", file: "sites.geojson" } }); // "data/sites.geojson"
      layerDataPath({ data: { file: "sites.geojson" } }); // "data/sites.geojson"
      layerDataPath({ dataFile: "raw/sites.geojson" }); // "raw/sites.geojson"
      layerDataPath({ type: "tile" }); // null