styled-map-package-api 5.0.0-pre.2 → 5.0.0-pre.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/download.d.cts +1 -1
- package/dist/download.d.ts +1 -1
- package/dist/from-mbtiles.cjs +24 -5
- package/dist/from-mbtiles.js +24 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/reader.d.cts +1 -1
- package/dist/reader.d.ts +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/style-downloader.d.cts +1 -1
- package/dist/style-downloader.d.ts +1 -1
- package/dist/tile-downloader.d.cts +1 -1
- package/dist/tile-downloader.d.ts +1 -1
- package/dist/{types-qfyJk4ot.d.cts → types-Bhn0-Ldk.d.cts} +1 -0
- package/dist/{types-qfyJk4ot.d.ts → types-Bhn0-Ldk.d.ts} +1 -0
- package/dist/utils/file-formats.d.cts +1 -1
- package/dist/utils/file-formats.d.ts +1 -1
- package/dist/utils/style.d.cts +1 -1
- package/dist/utils/style.d.ts +1 -1
- package/dist/utils/templates.d.cts +1 -1
- package/dist/utils/templates.d.ts +1 -1
- package/dist/writer.d.cts +1 -1
- package/dist/writer.d.ts +1 -1
- package/package.json +1 -1
package/dist/download.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GlyphDownloadStats } from './style-downloader.cjs';
|
|
2
2
|
import { TileDownloadStats } from './tile-downloader.cjs';
|
|
3
|
-
import { D as DownloadStream } from './types-
|
|
3
|
+
import { D as DownloadStream } from './types-Bhn0-Ldk.cjs';
|
|
4
4
|
import { BBox } from './utils/geo.cjs';
|
|
5
5
|
import 'ky';
|
|
6
6
|
import '@maplibre/maplibre-gl-style-spec';
|
package/dist/download.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GlyphDownloadStats } from './style-downloader.js';
|
|
2
2
|
import { TileDownloadStats } from './tile-downloader.js';
|
|
3
|
-
import { D as DownloadStream } from './types-
|
|
3
|
+
import { D as DownloadStream } from './types-Bhn0-Ldk.js';
|
|
4
4
|
import { BBox } from './utils/geo.js';
|
|
5
5
|
import 'ky';
|
|
6
6
|
import '@maplibre/maplibre-gl-style-spec';
|
package/dist/from-mbtiles.cjs
CHANGED
|
@@ -22,6 +22,7 @@ __export(from_mbtiles_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(from_mbtiles_exports);
|
|
24
24
|
var import_mbtiles_reader = require("mbtiles-reader");
|
|
25
|
+
var import_misc = require('./utils/misc.cjs');
|
|
25
26
|
var import_streams = require('./utils/streams.cjs');
|
|
26
27
|
var import_writer = require('./writer.cjs');
|
|
27
28
|
const SOURCE_ID = "mbtiles-source";
|
|
@@ -35,13 +36,26 @@ function fromMBTiles(source) {
|
|
|
35
36
|
if (reader.metadata.format === "pbf") {
|
|
36
37
|
throw new Error("Vector MBTiles are not yet supported");
|
|
37
38
|
}
|
|
39
|
+
const {
|
|
40
|
+
name,
|
|
41
|
+
minzoom,
|
|
42
|
+
maxzoom,
|
|
43
|
+
scheme,
|
|
44
|
+
attribution,
|
|
45
|
+
description,
|
|
46
|
+
version: tilesetVersion
|
|
47
|
+
} = reader.metadata;
|
|
38
48
|
const style = {
|
|
39
49
|
version: 8,
|
|
40
|
-
name
|
|
50
|
+
name,
|
|
41
51
|
sources: {
|
|
42
52
|
[SOURCE_ID]: {
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
type: "raster",
|
|
54
|
+
tileSize: 256,
|
|
55
|
+
minzoom,
|
|
56
|
+
maxzoom,
|
|
57
|
+
scheme,
|
|
58
|
+
attribution
|
|
45
59
|
}
|
|
46
60
|
},
|
|
47
61
|
layers: [
|
|
@@ -62,6 +76,12 @@ function fromMBTiles(source) {
|
|
|
62
76
|
}
|
|
63
77
|
]
|
|
64
78
|
};
|
|
79
|
+
if (description || tilesetVersion) {
|
|
80
|
+
style.metadata = {
|
|
81
|
+
"mbtiles:description": description,
|
|
82
|
+
"mbtiles:version": tilesetVersion
|
|
83
|
+
};
|
|
84
|
+
}
|
|
65
85
|
const writer = new import_writer.Writer(style);
|
|
66
86
|
outputReader = writer.outputStream.getReader();
|
|
67
87
|
conversionDone = (async () => {
|
|
@@ -92,8 +112,7 @@ function fromMBTiles(source) {
|
|
|
92
112
|
pipeAbort.abort(reason);
|
|
93
113
|
await conversionDone;
|
|
94
114
|
await /** @type {ReadableStreamDefaultReader<Uint8Array>} */
|
|
95
|
-
outputReader.cancel(reason).catch(
|
|
96
|
-
});
|
|
115
|
+
outputReader.cancel(reason).catch(import_misc.noop);
|
|
97
116
|
}
|
|
98
117
|
});
|
|
99
118
|
}
|
package/dist/from-mbtiles.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MBTiles } from "mbtiles-reader";
|
|
2
|
+
import { noop } from "./utils/misc.js";
|
|
2
3
|
import { readableFromAsync } from "./utils/streams.js";
|
|
3
4
|
import { Writer } from "./writer.js";
|
|
4
5
|
const SOURCE_ID = "mbtiles-source";
|
|
@@ -12,13 +13,26 @@ function fromMBTiles(source) {
|
|
|
12
13
|
if (reader.metadata.format === "pbf") {
|
|
13
14
|
throw new Error("Vector MBTiles are not yet supported");
|
|
14
15
|
}
|
|
16
|
+
const {
|
|
17
|
+
name,
|
|
18
|
+
minzoom,
|
|
19
|
+
maxzoom,
|
|
20
|
+
scheme,
|
|
21
|
+
attribution,
|
|
22
|
+
description,
|
|
23
|
+
version: tilesetVersion
|
|
24
|
+
} = reader.metadata;
|
|
15
25
|
const style = {
|
|
16
26
|
version: 8,
|
|
17
|
-
name
|
|
27
|
+
name,
|
|
18
28
|
sources: {
|
|
19
29
|
[SOURCE_ID]: {
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
type: "raster",
|
|
31
|
+
tileSize: 256,
|
|
32
|
+
minzoom,
|
|
33
|
+
maxzoom,
|
|
34
|
+
scheme,
|
|
35
|
+
attribution
|
|
22
36
|
}
|
|
23
37
|
},
|
|
24
38
|
layers: [
|
|
@@ -39,6 +53,12 @@ function fromMBTiles(source) {
|
|
|
39
53
|
}
|
|
40
54
|
]
|
|
41
55
|
};
|
|
56
|
+
if (description || tilesetVersion) {
|
|
57
|
+
style.metadata = {
|
|
58
|
+
"mbtiles:description": description,
|
|
59
|
+
"mbtiles:version": tilesetVersion
|
|
60
|
+
};
|
|
61
|
+
}
|
|
42
62
|
const writer = new Writer(style);
|
|
43
63
|
outputReader = writer.outputStream.getReader();
|
|
44
64
|
conversionDone = (async () => {
|
|
@@ -69,8 +89,7 @@ function fromMBTiles(source) {
|
|
|
69
89
|
pipeAbort.abort(reason);
|
|
70
90
|
await conversionDone;
|
|
71
91
|
await /** @type {ReadableStreamDefaultReader<Uint8Array>} */
|
|
72
|
-
outputReader.cancel(reason).catch(
|
|
73
|
-
});
|
|
92
|
+
outputReader.cancel(reason).catch(noop);
|
|
74
93
|
}
|
|
75
94
|
});
|
|
76
95
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SMPSource$1, a as SMPStyle$1 } from './types-
|
|
2
|
-
export { W as Writer } from './types-
|
|
1
|
+
import { S as SMPSource$1, a as SMPStyle$1 } from './types-Bhn0-Ldk.cjs';
|
|
2
|
+
export { W as Writer } from './types-Bhn0-Ldk.cjs';
|
|
3
3
|
export { Reader } from './reader.cjs';
|
|
4
4
|
export { createServer } from './server.cjs';
|
|
5
5
|
export { StyleDownloader } from './style-downloader.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SMPSource$1, a as SMPStyle$1 } from './types-
|
|
2
|
-
export { W as Writer } from './types-
|
|
1
|
+
import { S as SMPSource$1, a as SMPStyle$1 } from './types-Bhn0-Ldk.js';
|
|
2
|
+
export { W as Writer } from './types-Bhn0-Ldk.js';
|
|
3
3
|
export { Reader } from './reader.js';
|
|
4
4
|
export { createServer } from './server.js';
|
|
5
5
|
export { StyleDownloader } from './style-downloader.js';
|
package/dist/reader.d.cts
CHANGED
package/dist/reader.d.ts
CHANGED
package/dist/server.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RequestLike } from 'itty-router';
|
|
2
2
|
import { Reader } from './reader.cjs';
|
|
3
3
|
import { IttyRouter } from 'itty-router/IttyRouter';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-Bhn0-Ldk.cjs';
|
|
5
5
|
import '@maplibre/maplibre-gl-style-spec';
|
|
6
6
|
import 'geojson';
|
|
7
7
|
import 'type-fest';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RequestLike } from 'itty-router';
|
|
2
2
|
import { Reader } from './reader.js';
|
|
3
3
|
import { IttyRouter } from 'itty-router/IttyRouter';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-Bhn0-Ldk.js';
|
|
5
5
|
import '@maplibre/maplibre-gl-style-spec';
|
|
6
6
|
import 'geojson';
|
|
7
7
|
import 'type-fest';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ky from 'ky';
|
|
2
2
|
import { BBox } from './utils/geo.cjs';
|
|
3
|
-
import { b as StyleInlinedSources, G as GlyphInfo, T as TileInfo } from './types-
|
|
3
|
+
import { b as StyleInlinedSources, G as GlyphInfo, T as TileInfo } from './types-Bhn0-Ldk.cjs';
|
|
4
4
|
import { TileDownloadStats } from './tile-downloader.cjs';
|
|
5
5
|
import { StyleSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
6
6
|
import 'geojson';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ky from 'ky';
|
|
2
2
|
import { BBox } from './utils/geo.js';
|
|
3
|
-
import { b as StyleInlinedSources, G as GlyphInfo, T as TileInfo } from './types-
|
|
3
|
+
import { b as StyleInlinedSources, G as GlyphInfo, T as TileInfo } from './types-Bhn0-Ldk.js';
|
|
4
4
|
import { TileDownloadStats } from './tile-downloader.js';
|
|
5
5
|
import { StyleSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
6
6
|
import 'geojson';
|
package/dist/utils/style.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BBox } from './geo.cjs';
|
|
2
|
-
import { I as InlinedSource } from '../types-
|
|
2
|
+
import { I as InlinedSource } from '../types-Bhn0-Ldk.cjs';
|
|
3
3
|
import * as _maplibre_maplibre_gl_style_spec from '@maplibre/maplibre-gl-style-spec';
|
|
4
4
|
import { StyleSpecification, ValidationError } from '@maplibre/maplibre-gl-style-spec';
|
|
5
5
|
import 'geojson';
|
package/dist/utils/style.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BBox } from './geo.js';
|
|
2
|
-
import { I as InlinedSource } from '../types-
|
|
2
|
+
import { I as InlinedSource } from '../types-Bhn0-Ldk.js';
|
|
3
3
|
import * as _maplibre_maplibre_gl_style_spec from '@maplibre/maplibre-gl-style-spec';
|
|
4
4
|
import { StyleSpecification, ValidationError } from '@maplibre/maplibre-gl-style-spec';
|
|
5
5
|
import 'geojson';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as type_fest from 'type-fest';
|
|
2
|
-
import { d as GlyphRange, T as TileInfo, c as TileFormat } from '../types-
|
|
2
|
+
import { d as GlyphRange, T as TileInfo, c as TileFormat } from '../types-Bhn0-Ldk.cjs';
|
|
3
3
|
import '@maplibre/maplibre-gl-style-spec';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as type_fest from 'type-fest';
|
|
2
|
-
import { d as GlyphRange, T as TileInfo, c as TileFormat } from '../types-
|
|
2
|
+
import { d as GlyphRange, T as TileInfo, c as TileFormat } from '../types-Bhn0-Ldk.js';
|
|
3
3
|
import '@maplibre/maplibre-gl-style-spec';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
package/dist/writer.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { G as GlyphInfo, d as GlyphRange, e as SUPPORTED_SOURCE_TYPES, f as Source, g as SourceInfo, c as TileFormat, T as TileInfo, W as Writer, h as WriterOptions } from './types-
|
|
1
|
+
export { G as GlyphInfo, d as GlyphRange, e as SUPPORTED_SOURCE_TYPES, f as Source, g as SourceInfo, c as TileFormat, T as TileInfo, W as Writer, h as WriterOptions } from './types-Bhn0-Ldk.cjs';
|
|
2
2
|
import '@maplibre/maplibre-gl-style-spec';
|
|
3
3
|
import 'geojson';
|
|
4
4
|
import 'type-fest';
|
package/dist/writer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { G as GlyphInfo, d as GlyphRange, e as SUPPORTED_SOURCE_TYPES, f as Source, g as SourceInfo, c as TileFormat, T as TileInfo, W as Writer, h as WriterOptions } from './types-
|
|
1
|
+
export { G as GlyphInfo, d as GlyphRange, e as SUPPORTED_SOURCE_TYPES, f as Source, g as SourceInfo, c as TileFormat, T as TileInfo, W as Writer, h as WriterOptions } from './types-Bhn0-Ldk.js';
|
|
2
2
|
import '@maplibre/maplibre-gl-style-spec';
|
|
3
3
|
import 'geojson';
|
|
4
4
|
import 'type-fest';
|
package/package.json
CHANGED