Fix all the bugs, feature-complete with the non-refactored version

This commit is contained in:
Pieter Vander Vennet 2020-10-30 00:56:46 +01:00
parent 5adc355a48
commit 25f2aa8e92
11 changed files with 467 additions and 99 deletions

View file

@ -1,8 +1,7 @@
import Translation from "../../UI/i18n/Translation";
import Translations, {Translation} from "../../UI/i18n/Translations";
import TagRenderingConfig from "./TagRenderingConfig";
import {Tag, TagsFilter} from "../../Logic/Tags";
import {LayerConfigJson} from "./LayerConfigJson";
import Translations from "../../UI/i18n/Translations";
import {FromJSON} from "./FromJSON";
import SharedTagRenderings from "../SharedTagRenderings";
import {TagRenderingConfigJson} from "./TagRenderingConfigJson";
@ -25,6 +24,7 @@ export default class LayerConfig {
iconSize: TagRenderingConfig;
color: TagRenderingConfig;
width: TagRenderingConfig;
dashArray: TagRenderingConfig;
wayHandling: number;
@ -54,11 +54,12 @@ export default class LayerConfig {
this.wayHandling = json.wayHandling ?? 0;
this.hideUnderlayingFeaturesMinPercentage = json.hideUnderlayingFeaturesMinPercentage ?? 0;
this.title = new TagRenderingConfig(json.title);
this.presets = (json.presets ?? []).map(pr => ({
title: Translations.T(pr.title),
tags: pr.tags.map(t => FromJSON.SimpleTag(t)),
description: Translations.T(pr.description)
}))
this.presets = (json.presets ?? []).map(pr =>
({
title: Translations.T(pr.title),
tags: pr.tags.map(t => FromJSON.SimpleTag(t)),
description: Translations.T(pr.description)
}))
/**
@ -108,6 +109,7 @@ export default class LayerConfig {
this.iconSize = tr("iconSize", "40,40,center");
this.color = tr("color", "#0000ff");
this.width = tr("width", "7");
this.dashArray = tr("dashArray", "");
}

View file

@ -64,6 +64,13 @@ export interface LayerConfigJson {
*/
width?: string | TagRenderingConfigJson;
/**
* A dasharray, e.g. "5 6"
* The dasharray defines 'pixels of line, pixels of gap, pixels of line, pixels of gap',
* Default value: "" (empty string == full line)
*/
dashArray?: string | TagRenderingConfigJson
/**
* Wayhandling: should a way/area be displayed as:
* 0) The way itself