Use proper description in layerconfig

This commit is contained in:
pietervdvn 2021-01-05 01:30:59 +01:00
parent f5a4e8cbec
commit 85a6894c92
14 changed files with 113 additions and 14 deletions

View file

@ -66,7 +66,7 @@ export default class LayerConfig {
this.id = json.id;
this.name = Translations.T(json.name);
this.description = Translations.T(json.name);
this.description = Translations.T(json.description);
this.overpassTags = FromJSON.Tag(json.overpassTags, context + ".overpasstags");
this.doNotDownload = json.doNotDownload ?? false,
this.passAllFeatures = json.passAllFeatures ?? false;

View file

@ -19,7 +19,7 @@ export interface LayerConfigJson {
/**
* A description for this layer.
* Shown in the layer selections and in the personal theme
* Shown in the layer selections and in the personel theme
*/
description?: string | any;

View file

@ -10,13 +10,14 @@ import {SubtleButton} from "../Base/SubtleButton";
import {FixedUiElement} from "../Base/FixedUiElement";
import Translations from "../i18n/Translations";
import * as personal from "../../assets/themes/personalLayout/personalLayout.json"
import Locale from "../i18n/Locale";
export default class PersonalLayersPanel extends UIElement {
private checkboxes: UIElement[] = [];
constructor() {
super(State.state.favouriteLayers);
this.ListenTo(State.state.osmConnection.userDetails);
this.ListenTo(Locale.language);
this.UpdateView([]);
const self = this;
State.state.installedThemes.addCallback(extraThemes => {
@ -36,6 +37,10 @@ export default class PersonalLayersPanel extends UIElement {
continue;
}
if(layout.hideFromOverview){
continue;
}
const header =
new Combine([
`<img style="max-width: 3em;max-height: 3em; float: left; padding: 0.1em; margin-right: 0.3em;" src='${layout.icon}'>`,

View file

@ -42,7 +42,6 @@
}
]
},
"description": {},
"tagRenderings": [
"images",
{

View file

@ -0,0 +1,105 @@
{
"id": "bike_libraries",
"name": {
"en": "Bicycle library",
"nl": "Fietsbibliotheek",
},
"minzoom": 13,
"overpassTags": "amenity=bicycle_library",
"title": {
"render": {
"en": "Bicycle library",
"nl": "Fietsbibliotheek"
},
"mappings": [
{
"if": "name~*",
"then": "<i>{name}</i>"
}
]
},
"titleIcons": [
{
"condition": {
"or": [
"service:bicycle:pump=yes",
"service:bicycle:pump=separate"
]
},
"render": "<img src='./assets/layers/bike_shop/pump.svg'/>"
},
"defaults"
],
"description": {
"en": "A facility where bicycles can be lent for longer period of times",
"nl": "Een plaats waar men voor langere tijd een fiets kan lenen"
},
"tagRenderings": [
"images",
{
"question": {
"en": "What is the name of this bicycle library?",
"nl": "Wat is de naam van deze fietsbieb?",
},
"render": {
"en": "This bicycle library shop is called {name}",
"nl": "Deze fietsbieb heet {name}",
},
"freeform": {
"key": "name"
}
},
"website",
"phone",
"email",
"opening_hours",
"description",
],
"hideUnderlayingFeaturesMinPercentage": 1,
"presets": [
{
"title": {
"en": "Fietsbibliotheek",
"nl": "Bicycle library",
},
"tags": [
"shop=bicycle"
]
}
],
"icon": {
"render": "./assets/layers/bike_shop/repair_shop.svg",
"mappings": [
{
"if": "operator=De Fietsambassade Gent",
"then": "./assets/themes/cyclofix/fietsambassade_gent_logo_small.svg"
},
{
"if": "service:bicycle:retail=yes",
"then": "./assets/layers/bike_shop/shop.svg"
}
]
},
"iconOverlays": [
{
"if": "opening_hours~*",
"then": "isOpen",
"badge": true
},
{
"if": "service:bicycle:pump=yes",
"then": "circle:#e2783d;./assets/layers/bike_repair_station/pump.svg",
"badge": true
}
],
"width": {
"render": "1"
},
"iconSize": {
"render": "50,50,bottom"
},
"color": {
"render": "#c00"
},
"wayHandling": 2
}

View file

@ -32,7 +32,6 @@
}
]
},
"description": {},
"tagRenderings": [ "images",
{

View file

@ -192,7 +192,6 @@
]
},
"size": {
"question": {},
"freeform": {
"addExtraTags": []
},

View file

@ -37,7 +37,6 @@
}
]
},
"description": {},
"tagRenderings": [
"images",
"description",

View file

@ -16,7 +16,6 @@
"en": "Information board"
}
},
"description": {},
"tagRenderings": [ "images"],
"hideUnderlayingFeaturesMinPercentage": 0,
"icon": {

View file

@ -23,7 +23,6 @@
"nl": "Bewakingscamera"
}
},
"description": {},
"tagRenderings": [
"images",
{

View file

@ -50,7 +50,6 @@
},
"mappings": []
},
"description": {},
"tagRenderings": [
"images",
{
@ -383,7 +382,6 @@
}
]
},
"description": {},
"tagRenderings": [
"images",
{

View file

@ -51,7 +51,6 @@
}
]
},
"description": {},
"tagRenderings": [
"images",
{

View file

@ -37,7 +37,6 @@
"nl": "Boomgaard"
}
},
"description": {},
"tagRenderings": ["images"],
"hideUnderlayingFeaturesMinPercentage": 0,
"icon": {

View file

@ -62,7 +62,6 @@
}
]
},
"description": {},
"tagRenderings": [
{
"render": "Deze straat is <b>{width:carriageway}m</b> breed"