mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
* add getTileJson method to PMTiles class [#239, #247] * update docs related to FetchSource and headers [#397]
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
"deploy": "wrangler deploy",
|
||||
"test": "tsx ../shared/index.test.ts",
|
||||
"tsc": "tsc --watch",
|
||||
"build": "wrangler publish --outdir dist --dry-run",
|
||||
"build": "wrangler deploy --outdir dist --dry-run",
|
||||
"biome": "biome check --config-path=../../js/ src/index.ts --apply",
|
||||
"biome-check": "biome check --config-path=../../js src/index.ts"
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
Source,
|
||||
TileType,
|
||||
} from "../../../js/index";
|
||||
import { pmtiles_path, tileJSON, tile_path } from "../../shared/index";
|
||||
import { pmtiles_path, tile_path } from "../../shared/index";
|
||||
|
||||
interface Env {
|
||||
// biome-ignore lint: config name
|
||||
@@ -159,14 +159,9 @@ export default {
|
||||
|
||||
if (!tile) {
|
||||
cacheableHeaders.set("Content-Type", "application/json");
|
||||
|
||||
const t = tileJSON(
|
||||
pHeader,
|
||||
await p.getMetadata(),
|
||||
env.PUBLIC_HOSTNAME || url.hostname,
|
||||
name
|
||||
const t = await p.getTileJson(
|
||||
`https://${env.PUBLIC_HOSTNAME || url.hostname}/${name}`
|
||||
);
|
||||
|
||||
return cacheableResponse(JSON.stringify(t), cacheableHeaders, 200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user