MVT module · metadata loader
TileJSONLoader
Read TileJSON and tilestats metadata into one typed description of a tile service, including layers, fields, bounds, and tile URL information.
What it returns
Understand a tile service before requesting tiles.
TileJSONLoader combines the service-level document with optional tilestats metadata so applications can inspect available layers and fields before they build a map or source.
Input
TileJSON and optional tilestats
Output
Normalized typed metadata
Includes
Layers, fields, bounds, and tile URLs
Mode
Synchronous metadata parsing
Detailed guide
TileJSONLoader reference
The sections below document the format metadata, usage, returned data, and options.
The TileJSONLoader parses metadata from a TileJSON / tilestats file. It merges layer and field information from both tilestats and TileJSON and returns a strongly typed data structure.
| TileJSONLoader | |
|---|---|
| File Extension | .json |
| File Type | Text |
| File Format | TileJSON |
| Data Format | TileJSON |
| Decoder Type | Synchronous |
| Worker Thread | ❌ No |
| Streaming Support | ❌ No |
Usage
import {TileJSONLoader} from '@loaders.gl/tiles/mvt';
import {load} from '@loaders.gl/core';
const tileJSON = await load(url, TileJSONLoader, options);
Data Format
The returned tiles array preserves the advertised URL templates, including {z}, {x}, and {y} placeholders. Use tileJSON.tiles[0] to obtain the current template from providers that publish versioned tile endpoints.
See TileJSON format.
Options
| Option | Type | Default | Description |
|---|
|