Merge branch 'feature/climbing-layer' into kletterspots-develop

This commit is contained in:
Christian Neumann 2020-11-23 11:58:23 +01:00
commit e24e725411
46 changed files with 1225 additions and 533 deletions

View file

@ -100,7 +100,7 @@ export default class LayerConfig {
}
this.tagRenderings = trs(json.tagRenderings).concat(roamingRenderings);
this.titleIcons = trs(json.titleIcons ?? ["wikipedialink","osmlink"]);
this.titleIcons = trs(json.titleIcons ?? ["phonelink","wikipedialink","osmlink", "sharelink"]);
function tr(key, deflt) {

View file

@ -121,6 +121,12 @@ export interface LayerConfigJson {
/**
* All the tag renderings.
* A tag rendering is a block that either shows the known value or asks a question.
*
* Refer to the class `TagRenderingConfigJson` to see the possibilities.
*
* Note that we can also use a string here - where the string refers to a tagrenering defined in `assets/questions/questions.json`,
* where a few very general questions are defined e.g. website, phone number, ...
*
*/
tagRenderings?: (string | TagRenderingConfigJson) []
}

View file

@ -15,6 +15,8 @@ import * as maps from "../assets/layers/maps/maps.json"
import * as information_boards from "../assets/layers/information_board/information_board.json"
import * as direction from "../assets/layers/direction/direction.json"
import * as surveillance_camera from "../assets/layers/surveillance_cameras/surveillance_cameras.json"
import * as toilets from "../assets/layers/toilets/toilets.json"
import LayerConfig from "./JSON/LayerConfig";
export default class SharedLayers {
@ -41,6 +43,7 @@ export default class SharedLayers {
new LayerConfig(maps,[], "shared_layers"),
new LayerConfig(direction,[], "shared_layers"),
new LayerConfig(information_boards,[], "shared_layers"),
new LayerConfig(toilets,[], "shared_layers"),
new LayerConfig(surveillance_camera,[], "shared_layers")
];

View file

@ -1,5 +1,6 @@
import * as questions from "../assets/questions/questions.json";
import TagRenderingConfig from "./JSON/TagRenderingConfig";
import * as questions from "../assets/tagRenderings/questions.json";
import * as icons from "../assets/tagRenderings/icons.json";
export default class SharedTagRenderings {
@ -7,13 +8,24 @@ export default class SharedTagRenderings {
private static generatedSharedFields() {
const dict = {}
for (const key in questions) {
function add(key, store){
try {
dict[key] = new TagRenderingConfig(questions[key])
dict[key] = new TagRenderingConfig(store[key])
} catch (e) {
console.error("COULD NOT PARSE", key, " FROM QUESTIONS:", e)
console.error("BUG: could not parse", key, " from questions.json or icons.json", e)
}
}
for (const key in questions) {
add(key, questions);
}
for (const key in icons) {
add(key, icons);
}
return dict;
}