Create a new tile client bound to the given connector.
Byte-range reader for accessing FGB files. Shared
across all subsequent tile() calls.
Optionaloptions: TileOptions & IoOptions & Pick<RequestOptions, "onTile">
Tile-level tiling option defaults applied to every call
unless overridden by per-source options, plus I/O options (cache,
prefetch, range merging, scan budget) and a default onTile hook.
Release connector resources (pooled connections, file handles, etc.) and the client's own cache.
After calling close(), this client instance must not be used again.
Resolves when the underlying connector has been closed.
Forget what is cached about a file, so the next request re-reads its header and index, e.g. after the file was replaced at the same path. Without a path, every source is reopened from its file (the client's own cache is cleared; in a cache passed as an option, the entries are replaced as the files are read again).
Files with version tags are detected as changed automatically; this is for connectors and servers that report none.
Optionalpath: string
Source path, or omitted for all sources.
Resolves when the entries are removed from the cache.
Open sources ahead of the first tile request: read each file's header and the top of its spatial index and, within the OpenOptions.warmIndex budget, all upper index levels.
Useful during the init phase of a serverless function or at server start-up. Opening is otherwise lazy.
Sources (or a single source) to open.
Optionaloptions: OpenOptions
Index warm-up budget.
Resolves when every source is open.
Generate a vector tile from multiple FlatGeobuf sources.
Each source produces one MVT layer in the output PBF. Layer ordering
matches the order of the sources array.
Tile zoom level.
Tile column.
Tile row.
Array of source descriptors; each becomes one MVT layer.
Optionalrequest: RequestOptions
Optional abort signal and onTile hook (overrides the constructor's).
PBF-encoded Mapbox Vector Tile containing one layer per source.
Generate a vector tile from a single FlatGeobuf source.
Convenience overload that wraps the source in a single-element array and delegates to the multi-source implementation.
Tile zoom level.
Tile column.
Tile row.
Single source descriptor; produces one MVT layer.
Optionalrequest: RequestOptions
Optional abort signal and onTile hook (overrides the constructor's).
PBF-encoded Mapbox Vector Tile containing one layer.
Compute the ETag of a tile without rendering it, e.g. to answer
If-None-Match with 304 Not Modified. It changes whenever a source
file, a setting or the library's tile encoding changes.
Tile zoom level.
Tile column.
Tile row.
The sources (or source) the tile is rendered from.
Optionalrequest: Pick<RequestOptions, "signal">
Optional abort signal.
A strong, quoted ETag, or null when a source's connector
reports no version tag (e.g. an HTTP server without ETag or
Last-Modified).
Semi-stateful tile client.
A single Connector is bound at construction; Source descriptors are provided per
tile()call. File headers and spatial index pages are cached per instance (see IoOptions.cache), so repeated tiles from the same files skip most index reads.Use case: application sharing one HTTP connector (with auth headers) but querying different FGB sources depending on request context.
Example