Skip to main content

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.

From-v4.4

Loader for the MapLibre Tile (MLT) geospatial tile format.

MLTLoader
File Extension.mlt
File TypeBinary
File FormatMapLibre Tile
MIME Typesapplication/vnd.maplibre-tile
Data FormatGeometry
Data sourceMLTTileSource
Supported APIsload, parse, parseSync
Worker ThreadNot 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 optionOutput
'arrow' (default)Arrow table with GeoArrow geometry
'binary-geometry'binary feature collection
'geojson-table'GeoJSONTable

Options​

OptionTypeDefaultDescription
mlt.shape'geojson-table' | 'binary-geometry' | 'arrow'arrowOutput shape
geoarrow.encodingPreference'geoarrow.wkb' | 'geoarrow.geometry' | 'optimized'geoarrow.wkb for Arrow outputArrow geometry encoding preference
mlt.coordinates'local' | 'wgs84'localCoordinate system for returned geometries
mlt.tileIndex{x: number, y: number, z: number}N/ARequired when coordinates is wgs84
mlt.layerPropertystringlayerNameName of layer property added to feature properties
mlt.layersstring[]N/ARestrict 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​

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.