forked from MapComplete/MapComplete
Add doc generation
This commit is contained in:
parent
a13d282494
commit
0491b52642
7 changed files with 87 additions and 36 deletions
|
@ -54,8 +54,8 @@ export default class LayerConfig {
|
|||
tagRenderings: TagRenderingConfig [];
|
||||
|
||||
constructor(json: LayerConfigJson,
|
||||
official: boolean= true,
|
||||
context?: string) {
|
||||
context?: string,
|
||||
official: boolean = true,) {
|
||||
context = context + "." + json.id;
|
||||
const self = this;
|
||||
this.id = json.id;
|
||||
|
@ -92,7 +92,9 @@ export default class LayerConfig {
|
|||
|
||||
this.calculatedTags = undefined;
|
||||
if (json.calculatedTags !== undefined) {
|
||||
console.warn("Unofficial theme with custom javascript! This is a security risk")
|
||||
if (!official) {
|
||||
console.warn(`Unofficial theme ${this.id} with custom javascript! This is a security risk`)
|
||||
}
|
||||
this.calculatedTags = [];
|
||||
for (const key in json.calculatedTags) {
|
||||
this.calculatedTags.push([key, json.calculatedTags[key]])
|
||||
|
@ -212,11 +214,11 @@ export default class LayerConfig {
|
|||
|
||||
}
|
||||
|
||||
public CustomCodeSnippets(): string[]{
|
||||
if(this.calculatedTags === undefined){
|
||||
public CustomCodeSnippets(): string[] {
|
||||
if (this.calculatedTags === undefined) {
|
||||
return []
|
||||
}
|
||||
|
||||
|
||||
return this.calculatedTags.map(code => code[1]);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ export default class LayoutConfig {
|
|||
}
|
||||
|
||||
// @ts-ignore
|
||||
return new LayerConfig(layer, official,`${this.id}.layers[${i}]`)
|
||||
return new LayerConfig(layer,`${this.id}.layers[${i}]`, official)
|
||||
});
|
||||
|
||||
// ALl the layers are constructed, let them share tags in now!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue