From 556ca64382b6cce00f0bc7f0cc6f003a50ea9315 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 9 Nov 2020 19:55:29 +0100 Subject: [PATCH] Add bicycle cleaning services, add fancy icons for bicycle shops --- Customizations/AllKnownLayouts.ts | 3 +- Customizations/SharedLayers.ts | 2 + README.md | 3 + assets/layers/bike_shop/bike_shop.json | 63 +++++++++++++++++++ .../layers/drinking_water/drinking_water.json | 16 +++-- assets/themes/cyclofix/cyclofix.json | 2 +- 6 files changed, 83 insertions(+), 6 deletions(-) diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 82b6173..10796d6 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -28,9 +28,10 @@ export class AllKnownLayouts { const layout = Layout.LayoutFromJSON(cyclofix, SharedLayers.sharedLayers) const now = new Date(); const m = now.getMonth() + 1; - const day = new Date().getDay() + 1; + const day = new Date().getDate() + 1; const date = day + "/" + m; if (date === "31/10" || date === "1/11" || date === "2/11") { + console.log("The current date is ",date,", which means we remember our dead") // Around Halloween/Fiesta de muerte/Allerzielen, we remember the dead layout.layers.push( SharedLayers.sharedLayers.get("ghost_bike") diff --git a/Customizations/SharedLayers.ts b/Customizations/SharedLayers.ts index 0f140b0..34dd9da 100644 --- a/Customizations/SharedLayers.ts +++ b/Customizations/SharedLayers.ts @@ -10,6 +10,7 @@ import * as bike_cafes from "../assets/layers/bike_cafe/bike_cafes.json" import * as bike_monitoring_station from "../assets/layers/bike_monitoring_station/bike_monitoring_station.json" import * as cycling_themed_objects from "../assets/layers/cycling_themed_object/cycling_themed_objects.json" import * as bike_shops from "../assets/layers/bike_shop/bike_shop.json" +import * as bike_cleaning from "../assets/layers/bike_cleaning/bike_cleaning.json" import * as maps from "../assets/layers/maps/maps.json" import * as information_boards from "../assets/layers/information_board/information_board.json" import LayerConfig from "./JSON/LayerConfig"; @@ -34,6 +35,7 @@ export default class SharedLayers { new LayerConfig(bike_cafes, "shared_layers"), new LayerConfig(cycling_themed_objects, "shared_layers"), new LayerConfig(bike_shops, "shared_layers"), + new LayerConfig(bike_cleaning, "shared_layers"), new LayerConfig(maps, "shared_layers"), new LayerConfig(information_boards, "shared_layers") ]; diff --git a/README.md b/README.md index f69d403..3f52712 100644 --- a/README.md +++ b/README.md @@ -211,4 +211,7 @@ https://commons.wikimedia.org/w/index.php?title=Antu_chronometer Fries icon: https://www.flaticon.com/free-icon/french-fries_1144288 +Shower icon (used in 'bike_cleaning.svg'): +https://commons.wikimedia.org/wiki/File:Shower_symbol.svg + Bench icons from StreetComplete: https://github.com/westnordost/StreetComplete/tree/v25.0-beta1/res/graphics/quest%20icons, GPLv3.0 diff --git a/assets/layers/bike_shop/bike_shop.json b/assets/layers/bike_shop/bike_shop.json index 9bf6426..613e5a6 100644 --- a/assets/layers/bike_shop/bike_shop.json +++ b/assets/layers/bike_shop/bike_shop.json @@ -139,6 +139,40 @@ } ] }, + "titleIcons": [ + { + "mappings": [ + { + "if": "service:bicycle:pump=yes", + "then": "" + } + ] + }, + { + "mappings": [ + { + "if": "service:bicycle:diy=yes", + "then": "" + } + ] + }, + { + "mappings": [ + { + "if": { + "or": [ + "service:bicycle:cleaning=yes", + "service:bicycle:cleaning=diy" + ] + }, + "then": "" + } + ] + }, + "wikipedialink", + "osmlink" + + ], "description": { "en": "A shop specifically selling bicycles or related items", "nl": "Een winkel die hoofdzakelijk fietsen en fietstoebehoren verkoopt" @@ -438,6 +472,35 @@ } } ] + }, + { + "question": { + "en": "Are bicycles washed here?", + "nl": "Biedt deze winkel een fietsschoonmaak aan?" + }, + "mappings": [ + { + "if": "service:bicycle:cleaning=yes", + "then": { + "en": "This shop cleans bicycles", + "nl": "Deze winkel biedt fietsschoonmaak aan" + } + }, + { + "if": "service:bicycle:cleaning=diy", + "then": { + "en": "This shop has an installation where one can clean bicycles themselves", + "nl": "Deze winkel biedt een installatie aan om zelf je fiets schoon te maken" + } + }, + { + "if": "service:bicycle:cleaning=no", + "then": { + "en": "This shop doesn't offer bicycle cleaning", + "nl": "Deze winkel biedt geen fietsschoonmaak aan" + } + } + ] } ], "hideUnderlayingFeaturesMinPercentage": 1, diff --git a/assets/layers/drinking_water/drinking_water.json b/assets/layers/drinking_water/drinking_water.json index 4e535fd..7f0ce2e 100644 --- a/assets/layers/drinking_water/drinking_water.json +++ b/assets/layers/drinking_water/drinking_water.json @@ -16,7 +16,16 @@ "de": "Trinkwasser" } }, - "icon": "./assets/layers/drinking_water/drinking_water.svg", + "icon": { + "render": "./assets/layers/drinking_water/drinking_water.svg", + "mappings": [ + { + "if": {"or": ["operational_status=broken", "operational_status=closed"]}, + + "then": "./assets/layers/drinking_water/drinking_water_broken.svg" + } + ] + }, "iconSize": "40,40,bottom", "overpassTags": { "and": [ @@ -41,7 +50,7 @@ ] } ], - "color": "#00bb00", + "color": "#6bc4f7", "tagRenderings": [ "images", { @@ -63,8 +72,7 @@ "then": { "en": "This drinking water works", "nl": "Deze drinkwaterfonteint werkt" - }, - "hideInAnswer": true + } }, { "if": "operational_status=broken", diff --git a/assets/themes/cyclofix/cyclofix.json b/assets/themes/cyclofix/cyclofix.json index 5623eba..51f31fb 100644 --- a/assets/themes/cyclofix/cyclofix.json +++ b/assets/themes/cyclofix/cyclofix.json @@ -25,6 +25,6 @@ "startZoom": 16, "widenFactor": 0.05, "socialImage": "./assets/themes/cyclofix/logo.svg", - "layers": ["bike_cafes", "bike_shops", "bike_repair_station", "drinking_water", "bike_themed_object","bike_parking"], + "layers": ["bike_cafes", "bike_shops", "bike_repair_station", "drinking_water", "bike_themed_object","bike_cleaning","bike_parking"], "roamingRenderings": [] } \ No newline at end of file