From 94c0b8667a3c005dd0b3a15bd762a3f617881900 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 14 Mar 2021 03:15:06 +0100 Subject: [PATCH] Add draft of sport pitches --- Customizations/AllKnownLayers.ts | 4 +- Customizations/AllKnownLayouts.ts | 4 +- Docs/Making_Your_Own_Theme.md | 1 + README.md | 3 + assets/layers/playground/playground.json | 48 +++- assets/layers/sport_pitch/sport_pitch.json | 228 ++++++++++++++++++ assets/layers/sport_pitch/tabletennis.svg | 5 + assets/themes/speelplekken/speelplekken.json | 6 +- .../themes/sport_pitches/sport_pitches.json | 27 +++ 9 files changed, 310 insertions(+), 16 deletions(-) create mode 100644 assets/layers/sport_pitch/sport_pitch.json create mode 100644 assets/layers/sport_pitch/tabletennis.svg create mode 100644 assets/themes/sport_pitches/sport_pitches.json diff --git a/Customizations/AllKnownLayers.ts b/Customizations/AllKnownLayers.ts index ff143e4..4f9a7e2 100644 --- a/Customizations/AllKnownLayers.ts +++ b/Customizations/AllKnownLayers.ts @@ -24,6 +24,7 @@ import * as benches_at_pt from "../assets/layers/benches/benches_at_pt.json" import * as picnic_tables from "../assets/layers/benches/picnic_tables.json" import * as play_forest from "../assets/layers/play_forest/play_forest.json" import * as playground from "../assets/layers/playground/playground.json" +import * as sport_pitch from "../assets/layers/sport_pitch/sport_pitch.json" import LayerConfig from "./JSON/LayerConfig"; import {LayerConfigJson} from "./JSON/LayerConfigJson"; @@ -56,7 +57,8 @@ export default class AllKnownLayers { benches_at_pt, picnic_tables, play_forest, - playground + playground, + sport_pitch ]; // Must be below the list... diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 2179fe0..1ed6f07 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -23,6 +23,7 @@ import * as playgrounds from "../assets/themes/playgrounds/playgrounds.json" import * as bicycle_lib from "../assets/themes/bicycle_library/bicycle_library.json" import * as play_forests from "../assets/themes/play_forests/play_forests.json" import * as speelplekken from "../assets/themes/speelplekken/speelplekken.json" +import * as sport_pitches from "../assets/themes/sport_pitches/sport_pitches.json" import LayerConfig from "./JSON/LayerConfig"; import LayoutConfig from "./JSON/LayoutConfig"; import AllKnownLayers from "./AllKnownLayers"; @@ -73,7 +74,8 @@ export class AllKnownLayouts { new LayoutConfig(playgrounds), new LayoutConfig(trees), new LayoutConfig(play_forests) , - new LayoutConfig(speelplekken) + new LayoutConfig(speelplekken), + new LayoutConfig(sport_pitches) ]; diff --git a/Docs/Making_Your_Own_Theme.md b/Docs/Making_Your_Own_Theme.md index 75c893c..b65189c 100644 --- a/Docs/Making_Your_Own_Theme.md +++ b/Docs/Making_Your_Own_Theme.md @@ -78,6 +78,7 @@ Every field is documented in the source code itself - you can find them here: - [The top level `LayoutConfig`](https://github.com/pietervdvn/MapComplete/blob/master/Customizations/JSON/LayoutConfigJson.ts) - [A layer object `LayerConfig`](https://github.com/pietervdvn/MapComplete/blob/master/Customizations/JSON/LayerConfigJson.ts) - [The `TagRendering`](https://github.com/pietervdvn/MapComplete/blob/master/Customizations/JSON/TagRenderingConfigJson.ts) +- At last, the exact semantics of tags is documented [here](Docs/Tags_format.md) ## Some pitfalls diff --git a/README.md b/README.md index ad08482..223d61c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # MapComplete > Let a thousand flowers bloom @@ -242,3 +243,5 @@ Urinal icon: https://thenounproject.com/term/urinal/1307984/ 24/7 icon: https://www.vecteezy.com/vector-art/1394992-24-7-service-and-support-icon-set Translation-icon: https://commons.wikimedia.org/wiki/File:OOjs_UI_icon_language-ltr.svg + +PingPong-table icon: Font Awesome Free 5.2.0 by @fontawesome - https://fontawesome.com \ No newline at end of file diff --git a/assets/layers/playground/playground.json b/assets/layers/playground/playground.json index b62e4bb..9d0ed6b 100644 --- a/assets/layers/playground/playground.json +++ b/assets/layers/playground/playground.json @@ -1,24 +1,31 @@ { "id": "playground", "name": { - "nl": "Speeltuinen" + "nl": "Speeltuinen", + "en": "Playgrounds" }, "minzoom": 13, "overpassTags": { - "and": ["leisure=playground","playground!=forest"] + "and": [ + "leisure=playground", + "playground!=forest" + ] }, "description": { - "nl": "Speeltuinen en speelbossen" + "nl": "Speeltuinen", + "en": "Playgrounds" }, "title": { "render": { - "nl": "Speeltuin" + "nl": "Speeltuin", + "en": "Playground" }, "mappings": [ { "if": "name~*", "then": { - "nl": "Speeltuin {name}" + "nl": "Speeltuin {name}", + "en": "Playground {name}" } } ] @@ -27,10 +34,12 @@ "images", { "question": { - "nl": "Wat is de ondergrond van deze speeltuin?
Indien er verschillende ondergronden zijn, neem de meest voorkomende" + "nl": "Wat is de ondergrond van deze speeltuin?
Indien er verschillende ondergronden zijn, neem de meest voorkomende", + "en": "Which is the surface of this playground?
If there are multiple, select the most occuring one" }, "render": { - "nl": "De ondergrond is {surface}" + "nl": "De ondergrond is {surface}", + "en": "The surface is {surface}" }, "freeform": { "key": "surface" @@ -38,23 +47,38 @@ "mappings": [ { "if": "surface=grass", - "then": "De ondergrond is gras" + "then": { + "nl": "De ondergrond is gras", + "en": "The surface is grass" + } }, { "if": "surface=sand", - "then": "De ondergrond is zand" + "then": { + "nl": "De ondergrond is zand", + "en": "The surface is sand" + } }, { "if": "surface=paving_stones", - "then": "De ondergrond bestaat uit stoeptegels" + "then": { + "nl": "De ondergrond bestaat uit stoeptegels", + "en": "The surface is paving stones" + } }, { "if": "surface=asphalt", - "then": "De ondergrond is asfalt" + "then": { + "nl": "De ondergrond is asfalt", + "en": "The surface is asphalt" + } }, { "if": "surface=concrete", - "then": "De ondergrond is beton" + "then": { + "nl": "De ondergrond is beton", + "en": "The surface is concrete" + } } ] }, diff --git a/assets/layers/sport_pitch/sport_pitch.json b/assets/layers/sport_pitch/sport_pitch.json new file mode 100644 index 0000000..eae8fc0 --- /dev/null +++ b/assets/layers/sport_pitch/sport_pitch.json @@ -0,0 +1,228 @@ +{ + "id": "sport_pitch", + "name": { + "nl": "Sportterrein" + }, + "wayHandling": 2, + "minzoom": 12, + "overpassTags": { + "and": [ + "leisure=pitch" + ] + }, + "title": { + "render": { + "nl": "Sportterrein" + } + }, + "description": { + "nl": "Een sportterrein" + }, + "tagRenderings": [ + "images", + { + "render": { + "nl": "Hier kan men {sport} beoefenen" + }, + "freeform": { + "key": "sport" + }, + "question": "Welke sporten kan men hier beoefenen?", + "multiAnswer": true, + "mappings": [ + { + "if": { + "and": [ + "sport=basketball" + ] + }, + "then": { + "nl": "Hier kan men basketbal spelen" + } + }, + { + "if": { + "and": [ + "sport=soccer" + ] + }, + "then": { + "nl": "Hier kan men voetbal spelen" + } + }, + { + "if": { + "and": [ + "sport=table_tennis" + ] + }, + "then": { + "nl": "Dit is een pingpongtafel" + } + }, + { + "if": { + "and": [ + "sport=tennis" + ] + }, + "then": { + "nl": "Hier kan men tennis spelen" + } + }, + { + "if": { + "and": [ + "sport=korfball" + ] + }, + "then": { + "nl": "Hier kan men korfbal spelen" + } + }, + { + "if": { + "and": [ + "sport=basket" + ] + }, + "then": { + "nl": "Hier kan men basketbal beoefenen" + } + } + ] + },{ + "question": { + "nl": "Wat is de ondergrond van dit sportveld?", + "en": "Which is the surface of this sport pitch?" + }, + "render": { + "nl": "De ondergrond is {surface}", + "en": "The surface is {surface}" + }, + "freeform": { + "key": "surface" + }, + "mappings": [ + { + "if": "surface=grass", + "then": { + "nl": "De ondergrond is gras", + "en": "The surface is grass" + } + }, + { + "if": "surface=sand", + "then": { + "nl": "De ondergrond is zand", + "en": "The surface is sand" + } + }, + { + "if": "surface=paving_stones", + "then": { + "nl": "De ondergrond bestaat uit stoeptegels", + "en": "The surface is paving stones" + } + }, + { + "if": "surface=asphalt", + "then": { + "nl": "De ondergrond is asfalt", + "en": "The surface is asphalt" + } + }, + { + "if": "surface=concrete", + "then": { + "nl": "De ondergrond is beton", + "en": "The surface is concrete" + } + } + ] + }, + { + "question": { + "nl": "Is dit sportterrein publiek toegankelijk?" + }, + "mappings": [ + { + "if": "access=public", + "then": "Publiek toegankelijk" + }, + {"if": "access=limited", + "then": "Beperkt toegankelijk (enkel na reservatie, tijdens bepaalde uren, ...)" + }, + { + "if": "access=members", + "then": "Enkel toegankelijk voor leden van de bijhorende sportclub" + }, + { + "if": "access=private", + "then": "Privaat en niet toegankelijk" + } + ] + }, + { + "question": { + "nl": "Moet men reserveren om gebruik te maken van dit sportveld?" + }, + "condition": { + "and": [ "access!=public", "access!=private", "access!=members"]}, + "mappings": [ + { + "if": "reservation=required", + "then": "Reserveren is verplicht om gebruik te maken van dit sportterrein" + }, + { + "if": "reservation=recommended", + "then": "Reserveren is sterk aangeraden om gebruik te maken van dit sportterrein" + }, + {"if": "reservation=yes", + "then": "Reserveren is mogelijk, maar geen voorwaarde" + }, + { + "if": "reservation=no", + "then": "Reserveren is niet mogelijk" + } + ] + }, + "phone", + "email", + "questions", + {"render":"{reviews(name, sportpitch)}"} + ], + "hideUnderlayingFeaturesMinPercentage": 0, + "icon": { + "render": "./assets/layers/sport_pitch/tabletennis.svg" + }, + "width": { + "render": "8" + }, + "iconSize": { + "render": "40,40,center" + }, + "color": { + "render": "#00f" + }, + "presets": [ + { + "title": { + "nl": "Ping-pong tafel" + }, + "tags": [ + "leisure=pitch", + "sport=table_tennis" + ] + }, + { + "title": { + "nl": "Sportterrein" + }, + "tags": [ + "leisure=pitch", + "fixme=Toegevoegd met MapComplete, geometry nog uit te tekenen" + ] + } + ] +} \ No newline at end of file diff --git a/assets/layers/sport_pitch/tabletennis.svg b/assets/layers/sport_pitch/tabletennis.svg new file mode 100644 index 0000000..f766c7e --- /dev/null +++ b/assets/layers/sport_pitch/tabletennis.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/assets/themes/speelplekken/speelplekken.json b/assets/themes/speelplekken/speelplekken.json index 1ce1b49..22ca55c 100644 --- a/assets/themes/speelplekken/speelplekken.json +++ b/assets/themes/speelplekken/speelplekken.json @@ -12,8 +12,9 @@ "language": [ "nl" ], - "maintainer": "", + "maintainer": "MapComplete", "icon": "./assets/layers/play_forest/icon.svg", + "hideInOverview": true, "version": "0", "startLat": 51.16174, "startLon": 4.449462, @@ -22,7 +23,8 @@ "socialImage": "", "layers": [ "play_forest", - "playground" + "playground", + "sport_pitch" ], "roamingRenderings": [] } \ No newline at end of file diff --git a/assets/themes/sport_pitches/sport_pitches.json b/assets/themes/sport_pitches/sport_pitches.json new file mode 100644 index 0000000..04e6b6f --- /dev/null +++ b/assets/themes/sport_pitches/sport_pitches.json @@ -0,0 +1,27 @@ +{ + "id": "sport_pitches", + "title": { + "nl": "Sportvelden" + }, + "shortDescription": { + "nl": "Deze kaart toont sportvelden" + }, + "description": { + "nl": "Een sportveld is een ingerichte plaats met infrastructuur om een sport te beoefenen" + }, + "language": [ + "nl" + ], + "maintainer": "", + "icon": "./assets/layers/sport_pitch/tabletennis.svg", + "version": "0", + "startLat": 0, + "startLon": 0, + "startZoom": 1, + "widenFactor": 0.05, + "socialImage": "", + "layers": [ + "sport_pitch" + ], + "roamingRenderings": [] +} \ No newline at end of file