mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
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:
@@ -18,6 +18,7 @@ const uint8_t TILETYPE_PNG = 0x2;
|
||||
const uint8_t TILETYPE_JPEG = 0x3;
|
||||
const uint8_t TILETYPE_WEBP = 0x4;
|
||||
const uint8_t TILETYPE_AVIF = 0x5;
|
||||
const uint8_t TILETYPE_MLT = 0x6;
|
||||
|
||||
const uint8_t COMPRESSION_UNKNOWN = 0x0;
|
||||
const uint8_t COMPRESSION_NONE = 0x1;
|
||||
|
||||
@@ -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`
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,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,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
4
js/package-lock.json
generated
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 "";
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -126,6 +126,7 @@ class TileType(Enum):
|
||||
JPEG = 3
|
||||
WEBP = 4
|
||||
AVIF = 5
|
||||
MLT = 6
|
||||
|
||||
|
||||
def deserialize_directory(buf):
|
||||
|
||||
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
||||
|
||||
setuptools.setup(
|
||||
name="pmtiles",
|
||||
version="3.5.0",
|
||||
version="3.6.0",
|
||||
author="Brandon Liu",
|
||||
author_email="brandon@protomaps.com",
|
||||
description="Library and utilities to write and read PMTiles archives - cloud-optimized archives of map tiles.",
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## Version 3.5
|
||||
- add [MapLibre Vector Tile](https://github.com/maplibre/maplibre-tile-spec) `.mlt` enum by @msbarry [#596]
|
||||
|
||||
## Version 3.4
|
||||
- Clarify that entry lengths must be > 0.
|
||||
- Add details about ordering of leaf directories.
|
||||
|
||||
Reference in New Issue
Block a user