mapcomplete/UI/CustomGenerator/GenerateEmpty.ts

87 lines
2.5 KiB
TypeScript
Raw Permalink Normal View History

2020-09-02 11:37:34 +02:00
import {LayerConfigJson} from "../../Customizations/JSON/LayerConfigJson";
import {LayoutConfigJson} from "../../Customizations/JSON/LayoutConfigJson";
import {TagRenderingConfigJson} from "../../Customizations/JSON/TagRenderingConfigJson";
export class GenerateEmpty {
public static createEmptyLayer(): LayerConfigJson {
return {
id: "yourlayer",
2020-09-15 02:29:31 +02:00
name: {},
minzoom: 12,
2020-09-02 11:37:34 +02:00
overpassTags: {and: [""]},
title: {},
2020-09-02 11:37:34 +02:00
description: {},
tagRenderings: [],
2020-09-09 18:42:13 +02:00
hideUnderlayingFeaturesMinPercentage: 0,
icon: {
2020-11-06 04:02:53 +01:00
render: "./assets/svg/bug.svg"
},
width: {
render: "8"
},
iconSize: {
render: "40,40,center"
},
color:{
render: "#00f"
}
2020-09-02 11:37:34 +02:00
}
}
public static createEmptyLayout(): LayoutConfigJson {
return {
id: "id",
2020-09-02 11:37:34 +02:00
title: {},
2020-09-17 13:13:02 +02:00
shortDescription: {},
2020-09-02 11:37:34 +02:00
description: {},
language: [],
maintainer: "",
2020-11-06 04:02:53 +01:00
icon: "./assets/svg/bug.svg",
2020-09-02 11:37:34 +02:00
version: "0",
startLat: 0,
startLon: 0,
startZoom: 1,
widenFactor: 0.05,
2020-09-02 11:37:34 +02:00
socialImage: "",
layers: [
GenerateEmpty.createEmptyLayer()
]
2020-09-02 11:37:34 +02:00
}
}
public static createTestLayout(): LayoutConfigJson {
return {
id: "test",
title: {"en": "Test layout"},
2020-09-17 13:13:02 +02:00
shortDescription: {},
2020-09-02 11:37:34 +02:00
description: {"en": "A layout for testing"},
language: ["en"],
maintainer: "Pieter Vander Vennet",
2020-11-06 04:02:53 +01:00
icon: "./assets/svg/bug.svg",
2020-09-02 11:37:34 +02:00
version: "0",
startLat: 0,
startLon: 0,
startZoom: 1,
widenFactor: 0.05,
socialImage: "",
layers: [{
id: "testlayer",
name: {en:"Testing layer"},
2020-09-02 11:37:34 +02:00
minzoom: 15,
overpassTags: {and: ["highway=residential"]},
title: {},
2020-09-02 11:37:34 +02:00
description: {"en": "Some Description"},
2020-11-06 04:02:53 +01:00
icon: {render: {en: "./assets/svg/pencil.svg"}},
2020-09-02 11:37:34 +02:00
width: {render: {en: "5"}},
tagRenderings: [{
render: {"en":"Test Rendering"}
}]
}]
}
}
public static createEmptyTagRendering(): TagRenderingConfigJson {
return {};
}
}