forked from MapComplete/MapComplete
Further development of split-road feature; refactoring of change-handling
This commit is contained in:
parent
dc4cdda3b5
commit
96ecded0b9
37 changed files with 967 additions and 568 deletions
|
@ -49,6 +49,7 @@ export default class LayerConfig {
|
|||
wayHandling: number;
|
||||
public readonly units: Unit[];
|
||||
public readonly deletion: DeleteConfig | null
|
||||
public readonly allowSplit: boolean
|
||||
|
||||
presets: {
|
||||
title: Translation,
|
||||
|
@ -67,6 +68,7 @@ export default class LayerConfig {
|
|||
context = context + "." + json.id;
|
||||
const self = this;
|
||||
this.id = json.id;
|
||||
this.allowSplit = json.allowSplit ?? false;
|
||||
this.name = Translations.T(json.name, context + ".name");
|
||||
|
||||
if(json.description !== undefined){
|
||||
|
|
|
@ -291,4 +291,9 @@ export interface LayerConfigJson {
|
|||
*/
|
||||
deletion?: boolean | DeleteConfigJson
|
||||
|
||||
/**
|
||||
* IF set, a 'split this road' button is shown
|
||||
*/
|
||||
allowSplit?: boolean
|
||||
|
||||
}
|
|
@ -65,7 +65,7 @@ export default class LayoutConfig {
|
|||
this.language = json.language;
|
||||
}
|
||||
if (this.language.length == 0) {
|
||||
throw "No languages defined. Define at least one language"
|
||||
throw `No languages defined. Define at least one language. (${context}.languages)`
|
||||
}
|
||||
if (json.title === undefined) {
|
||||
throw "Title not defined in " + this.id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue