forked from MapComplete/MapComplete
Fix: (attempt to) fix build
This commit is contained in:
parent
f48153145d
commit
6c9f660938
1 changed files with 4 additions and 1 deletions
|
@ -295,13 +295,16 @@ class GenerateLayouts extends Script {
|
||||||
if (f.properties.type === "vector") {
|
if (f.properties.type === "vector") {
|
||||||
// We also need to whitelist eventual sources
|
// We also need to whitelist eventual sources
|
||||||
let url = f.properties.url
|
let url = f.properties.url
|
||||||
|
urls.push(...(f.properties["connect-src"] ?? []))
|
||||||
if (url.startsWith("pmtiles://")) {
|
if (url.startsWith("pmtiles://")) {
|
||||||
url = url.substring("pmtiles://".length)
|
url = url.substring("pmtiles://".length)
|
||||||
}
|
}
|
||||||
|
if (url.endsWith(".pmtiles")) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
const styleSpec = await Utils.downloadJsonCached(url, 1000 * 120, {
|
const styleSpec = await Utils.downloadJsonCached(url, 1000 * 120, {
|
||||||
Origin: "https://mapcomplete.org",
|
Origin: "https://mapcomplete.org",
|
||||||
})
|
})
|
||||||
urls.push(...(f.properties["connect-src"] ?? []))
|
|
||||||
for (const key of Object.keys(styleSpec?.["sources"] ?? {})) {
|
for (const key of Object.keys(styleSpec?.["sources"] ?? {})) {
|
||||||
const url = styleSpec["sources"][key].url
|
const url = styleSpec["sources"][key].url
|
||||||
if (!url) {
|
if (!url) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue