Class PMTiles

Main class encapsulating PMTiles decoding logic.

if source is a string, creates a FetchSource using that string as the URL to a remote PMTiles. if no cache is passed, use a SharedPromiseCache. if no decompress is passed, default to the browser DecompressionStream API with a fallback to fflate.

Constructors

Properties

cache: Cache
decompress: DecompressFunc
source: Source

Methods

  • Return the header of the archive, including information such as tile type, min/max zoom, bounds, and summary statistics.

    Returns Promise<Header>

  • Return the arbitrary JSON metadata of the archive.

    Returns Promise<unknown>

  • Construct a TileJSON object.

    baseTilesUrl is the desired tiles URL, excluding the suffix /{z}/{x}/{y}.{ext}. For example, if the desired URL is http://example.com/tileset/{z}/{x}/{y}.mvt, the baseTilesUrl should be https://example.com/tileset.

    Parameters

    • baseTilesUrl: string

    Returns Promise<unknown>

  • Primary method to get a single tile's bytes from an archive.

    Returns undefined if the tile does not exist in the archive.

    Parameters

    • z: number
    • x: number
    • y: number
    • Optional signal: AbortSignal

    Returns Promise<undefined | RangeResponse>

Generated using TypeDoc