GeoLeaf Core API - v3.0.0
    Preparing search index...
    StyleResolver: {
        GLYPH_RANGES: string[];
        enumerate(
            styleUrl: string,
            zone: ResolverZone | null,
        ): Promise<StyleResource[]>;
        _fetchJson<T>(url: string): Promise<T | null>;
        _fetchStyle(styleUrl: string): Promise<MapLibreStyle | null>;
        _enumerateVectorTiles(
            style: MapLibreStyle,
            styleUrl: string,
            zone: ResolverZone,
        ): Promise<StyleResource[]>;
        _enumerateGlyphs(style: MapLibreStyle, styleUrl: string): StyleResource[];
        _enumerateSprite(style: MapLibreStyle, styleUrl: string): StyleResource[];
        _resolveUrl(maybeRelative: string, baseUrl: string): string;
    } = ...

    Type Declaration

    • GLYPH_RANGES: string[]

      Glyph ranges cached per fontstack. Each range is a 256-codepoint block:

      • 0-255 : Basic Latin + Latin-1 Supplement (French accents é è à ç)
      • 256-511 : Latin Extended-A / B
      • 768-1023: Combining diacritics + Greek/Cyrillic start Covers French/European labels without caching all 256 ranges. Tunable.
    • enumerate: function
      • Enumerates every offline resource for a MapLibre vector style. Network failures degrade gracefully (a sub-step returning nothing never aborts the others); the caller decides whether the partial set is usable.

        Parameters

        • styleUrl: string

          Absolute URL of the style JSON.

        • zone: ResolverZone | null

          bbox + zoom ceiling chosen by the user (null → tiles skipped).

        Returns Promise<StyleResource[]>

    • _fetchJson: function
      • Fetches and parses a JSON document, returning null on any failure.

        The URL is scheme-guarded first. This is not defence in depth: _fetchJson is called BOTH with the style URL from config AND with source.url read out of that fetched style — i.e. with remote content. A hostile style could therefore point source.url at javascript:/data: and have it fetched (CAPACITÉS B.10).

        A refusal is logged and mapped to null, like every other failure here: the enumeration of the other sources must not abort over one poisoned entry. Same shape as cache/metrics.ts:_fetchHeadContentLengths.

        Type Parameters

        • T

        Parameters

        • url: string

        Returns Promise<T | null>

    • _fetchStyle: function
    • _enumerateVectorTiles: function
      • Resolves each vector source to a tile template + source maxzoom, then enumerates the .pbf URLs over the zone. Caps maxZoom at the source maxzoom so MapLibre overzooms from there (no requests for non-existent tiles).

        Parameters

        Returns Promise<StyleResource[]>

    • _enumerateGlyphs: function
      • Enumerates glyph ranges for every fontstack used by the style's layers. MapLibre requests {fontstack} URL-encoded and {range} as a 256-block; the cached key must byte-match that request.

        Parameters

        • style: MapLibreStyle
        • styleUrl: string

        Returns StyleResource[]

    • _enumerateSprite: function
      • Enumerates the sprite sheet: .json + .png, plus optional @2x variants (the runtime devicePixelRatio is unknown at download time).

        Parameters

        • style: MapLibreStyle
        • styleUrl: string

        Returns StyleResource[]

    • _resolveUrl: function