MLT API · vector tiles
Decode a compact tile into application data.
MLTLoader parses a MapLibre Tile payload and exposes its feature tables as an Arrow table with GeoArrow geometry by default, with GeoJSON and binary geometry available when requested.
The MLT loader path
Decode bytes first. Choose coordinates at the edge.
MLTLoader keeps binary tile decoding separate from tile addressing. The same payload can stay in local tile space for rendering or be converted to WGS84 when the tile index is available.
Input
One MapLibre Tile binary payload
Tables
Named feature tables with geometry and attributes
Output
Arrow table with GeoArrow geometry by default
Coordinates
Local tile space by default; WGS84 is optional
Detailed guide
MLTLoader reference
The sections below document installation, output shapes, coordinate options, tile indexes, and parser behavior.
Loader for the MapLibre Tile (MLT) geospatial tile format.
| MLTLoader | |
|---|---|
| File Extension | .mlt |
| File Type | Binary |
| File Format | MapLibre Tile |
| MIME Types | application/vnd.maplibre-tile |
| Data Format | Geometry |
| Data source | MLTTileSource |
| Supported APIs | load, parse, parseSync |
| Worker Thread | Not available for this loader |
Installation
npm install @loaders.gl/tiles
npm install @loaders.gl/core
Usage
import {MLTLoader} from '@loaders.gl/tiles/mlt';
import {load} from '@loaders.gl/core';
const tileFeatures = await load(url, MLTLoader);
Geometry in local tile space
By default, MLTLoader returns an Arrow table with a WKB-compatible GeoArrow geometry column using
local tile coordinates in [0, 1] space:
import {MLTLoader} from '@loaders.gl/tiles/mlt';
import {load} from '@loaders.gl/core';
const arrowTable = await load(url, MLTLoader);
Geometry in WGS84
Set coordinates: 'wgs84' and provide the tile index to get longitude / latitude coordinates:
import {MLTLoader} from '@loaders.gl/tiles/mlt';
import {load} from '@loaders.gl/core';
const geoJSONfeatures = await load(url, MLTLoader, {
mlt: {
coordinates: 'wgs84',
tileIndex: {
x: tileX,
y: tileY,
z: tileZ
}
}
});
Output shapes
shape option | Output |
|---|---|
'arrow' (default) | Arrow table with GeoArrow geometry |
'binary-geometry' | binary feature collection |
'geojson-table' | GeoJSONTable |
Options
| Option | Type | Default | Description |
|---|---|---|---|
mlt.shape | 'geojson-table' | 'binary-geometry' | 'arrow' | arrow | Output shape |
geoarrow.encodingPreference | 'geoarrow.wkb' | 'geoarrow.geometry' | 'optimized' | geoarrow.wkb for Arrow output | Arrow geometry encoding preference |
mlt.coordinates | 'local' | 'wgs84' | local | Coordinate system for returned geometries |
mlt.tileIndex | {x: number, y: number, z: number} | N/A | Required when coordinates is wgs84 |
mlt.layerProperty | string | layerName | Name of layer property added to feature properties |
mlt.layers | string[] | N/A | Restrict parsing to specific tile layers |
mlt.tileIndex is required for WGS84 output.
When mlt.shape is 'arrow' (the default), the decoder writes directly from MLT's decoded
geometry and property columns. It does not materialize an intermediate GeoJSON feature collection. Use
geoarrow.encodingPreference to select WKB, dense-union GeoArrow, or the optimized native
GeoArrow encoding.
To preserve the legacy GeoJSON default, set mlt.shape: 'geojson-table' explicitly.
Additional examples
- loaders.gl MLT website example.
- MLTLoader for URL tile sets.
Attribution
MLTLoader implements loaders.gl integration, GeoJSON table and binary geometry shaping, and coordinate projection around the @maplibre/mlt decoder and the MapLibre Tile specification.