Small tweaks to the cyclofix colours

This commit is contained in:
Pieter Vander Vennet 2020-09-11 19:14:04 +02:00
parent f942be227a
commit 21c71febca
6 changed files with 6 additions and 195 deletions

View file

@ -1,108 +0,0 @@
import {LayerDefinition} from "../LayerDefinition";
import {And, RegexTag, Tag} from "../../Logic/Tags";
import {TagRenderingOptions} from "../TagRenderingOptions";
export class GrbToFix extends LayerDefinition {
constructor() {
super("grb");
this.name = "grb";
this.presets = [];
this.icon = "./assets/star.svg";
this.overpassFilter = new RegexTag(/fixme/, /.*GRB.*/);
this.minzoom = 13;
this.style = function () {
return {
icon: {
iconUrl: "assets/star.svg",
iconSize: [40, 40],
},
color: "#ff0000"
};
}
this.title = new TagRenderingOptions({
freeform: {
key: "addr:street",
renderTemplate: "{addr:street} <b>{addr:housenumber}</b>",
template: "Fixme $$$"
},
mappings: [
{
k: new Tag("fixme","*"),
txt: "{fixme}"
}
]
})
this.elementsToShow = [
new TagRenderingOptions(
{
freeform: {
key: "addr:housenumber",
renderTemplate: "Het adres is {addr:street} <b>{addr:housenumber}</b>",
template: "Straat? $$$",
},
question: "Wat is het huisnummer?"
}
),
new TagRenderingOptions({
question: "Wat is het huisnummer?",
tagsPreprocessor: tags => {
const telltale = "GRB thinks that this has number ";
const index = tags.fixme.indexOf(telltale);
if (index >= 0) {
const housenumber = tags.fixme.slice(index + telltale.length);
tags["grb:housenumber:human"] = housenumber;
tags["grb:housenumber"] = housenumber == "no number" ? "" : housenumber;
}
},
freeform: {
key: "addr:housenumber",
template: "Het huisnummer is $$$",
renderTemplate: "Het adres is {addr:street} <b>{addr:housenumber}</b>, GRB denkt <i>{grb:housenumber:human}</i>",
extraTags: new And([new Tag("fixme", ""), new Tag("not:addr:housenumber", "")])
},
mappings: [
{
k: new And([new Tag("addr:housenumber", "{grb:housenumber}"), new Tag("fixme", ""), new Tag("not:addr:housenumber", "")]),
txt: "Volg GRB: <b>{grb:housenumber:human}</b>",
substitute: true
},
{
k: new And([new Tag("addr:housenumber", "{addr:housenumber}"), new Tag("fixme", ""), new Tag("not:addr:housenumber", "")]),
txt: "Volg OSM: <b>{addr:housenumber}</b>",
substitute: true
},
{
k: new And([new Tag("building", "garage"),
new Tag("not:addr:housenumber", "yes"),
new Tag("addr:housenumber", ""), new Tag("fixme", "")]),
txt: "Dit is een garage(poort) zonder nummer",
substitute: true
},
{
k: new And([
new Tag("not:addr:housenumber", "yes"),
new Tag("addr:housenumber", ""), new Tag("fixme", "")]),
txt: "Gewoon een huis zonder nummer",
substitute: true
},
]
}).OnlyShowIf(new Tag("fixme", "*"))
];
}
}

View file

@ -1,69 +0,0 @@
import {UIElement} from "./UIElement";
import {FixedUiElement} from "./Base/FixedUiElement";
import {VariableUiElement} from "./Base/VariableUIElement";
import {UIEventSource} from "../Logic/UIEventSource";
export class ConfirmDialog extends UIElement {
private _showOptions: UIEventSource<boolean> = new UIEventSource<boolean>(false);
private _question: UIElement;
private _optionA: UIElement;
private _optionB: UIElement;
constructor(
show: UIEventSource<boolean>,
question: string,
optionA: string, optionB: string,
executeA: () => void,
executeB: () => void,
classA: string = "",
classB: string = "") {
super(show);
this.ListenTo(this._showOptions);
const self = this;
show.addCallback(() => {
self._showOptions.setData(false);
})
this._question = new FixedUiElement("<span class='ui-question'>" + question + "</span>")
.onClick(() => {
self._showOptions.setData(!self._showOptions.data);
});
this._optionA = new VariableUiElement(
this._showOptions.map(
(show) => show ? "<div class='" + classA + "'>" + optionA + "</div>" : ""))
.onClick(() => {
self._showOptions.setData(false);
executeA();
}
);
this._optionB = new VariableUiElement(
this._showOptions.map((show) =>
show ? "<div class='" + classB + "'>" + optionB + "</div>" : "") )
.onClick(() => {
self._showOptions.setData(false);
executeB();
});
}
InnerRender(): string {
if (!this._source.data) {
return "";
}
return this._question.Render() +
this._optionA.Render() +
this._optionB.Render();
}
Update() {
super.Update();
this._question.Update();
this._optionA.Update();
this._optionB.Update();
}
}

View file

@ -6,7 +6,7 @@
"fr": "Café vélo",
"gl": "Café de ciclistas"
},
"minzoom": 14,
"minzoom": 13,
"overpassTags": {
"and": [
"amenity~pub|bar|cafe|restaurant",

View file

@ -17,21 +17,9 @@
"en": "./assets/layers/bike_parking/parking.svg"
}
},
"size": {
"render": {
"en": "50,50,bottom"
}
},
"color": {
"render": {
"en": "#00f"
}
},
"width": {
"render": {
"en": "1"
}
},
"iconSize": "40,40,bottom",
"color": "#00f",
"width": "1",
"wayHandling": 2,
"presets": [
{

View file

@ -5,7 +5,7 @@
"nl": "Fietsgerelateerd object",
"fr": "Objet cycliste"
},
"minzoom": 16,
"minzoom": 14,
"overpassTags": "theme~cycling|bicycle",
"title": {
"render": {
@ -57,7 +57,7 @@
"render": "50,50,bottom"
},
"color": {
"render": "#00f"
"render": "#AB76D5"
},
"presets": [],
"wayHandling": 2

0
css/tabbedComponent.css Normal file
View file