From 431c90d9de36b9a25f21e661fd6afa27e2f5ea77 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 31 Jul 2020 18:27:40 +0200 Subject: [PATCH] Add ghost bikes, fix build --- Customizations/AllKnownLayouts.ts | 4 ++-- Customizations/Layers/GhostBike.ts | 9 ++++---- Customizations/Layouts/GhostBikes.ts | 23 +++++++++++++++++++ Customizations/Layouts/WalkByBrussels.ts | 29 ------------------------ createLayouts.ts | 18 ++------------- 5 files changed, 31 insertions(+), 52 deletions(-) create mode 100644 Customizations/Layouts/GhostBikes.ts delete mode 100644 Customizations/Layouts/WalkByBrussels.ts diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 38d8891..87c5121 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -8,11 +8,11 @@ import {StreetWidth} from "./Layouts/StreetWidth"; import {GRB} from "./Layouts/GRB"; import {Artworks} from "./Layouts/Artworks"; import {ClimbingTrees} from "./Layouts/ClimbingTrees"; -import {WalkByBrussels} from "./Layouts/WalkByBrussels"; import {Smoothness} from "./Layouts/Smoothness"; import {MetaMap} from "./Layouts/MetaMap"; import {Natuurpunt} from "./Layouts/Natuurpunt"; import {Bookcases} from "./Layouts/Bookcases"; +import {GhostBikes} from "./Layouts/GhostBikes"; export class AllKnownLayouts { @@ -23,8 +23,8 @@ export class AllKnownLayouts { new Groen(), new GRB(), new Cyclofix(), + new GhostBikes(), new Bookcases(), - new WalkByBrussels(), new MetaMap(), new StreetWidth(), new Natuurpunt(), diff --git a/Customizations/Layers/GhostBike.ts b/Customizations/Layers/GhostBike.ts index 8bf40d8..05a6543 100644 --- a/Customizations/Layers/GhostBike.ts +++ b/Customizations/Layers/GhostBike.ts @@ -1,20 +1,19 @@ import {LayerDefinition} from "../LayerDefinition"; import {Tag} from "../../Logic/TagsFilter"; -import {FixedUiElement} from "../../UI/Base/FixedUiElement"; import FixedText from "../Questions/FixedText"; import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; -import L from "leaflet"; import {TagRenderingOptions} from "../TagRenderingOptions"; export class GhostBike extends LayerDefinition { constructor() { super("ghost bike"); - this.name = "ghost bike"; + this.name = "Ghost bike"; this.overpassFilter = new Tag("memorial", "ghost_bike") this.title = new FixedText("Ghost bike"); this.description = "A ghost bike is a memorial for a cyclist who died in a traffic accident," + " in the form of a white bicycle placed permanently near the accident location."; + this.minzoom = 1; this.presets = [ { @@ -67,11 +66,11 @@ export class GhostBike extends LayerDefinition { this.style = (tags: any) => { return { color: "#000000", - icon: L.icon({ + icon: { iconUrl: 'assets/bike/ghost.svg', iconSize: [40, 40], iconAnchor: [20, 20], - }) + } } }; diff --git a/Customizations/Layouts/GhostBikes.ts b/Customizations/Layouts/GhostBikes.ts new file mode 100644 index 0000000..22ed372 --- /dev/null +++ b/Customizations/Layouts/GhostBikes.ts @@ -0,0 +1,23 @@ +import {Layout} from "../Layout"; +import {GhostBike} from "../Layers/GhostBike"; +import Combine from "../../UI/Base/Combine"; +import Translations from "../../UI/i18n/Translations"; + +export class GhostBikes extends Layout { + constructor() { + super("ghostbikes", + ["en"], + "Ghost Bike Map", + [new GhostBike()], + 6, + 50.423, + 5.493, + new Combine(["

", "A map of Ghost Bikes", "

", + "A ghost bike is a memorial for a cyclist who died in a traffic accident," + + " in the form of a white bicycle placed permanently near the accident location.", + "On this map, one can see the location of known ghost bikes, and (with a free OpenStreetMap account) easily add missing and new Ghost Bikes"]) + ); + + this.icon = "./assets/bike/ghost.svg"; + } +} \ No newline at end of file diff --git a/Customizations/Layouts/WalkByBrussels.ts b/Customizations/Layouts/WalkByBrussels.ts deleted file mode 100644 index 499b774..0000000 --- a/Customizations/Layouts/WalkByBrussels.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Layout } from "../Layout"; -import { DrinkingWater } from "../Layers/DrinkingWater"; -import { NatureReserves } from "../Layers/NatureReserves"; -import { Park } from "../Layers/Park"; - -export class WalkByBrussels extends Layout { - constructor() { - super("walkbybrussels", - ["en","fr","nl"], - "Drinking Water Spots", - [new DrinkingWater(), new Park(), new NatureReserves()], - 10, - 50.8435, - 4.3688, - - - "

Drinking water

\n" + - "\n" + - "

" + - "Help with creating a map of drinking water points!" - - , - "

Start by creating an account\n" + - " or by " + - " logging in.

", - "Start by clicking a pin and answering the questions"); - } - -} \ No newline at end of file diff --git a/createLayouts.ts b/createLayouts.ts index 3f57149..36560c9 100644 --- a/createLayouts.ts +++ b/createLayouts.ts @@ -1,28 +1,14 @@ + import {UIElement} from "./UI/UIElement"; UIElement.runningFromConsole = true; - import {AllKnownLayouts} from "./Customizations/AllKnownLayouts"; import {Layout} from "./Customizations/Layout"; import {readFileSync, writeFile, writeFileSync} from "fs"; +import Locale from "./UI/i18n/Locale"; import svg2img from 'promise-svg2img'; import Translation from "./UI/i18n/Translation"; -import Locale from "./UI/i18n/Locale"; import Translations from "./UI/i18n/Translations"; -import {All} from "./Customizations/Layouts/All"; -import {StreetWidth} from "./Customizations/Layouts/StreetWidth"; -import {LayerDefinition} from"./Customizations/LayerDefinition"; -import {ClimbingTrees} from "./Customizations/Layouts/ClimbingTrees"; -import {Smoothness} from "./Customizations/Layouts/Smoothness"; -import {Natuurpunt} from "./Customizations/Layouts/Natuurpunt"; -import {Groen} from "./Customizations/Layouts/Groen"; -import Cyclofix from "./Customizations/Layouts/Cyclofix"; -import {CustomLayout} from "./Logic/CustomLayers"; -import {GRB} from "./Customizations/Layouts/GRB"; -import {Artworks} from "./Customizations/Layouts/Artworks"; -import {WalkByBrussels} from "./Customizations/Layouts/WalkByBrussels"; -import {MetaMap} from "./Customizations/Layouts/MetaMap"; -import {Bookcases} from "./Customizations/Layouts/Bookcases"; console.log("Building the layouts")