Fix: (attempt to) fix build

This commit is contained in:
Pieter Vander Vennet 2025-06-16 16:14:16 +02:00
parent f48153145d
commit 6c9f660938

View file

@ -295,13 +295,16 @@ class GenerateLayouts extends Script {
if (f.properties.type === "vector") {
// We also need to whitelist eventual sources
let url = f.properties.url
urls.push(...(f.properties["connect-src"] ?? []))
if (url.startsWith("pmtiles://")) {
url = url.substring("pmtiles://".length)
}
if (url.endsWith(".pmtiles")) {
continue
}
const styleSpec = await Utils.downloadJsonCached(url, 1000 * 120, {
Origin: "https://mapcomplete.org",
})
urls.push(...(f.properties["connect-src"] ?? []))
for (const key of Object.keys(styleSpec?.["sources"] ?? {})) {
const url = styleSpec["sources"][key].url
if (!url) {