Skip to main content

MLTSource

From-v4.4

The MLTSource dynamically loads MapLibre Tile (.mlt) data from URL based tile services.

SourceCharacteristic
File Extension.mlt
File TypeBinary Archive
File FormatMapLibre Tile
Data FormatGeoJSON

Usage​

import {createDataSource} from '@loaders.gl/core';
import {MLTSource} from '@loaders.gl/mlt';

const source = createDataSource('https://example.com/tiles', [MLTSource]);
const features = await source.getTile({x: 0, y: 0, z: 0});

Options​

| Option | Type | Default | Description | | ----------------- | ------------------- | ------------ | ----------------------------------------------- | ----------------------------------------------------------------------- | ------------------------ | | mlt.extension | string | .mlt | Tile URL extension. | | mlt.metadataUrl | string \\ | null | null | Optional metadata URL override (tile.json by default is not assumed). | | mlt.coordinates | 'wgs84' \\ | 'local' | wgs84 | Coordinates output from parsed tiles. | | mlt.shape | 'geojson-table' \\ | 'geojson' \\ | 'binary' | geojson | Returned geometry shape. | | mlt.layers | string[] | N/A | Optional layer filter before decoding geometry. |

Additional references​

Attribution​

MLTSource fetches URL-addressed MLT tiles and parses them via MLTLoader, which uses the @maplibre/mlt decoder implementation.