Implement MLT (#633)

* Add MLT tile type

* MLT code implementation

* fix build - /app needs to wait for new pmtiles version on npm

* update CHANGELOGs and python, js versions [#596, #633]

---------

Co-authored-by: Michael Barry <msbarry@users.noreply.github.com>
Co-authored-by: Brandon Liu <bdon@users.noreply.github.com>
Co-authored-by: Brandon Liu <bdon@bdon.org>
This commit is contained in:
Anson Chung
2026-02-04 06:24:42 +08:00
committed by GitHub
parent 0077eacdff
commit 6f6c9c8697
13 changed files with 19 additions and 8 deletions

View File

@@ -1,3 +1,6 @@
4.4.0
* add [MapLibre Vector Tile](https://github.com/maplibre/maplibre-tile-spec) `.mlt` support by @anscg [#633]
4.3.2
* fix leafletRasterLayer empty images: set `display: none`

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.0/dist/leaflet.js"></script>
<script src="https://unpkg.com/pmtiles@4.3.2/dist/pmtiles.js"></script>
<script src="https://unpkg.com/pmtiles@4.4.0/dist/pmtiles.js"></script>
<style>
body, #map {
height:100vh;

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.13.0/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/maplibre-gl@5.13.0/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/pmtiles@4.3.2/dist/pmtiles.js"></script>
<script src="https://unpkg.com/pmtiles@4.4.0/dist/pmtiles.js"></script>
<style>
body {
margin: 0;

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.13.0/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/maplibre-gl@5.13.0/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/pmtiles@4.3.2/dist/pmtiles.js"></script>
<script src="https://unpkg.com/pmtiles@4.4.0/dist/pmtiles.js"></script>
<style>
body {
margin: 0;

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.13.0/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/maplibre-gl@5.13.0/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/pmtiles@4.3.2/dist/pmtiles.js"></script>
<script src="https://unpkg.com/pmtiles@4.4.0/dist/pmtiles.js"></script>
<style>
body {
margin: 0;

4
js/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "pmtiles",
"version": "4.3.2",
"version": "4.4.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "pmtiles",
"version": "4.3.2",
"version": "4.4.0",
"license": "BSD-3-Clause",
"dependencies": {
"fflate": "^0.8.2"

View File

@@ -1,6 +1,6 @@
{
"name": "pmtiles",
"version": "4.3.2",
"version": "4.4.0",
"description": "PMTiles archive decoder for browsers",
"type": "module",
"main": "dist/cjs/index.cjs",

View File

@@ -205,6 +205,7 @@ export enum TileType {
Jpeg = 3,
Webp = 4,
Avif = 5,
Mlt = 6,
}
export function tileTypeExt(t: TileType): string {
@@ -213,6 +214,7 @@ export function tileTypeExt(t: TileType): string {
if (t === TileType.Jpeg) return ".jpg";
if (t === TileType.Webp) return ".webp";
if (t === TileType.Avif) return ".avif";
if (t === TileType.Mlt) return ".mlt";
return "";
}

View File

@@ -350,6 +350,7 @@ describe("pmtiles v3", () => {
assert.equal(".jpg", tileTypeExt(TileType.Jpeg));
assert.equal(".webp", tileTypeExt(TileType.Webp));
assert.equal(".avif", tileTypeExt(TileType.Avif));
assert.equal(".mlt", tileTypeExt(TileType.Mlt));
});
interface TileJsonLike {