forked from MapComplete/MapComplete
Small improvements
This commit is contained in:
parent
e889d1eff1
commit
780d353c8d
6 changed files with 8 additions and 9 deletions
|
@ -18,6 +18,7 @@ export default class FilterConfig {
|
|||
if(json.options.map === undefined){
|
||||
throw `A filter was given where the options aren't a list at ${context}`
|
||||
}
|
||||
|
||||
this.options = json.options.map((option, i) => {
|
||||
const question = Translations.T(
|
||||
option.question,
|
||||
|
@ -27,6 +28,9 @@ export default class FilterConfig {
|
|||
option.osmTags ?? {and: []},
|
||||
`${context}.options-[${i}].osmTags`
|
||||
);
|
||||
if(question === undefined){
|
||||
throw `Invalid filter: no question given at ${context}[${i}]`
|
||||
}
|
||||
|
||||
return {question: question, osmTags: osmTags};
|
||||
});
|
||||
|
|
|
@ -7,6 +7,7 @@ import {Utils} from "../../Utils";
|
|||
import LayerConfig from "./LayerConfig";
|
||||
import {Unit} from "../Unit";
|
||||
import {Denomination} from "../Denomination";
|
||||
import {LayerConfigJson} from "./Json/LayerConfigJson";
|
||||
|
||||
export default class LayoutConfig {
|
||||
public readonly id: string;
|
||||
|
@ -208,8 +209,7 @@ export default class LayoutConfig {
|
|||
if (shared === undefined) {
|
||||
throw `Unknown shared/builtin layer ${name} at ${context}.layers[${i}]. Available layers are ${Array.from(AllKnownLayers.sharedLayersJson.keys()).join(", ")}`;
|
||||
}
|
||||
// @ts-ignore
|
||||
let newLayer: LayerConfigJson = Utils.Merge(layer.override, JSON.parse(JSON.stringify(shared))); // We make a deep copy of the shared layer, in order to protect it from changes
|
||||
let newLayer: LayerConfigJson = Utils.Merge(layer["override"], JSON.parse(JSON.stringify(shared))); // We make a deep copy of the shared layer, in order to protect it from changes
|
||||
if (json.overrideAll !== undefined) {
|
||||
newLayer = Utils.Merge(json.overrideAll, newLayer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue