Class S2PMTilesReader

The File reader is to be used by bun/node/deno on the local filesystem.

Constructors

Properties

Methods

Constructors

  • Given an input path, read in the header and root directory

    Parameters

    • path: string | Reader

      the location of the PMTiles data

    • rangeRequests: boolean = false

      FetchReader specific; enable range requests or use urlParam "bytes"

    • maxSize: number = 20

      the max size of the cache before dumping old data. Defaults to 20.

    Returns S2PMTilesReader

Properties

path: string | Reader

the location of the PMTiles data

Methods

  • Returns Promise<Header>

    • the header of the archive
  • Returns Promise<Metadata>

    • the metadata of the archive
  • Parameters

    • zoom: number

      the zoom level of the tile

    • x: number

      the x coordinate of the tile

    • y: number

      the y coordinate of the tile

    Returns Promise<undefined | Uint8Array>

    • the bytes of the tile at the given (z, x, y) coordinates, or undefined if the tile does not exist in the archive.
  • Parameters

    • face: Face

      the Open S2 projection face

    • zoom: number

      the zoom level of the tile

    • x: number

      the x coordinate of the tile

    • y: number

      the y coordinate of the tile

    Returns Promise<undefined | Uint8Array>

    • the bytes of the tile at the given (face, zoom, x, y) coordinates, or undefined if the tile does not exist in the archive.