Add switch to hide certain features, cleanup of code

This commit is contained in:
Pieter Vander Vennet 2021-03-25 15:19:44 +01:00
parent aa0989b72a
commit 1b1ec9f15d
18 changed files with 230 additions and 173 deletions

View file

@ -24,6 +24,7 @@ export default class LayerConfig {
static WAYHANDLING_DEFAULT = 0;
static WAYHANDLING_CENTER_ONLY = 1;
static WAYHANDLING_CENTER_AND_WAY = 2;
id: string;
name: Translation
description: Translation;
@ -31,6 +32,7 @@ export default class LayerConfig {
calculatedTags: [string, string][]
doNotDownload: boolean;
passAllFeatures: boolean;
isShown: TagRenderingConfig;
minzoom: number;
maxzoom: number;
title?: TagRenderingConfig;
@ -205,6 +207,7 @@ export default class LayerConfig {
throw "Builtin SVG asset not found: " + iconPath
}
}
this.isShown = tr("isShown", "yes");
this.iconSize = tr("iconSize", "40,40,center");
this.color = tr("color", "#0000ff");
this.width = tr("width", "7");

View file

@ -1,5 +1,6 @@
import {TagRenderingConfigJson} from "./TagRenderingConfigJson";
import {AndOrTagConfigJson} from "./TagConfigJson";
import TagRenderingConfig from "./TagRenderingConfig";
/**
* Configuration for a single layer
@ -51,7 +52,15 @@ export interface LayerConfigJson {
* Works well together with 'passAllFeatures', to add decoration
*/
doNotDownload?: boolean;
/**
* This tagrendering should either be 'yes' or 'no'. If 'no' is returned, then the feature will be hidden from view.
* This is useful to hide certain features from view
* The default value is 'yes'
*/
isShown?: TagRenderingConfigJson;
/**
* The zoomlevel at which point the data is shown and loaded.
* Default: 0