forked from MapComplete/MapComplete
Robuster handling of allKnownLayers
This commit is contained in:
parent
e555a19d30
commit
7427a9cb9b
2 changed files with 12 additions and 8 deletions
|
@ -23,14 +23,18 @@ export default class AllKnownLayers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(const layout of known_layers.themes){
|
for (const layout of known_layers.themes) {
|
||||||
for (const layer of layout.layers) {
|
for (const layer of layout.layers) {
|
||||||
if(typeof layer === "string"){
|
if (typeof layer === "string") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const parsed = new LayerConfig(layer, "shared_layer_in_theme")
|
try {
|
||||||
sharedLayers.set(layer.id, parsed);
|
const parsed = new LayerConfig(layer, "shared_layer_in_theme")
|
||||||
sharedLayers[layer.id] = parsed;
|
sharedLayers.set(layer.id, parsed);
|
||||||
|
sharedLayers[layer.id] = parsed;
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Could not parse a layer in theme ", layout.id, "due to", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default class SourceConfig {
|
||||||
defined++;
|
defined++;
|
||||||
}
|
}
|
||||||
if (defined == 0) {
|
if (defined == 0) {
|
||||||
throw "Source: nothing correct defined in the source"
|
throw `Source: nothing correct defined in the source (in ${context}) (the params are ${JSON.stringify(params)})`
|
||||||
}
|
}
|
||||||
if(params.isOsmCache && params.geojsonSource == undefined){
|
if(params.isOsmCache && params.geojsonSource == undefined){
|
||||||
console.error(params)
|
console.error(params)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue