From ee2777495b97c0e490cdcda5642312c5d84bab8d Mon Sep 17 00:00:00 2001 From: Pieter Fiers Date: Tue, 7 Jul 2020 16:39:11 +0200 Subject: [PATCH] Added manual pump question --- Customizations/AllKnownLayouts.ts | 3 ++- Customizations/Layers/BikePumps.ts | 7 +++++-- Customizations/Layouts/BikePumps.ts | 2 +- Customizations/Questions/FixedName.ts | 13 +++++++++++++ Customizations/Questions/PumpManual.ts | 23 +++++++++++++++++++++++ 5 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 Customizations/Questions/FixedName.ts create mode 100644 Customizations/Questions/PumpManual.ts diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 6e93bfd..8fea419 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -4,6 +4,7 @@ import {GRB} from "./Layouts/GRB"; import {Statues} from "./Layouts/Statues"; import {Bookcases} from "./Layouts/Bookcases"; import { BikePumps } from "./Layers/BikePumps"; +import { BikePumpsLayout } from "./Layouts/BikePumps"; export class AllKnownLayouts { public static allSets: any = AllKnownLayouts.AllLayouts(); @@ -12,7 +13,7 @@ export class AllKnownLayouts { const layouts = [ new Groen(), new GRB(), - new BikePumps(), + new BikePumpsLayout(), /*new Toilets(), new Statues(), new Bookcases()*/ diff --git a/Customizations/Layers/BikePumps.ts b/Customizations/Layers/BikePumps.ts index 03e0ba8..babab00 100644 --- a/Customizations/Layers/BikePumps.ts +++ b/Customizations/Layers/BikePumps.ts @@ -5,6 +5,8 @@ import {OperatorTag} from "../Questions/OperatorTag"; import {NameQuestion} from "../Questions/NameQuestion"; import {NameInline} from "../Questions/NameInline"; import * as L from "leaflet"; +import { PumpManual } from "../Questions/PumpManual"; +import FixedName from "../Questions/FixedName"; export class BikePumps extends LayerDefinition { @@ -31,11 +33,12 @@ export class BikePumps extends LayerDefinition { this.minzoom = 13; this.style = this.generateStyleFunction(); - this.title = new NameInline("pomp"); + this.title = new FixedName("pomp"); this.elementsToShow = [ // new NameQuestion(), // new AccessTag(), - new OperatorTag() + new OperatorTag(), + new PumpManual() ]; } diff --git a/Customizations/Layouts/BikePumps.ts b/Customizations/Layouts/BikePumps.ts index e9d6566..a797305 100644 --- a/Customizations/Layouts/BikePumps.ts +++ b/Customizations/Layouts/BikePumps.ts @@ -2,7 +2,7 @@ import {Layout} from "../Layout"; import {GrbToFix} from "../Layers/GrbToFix"; import { BikePumps } from "../Layers/BikePumps"; -export class GRB extends Layout { +export class BikePumpsLayout extends Layout { constructor() { super( "pomp", diff --git a/Customizations/Questions/FixedName.ts b/Customizations/Questions/FixedName.ts new file mode 100644 index 0000000..0210f9c --- /dev/null +++ b/Customizations/Questions/FixedName.ts @@ -0,0 +1,13 @@ +import { TagRenderingOptions } from "../TagRendering"; + +export default class FixedName extends TagRenderingOptions { + constructor(category: string) { + super({ + mappings: [ + { + k: null, txt: category + } + ] + }) + } +} \ No newline at end of file diff --git a/Customizations/Questions/PumpManual.ts b/Customizations/Questions/PumpManual.ts new file mode 100644 index 0000000..cfb8356 --- /dev/null +++ b/Customizations/Questions/PumpManual.ts @@ -0,0 +1,23 @@ +import {TagRenderingOptions} from "../TagRendering"; +import {UIEventSource} from "../../UI/UIEventSource"; +import {Changes} from "../../Logic/Changes"; +import {Tag} from "../../Logic/TagsFilter"; + + +export class PumpManual extends TagRenderingOptions { + + + private static options = { + priority: 5, + question: "Is dit een manuele pomp?", + mappings: [ + {k: new Tag("manual", "yes"), txt: "Manuele pomp"}, + {k: new Tag("manual", "no"), txt: "Automatische pomp"} + ] + } + + constructor() { + super(PumpManual.options); + } + +} \ No newline at end of file