styled-map-package 4.0.0 → 4.0.1
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/server.cjs +3 -4
- package/dist/server.js +3 -4
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -52,12 +52,11 @@ function createServer({ base = "/" } = {}) {
|
|
|
52
52
|
const router = (0, import_IttyRouter.IttyRouter)({
|
|
53
53
|
base
|
|
54
54
|
}).get("/style.json", async (request, reader) => {
|
|
55
|
-
const baseUrl = new URL(
|
|
55
|
+
const baseUrl = new URL(".", request.url);
|
|
56
56
|
const style = await reader.getStyle(baseUrl.href);
|
|
57
57
|
return json(style);
|
|
58
|
-
}).get("
|
|
59
|
-
const
|
|
60
|
-
const path = decodeURIComponent(url.pathname.slice(base.length - 1));
|
|
58
|
+
}).get(":path+", async (request, reader) => {
|
|
59
|
+
const path = decodeURIComponent(request.params.path);
|
|
61
60
|
const resource = await reader.getResource(path);
|
|
62
61
|
return resourceResponse(resource);
|
|
63
62
|
});
|
package/dist/server.js
CHANGED
|
@@ -29,12 +29,11 @@ function createServer({ base = "/" } = {}) {
|
|
|
29
29
|
const router = IttyRouter({
|
|
30
30
|
base
|
|
31
31
|
}).get("/style.json", async (request, reader) => {
|
|
32
|
-
const baseUrl = new URL(
|
|
32
|
+
const baseUrl = new URL(".", request.url);
|
|
33
33
|
const style = await reader.getStyle(baseUrl.href);
|
|
34
34
|
return json(style);
|
|
35
|
-
}).get("
|
|
36
|
-
const
|
|
37
|
-
const path = decodeURIComponent(url.pathname.slice(base.length - 1));
|
|
35
|
+
}).get(":path+", async (request, reader) => {
|
|
36
|
+
const path = decodeURIComponent(request.params.path);
|
|
38
37
|
const resource = await reader.getResource(path);
|
|
39
38
|
return resourceResponse(resource);
|
|
40
39
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "styled-map-package",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "A Styled Map Package (`.smp`) file is a Zip archive containing all the resources needed to serve a Maplibre vector styled map offline. This includes the style JSON, vector and raster tiles, glyphs (fonts), the sprite image, and the sprite metadata.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|