From d06776a9029c685920bc15131073abc322bf198b Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 29 Apr 2022 08:36:45 +0200 Subject: [PATCH 1/6] Add `/.vscode` to `.gitignore` This way, even though https://github.com/pietervdvn/MapComplete/pull/721 was rejected one can still use the validation features without having annoying local changes. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f3b001674..b7f7822f0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ dist/* node_modules .cache/* .idea/* +.vscode/* scratch assets/editor-layer-index.json assets/generated/* From a776db1901e21dfb18f20849c1fc31342db7a1c6 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 29 Apr 2022 08:39:50 +0200 Subject: [PATCH 2/6] Fix validation issues with the theme-template There where a lot of "duplicate keys" warnings. And also a missing comma. --- Docs/theme-template.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Docs/theme-template.json b/Docs/theme-template.json index 8d904d0aa..448533bbf 100644 --- a/Docs/theme-template.json +++ b/Docs/theme-template.json @@ -1,10 +1,10 @@ { - "#": "This JSON file is a small template to get you started developing a theme", - "#": "All lines starting with '#' are comments and can be removed in the theme if you don't need the explanation anymore", - "#": "Make sure to join our chat channel at https://app.element.io/#/room/#MapComplete:matrix.org for questions, sharing your theme, ...", - "#": "To actually load your theme: on linux: run a local webserver (e.g. `webfsd`) and go to https://mapcomplete.osm.be/theme?userlayout=http://127.0.0.1:8080/path-to-your-theme.json", - "#": "If you don't know how to run a webserver: go to https://www.base64encode.org/ , copy paste this entire document in the 'encode' field and encode it;", - "#": "Then, go to https://mapcomplete.osm.be/theme?userlayout=true#your-base64-encoded-file", + "#1": "This JSON file is a small template to get you started developing a theme", + "#2": "All lines starting with '#' are comments and can be removed in the theme if you don't need the explanation anymore", + "#3": "Make sure to join our chat channel at https://app.element.io/#/room/#MapComplete:matrix.org for questions, sharing your theme, ...", + "#4": "To actually load your theme: on linux: run a local webserver (e.g. `webfsd`) and go to https://mapcomplete.osm.be/theme?userlayout=http://127.0.0.1:8080/path-to-your-theme.json", + "#5": "If you don't know how to run a webserver: go to https://www.base64encode.org/ , copy paste this entire document in the 'encode' field and encode it;", + "#6": "Then, go to https://mapcomplete.osm.be/theme?userlayout=true#your-base64-encoded-file", "id": "template", "maintainer": "Write your name here", "version": "2022-03-12", @@ -41,7 +41,7 @@ ] } }, - "#": "Minzoom: only download and show if zoom >= minzoom", + "#4": "Minzoom: only download and show if zoom >= minzoom", "minzoom": 12, "name": { "en": "Name of the layer, as shown in the layer selection" @@ -67,17 +67,17 @@ "disused:key:={key}" ] }, - "#": "The maprenderings describe how a feature is shown on the map", + "#2": "The maprenderings describe how a feature is shown on the map", "mapRendering": [ { - "#": "Rendering block of a mapping which is shown for points AND at the center point of a line/area", + "#1": "Rendering block of a mapping which is shown for points AND at the center point of a line/area", "location": [ "point", "centroid" ], "icon": "circle:white;URL or path to icon.svg", - "iconSize": "30,30,center" - "#": "Note: all these values can be tagrenderings too, e.g.:", + "iconSize": "30,30,center", + "#2": "Note: all these values can be tagrenderings too, e.g.:", "label": { "render": { "en": "Item" @@ -93,12 +93,12 @@ } }, { - "#": "Rendering of a line", + "#1": "Rendering of a line", "color": "#ff0", "width": 5 } ], - "#": "Presets describe which new items can be added on click. Delete this block if adding a new point is not relevant", + "#3": "Presets describe which new items can be added on click. Delete this block if adding a new point is not relevant", "presets": [ { "title": { @@ -116,7 +116,7 @@ ] } ], - "#": "The tagrenderings are everything that must be shown and/or asked. Use a full tag-rendering section OR a single string to call a builtin tagrendering (see https://github.com/pietervdvn/MapComplete/blob/develop/Docs/BuiltinQuestions.md)", + "#1": "The tagrenderings are everything that must be shown and/or asked. Use a full tag-rendering section OR a single string to call a builtin tagrendering (see https://github.com/pietervdvn/MapComplete/blob/develop/Docs/BuiltinQuestions.md)", "tagRenderings": [ { "render": { @@ -181,4 +181,4 @@ ] } ] -} \ No newline at end of file +} From 671ba2a0bd782a7e866407a331b6ddaa5bcbd093 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 29 Apr 2022 08:48:54 +0200 Subject: [PATCH 3/6] Update theme-template.json --- Docs/theme-template.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Docs/theme-template.json b/Docs/theme-template.json index 448533bbf..1ae6be4a0 100644 --- a/Docs/theme-template.json +++ b/Docs/theme-template.json @@ -10,7 +10,7 @@ "version": "2022-03-12", "title": { "en": "Title of your theme", - "#": "You can add extra languages here (and in all translation blocks), but make sure 'en' is everywhere" + "#1": "You can add extra languages here (and in all translation blocks), but make sure 'en' is everywhere" }, "description": { "en": "The welcome message goes here" @@ -19,14 +19,14 @@ "startZoom": 0, "startLat": 0, "startLon": 0, - "#": "For more options and configuration, see the documentation in LayoutConfig.json", - "#layers": "The list of layers is where most of the content will be. Either reuse an already existing layer by simply calling it's ID or define a whole new layer. An overview of builtin layers is at https://github.com/pietervdvn/MapComplete/blob/develop/Docs/BuiltinLayers.md#normal-layers", + "#7": "For more options and configuration, see the documentation in LayoutConfig.json", + "#8": "`layers` is where most of the content will be. Either reuse an already existing layer by simply calling it's ID or define a whole new layer. An overview of builtin layers is at https://github.com/pietervdvn/MapComplete/blob/develop/Docs/BuiltinLayers.md#normal-layers", "layers": [ { "id": "a singular noun describing the feature, in english", "source": { "osmTags": { - "#": "For a description on which tags are possible, see https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md", + "#1": "For a description on which tags are possible, see https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md", "and": [ "key0=value0", "key1=value1", @@ -54,12 +54,12 @@ { "if": "name~*", "then": { - "#": "If name is given, use name instead as popup title. Note that the translation here uses '*' instead of 'en', which'll be shown in every language", + "#1": "If name is given, use name instead as popup title. Note that the translation here uses '*' instead of 'en', which'll be shown in every language", "*": "{name}" } } ], - "#": "Note that this is a tagRendering, but doesn't have a question field" + "#1": "Note that this is a tagRendering, but doesn't have a question field" }, "allowMove": true, "deletion": { @@ -143,7 +143,7 @@ }, "freeform": { "key": "some_osm_key", - "#": "Types can be found at https://github.com/pietervdvn/MapComplete/blob/develop/Docs/SpecialInputElements.md", + "#1": "Types can be found at https://github.com/pietervdvn/MapComplete/blob/develop/Docs/SpecialInputElements.md", "type": "nat" }, "mappings": [ @@ -152,7 +152,7 @@ "then": { "en": "Text on radio button which also is shown if somekey=some_value is present on the object" }, - "#": "If this option is picked as answer, these tags will be added additionally. However, if 'somekey=some_value' is present, the above rendering will be shown", + "#1": "If this option is picked as answer, these tags will be added additionally. However, if 'somekey=some_value' is present, the above rendering will be shown", "addExtraTags": [ "extrakey=extravalue" ] @@ -169,9 +169,9 @@ "icon": { "path": "/path/to/extra-icon.svg OR url", "class": "medium", - "#": "An extra icon supporting this option" + "#1": "An extra icon supporting this option" }, - "#": "If this option is picked as answer, these tags will be added additionally. However, if 'somekey=some_value' is present, the above rendering will be shown", + "#1": "If this option is picked as answer, these tags will be added additionally. However, if 'somekey=some_value' is present, the above rendering will be shown", "addExtraTags": [ "extrakey=extravalue" ] From af91c2649a9e913432e977d07f7d9bc6bd81cd70 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 29 Apr 2022 10:12:43 +0200 Subject: [PATCH 4/6] Update theme-template.json This change is needed in order to be able to take the template and open it as a theme without errors. --- Docs/theme-template.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Docs/theme-template.json b/Docs/theme-template.json index 1ae6be4a0..d3482666c 100644 --- a/Docs/theme-template.json +++ b/Docs/theme-template.json @@ -63,9 +63,13 @@ }, "allowMove": true, "deletion": { - "softDeletionTags": [ - "disused:key:={key}" - ] + "softDeletionTags": { + "and": [ + "razed:tourism=artwork", + "tourism=" + ] + }, + "neededChangesets": 5 }, "#2": "The maprenderings describe how a feature is shown on the map", "mapRendering": [ From 87fa7a03c1f4904150173798c098736c63920046 Mon Sep 17 00:00:00 2001 From: Thierry1030 <64559939+Thierry1030@users.noreply.github.com> Date: Fri, 29 Apr 2022 20:53:31 +0200 Subject: [PATCH 5/6] added bike helmets as an extra option --- assets/layers/bicycle_rental/bicycle_rental.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/layers/bicycle_rental/bicycle_rental.json b/assets/layers/bicycle_rental/bicycle_rental.json index 71443941e..c95c4ded2 100644 --- a/assets/layers/bicycle_rental/bicycle_rental.json +++ b/assets/layers/bicycle_rental/bicycle_rental.json @@ -231,6 +231,14 @@ "de": "Rennräder können hier gemietet werden", "es": "Aquí se pueden alquilar bicicletas de carreras" } + }, + { + "if": "rental=bike_helmet" + "then": { + "en": "Bike helmets can be rented here", + "nl": "Fietshelmpen kunnen hier gehuurd worden", + "es": "Aquí se pueden alquilar cascos" + } } ] }, @@ -422,4 +430,4 @@ } ] } -} \ No newline at end of file +} From 9a24ab92c8f4527d246275da04b7dbea5c01b4ed Mon Sep 17 00:00:00 2001 From: Thierry1030 <64559939+Thierry1030@users.noreply.github.com> Date: Fri, 29 Apr 2022 20:58:01 +0200 Subject: [PATCH 6/6] fixed typo (comma) --- assets/layers/bicycle_rental/bicycle_rental.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/layers/bicycle_rental/bicycle_rental.json b/assets/layers/bicycle_rental/bicycle_rental.json index c95c4ded2..83f9c1086 100644 --- a/assets/layers/bicycle_rental/bicycle_rental.json +++ b/assets/layers/bicycle_rental/bicycle_rental.json @@ -233,7 +233,7 @@ } }, { - "if": "rental=bike_helmet" + "if": "rental=bike_helmet", "then": { "en": "Bike helmets can be rented here", "nl": "Fietshelmpen kunnen hier gehuurd worden",