diff --git a/Models/ThemeConfig/Conversion/Validation.ts b/Models/ThemeConfig/Conversion/Validation.ts index df2b80e22..1347da5fa 100644 --- a/Models/ThemeConfig/Conversion/Validation.ts +++ b/Models/ThemeConfig/Conversion/Validation.ts @@ -521,8 +521,13 @@ export class ValidateLayer extends DesugaringStep { } } - if(json.title === undefined && json.tagRenderings !== undefined){ - warnings.push(context + ": this layer does not have a title defined but it does have tagRenderings. Not having a title will disable the popups, resulting in an unclickable element.") + if(json.tagRenderings !== undefined && json.tagRenderings.length > 0){ + if(json.title === undefined){ + errors.push(context + ": this layer does not have a title defined but it does have tagRenderings. Not having a title will disable the popups, resulting in an unclickable element. Please add a title. If not having a popup is intended and the tagrenderings need to be kept (e.g. in a library layer), set `title: null` to disable this error.") + } + if(json.title === null){ + information.push(context + ": title is `null`. This results in an element that cannot be clicked - even though tagRenderings is set.") + } } if (json["builtin"] !== undefined) { diff --git a/assets/layers/elevator/elevator.json b/assets/layers/elevator/elevator.json index 90987de00..1fd53a87f 100644 --- a/assets/layers/elevator/elevator.json +++ b/assets/layers/elevator/elevator.json @@ -7,6 +7,9 @@ "osmTags": "highway=elevator" }, "minzoom": 13, + "description": { + "en": "This layer show elevators and asks for operational status and elevator dimensions. Useful for wheelchair accessibility information" + }, "title": { "en": "Elevator" }, @@ -22,7 +25,15 @@ "if": "operational_status=broken", "then": { "en": "This elevator is broken" - } + }, + "icon": "close:red" + }, + { + "if": "operational_status=closed", + "then": { + "en": "This elevator is closed e.g. because renovation works are going on" + }, + "icon": "invalid:red" }, { "if": "operational_status=ok", @@ -89,6 +100,17 @@ "location": [ "point", "centroid" + ], + "iconBadges": [ + { + "if": { + "or": [ + "operational_status=broken", + "operational_status=closed" + ] + }, + "then": "close:#c33" + } ] } ], @@ -121,6 +143,7 @@ } }, { + "default": true, "canonicalDenomination": "cm", "alternativeDenomination": [ "centimeter", diff --git a/assets/layers/entrance/entrance.json b/assets/layers/entrance/entrance.json index 9bd4476a4..207279ad6 100644 --- a/assets/layers/entrance/entrance.json +++ b/assets/layers/entrance/entrance.json @@ -337,8 +337,7 @@ "es": "¿Cual es el ancho de esta puerta/entrada?" }, "freeform": { - "key": "width", - "type": "distance" + "key": "width" } }, { @@ -417,6 +416,7 @@ } }, { + "default": true, "canonicalDenomination": "cm", "alternativeDenomination": [ "centimeter", diff --git a/assets/layers/governments/governments.json b/assets/layers/governments/governments.json index 75bb148ce..89f600e7a 100644 --- a/assets/layers/governments/governments.json +++ b/assets/layers/governments/governments.json @@ -3,6 +3,9 @@ "name": { "en": "governments" }, + "description": { + "en": "This layer show governmental buildings. It was setup as commissioned layer for the client of OSOC '22" + }, "source": { "osmTags": { "or": [ diff --git a/assets/layers/hospital/hospital.json b/assets/layers/hospital/hospital.json index b773e9992..e7eb846a9 100644 --- a/assets/layers/hospital/hospital.json +++ b/assets/layers/hospital/hospital.json @@ -8,6 +8,9 @@ "en": "Hospital" } }, + "description": { + "en": "A layer showing hospital grounds" + }, "minzoom": 12, "source": { "osmTags": "amenity=hospital" @@ -39,6 +42,10 @@ "point", "centroid" ] + }, + { + "color": "#fcd862", + "width": 1 } ] } \ No newline at end of file diff --git a/assets/layers/id_presets/id_presets.json b/assets/layers/id_presets/id_presets.json index 1c30d295e..acff2db91 100644 --- a/assets/layers/id_presets/id_presets.json +++ b/assets/layers/id_presets/id_presets.json @@ -1,10 +1,13 @@ { "id": "id_presets", - "description": "Layer containing various presets and questions generated by ID. These are meant to be reused in other layers by importing the tagRenderings with `id_preset.", + "description": { + "en": "Layer containing various presets and questions generated by ID. These are meant to be reused in other layers by importing the tagRenderings with `id_preset." + }, "#dont-translate": "*", "source": { "osmTags": "id~*" }, + "title": null, "mapRendering": null, "tagRenderings": [ { diff --git a/assets/layers/indoors/indoors.json b/assets/layers/indoors/indoors.json index 1c14a47e8..4fc49ae79 100644 --- a/assets/layers/indoors/indoors.json +++ b/assets/layers/indoors/indoors.json @@ -3,6 +3,9 @@ "name": { "en": "indoors" }, + "description": { + "en": "Basic indoor mapping: shows room outlines" + }, "source": { "osmTags": { "or": [ diff --git a/assets/layers/pharmacy/pharmacy.json b/assets/layers/pharmacy/pharmacy.json index 6a9c18608..8084bbb02 100644 --- a/assets/layers/pharmacy/pharmacy.json +++ b/assets/layers/pharmacy/pharmacy.json @@ -3,6 +3,9 @@ "name": { "en": "pharmacy" }, + "description": { + "en": "A layer showing pharmacies, which (probably) dispense prescription drugs" + }, "title": { "render": { "en": "{name}" diff --git a/assets/layers/pharmacy/pharmacy.svg b/assets/layers/pharmacy/pharmacy.svg index fe46542ad..9c44db2d2 100644 --- a/assets/layers/pharmacy/pharmacy.svg +++ b/assets/layers/pharmacy/pharmacy.svg @@ -1,6 +1,4 @@ - - \ No newline at end of file diff --git a/assets/layers/reception_desk/reception_desk.json b/assets/layers/reception_desk/reception_desk.json index a9d3228c2..7139bce67 100644 --- a/assets/layers/reception_desk/reception_desk.json +++ b/assets/layers/reception_desk/reception_desk.json @@ -3,6 +3,9 @@ "name": { "en": "Reception desks" }, + "description": { + "en": "A layer showing where the reception desks are and which asks some accessibility information" + }, "title": { "render": { "en": "Reception desk" diff --git a/assets/layers/wikidata/wikidata.json b/assets/layers/wikidata/wikidata.json index e770e4985..3b7d64613 100644 --- a/assets/layers/wikidata/wikidata.json +++ b/assets/layers/wikidata/wikidata.json @@ -5,6 +5,7 @@ "source": { "osmTags": "id~*" }, + "title": null, "mapRendering": null, "tagRenderings": [ { diff --git a/assets/themes/speelplekken/speelplekken.json b/assets/themes/speelplekken/speelplekken.json index de451a2b5..4da5ec048 100644 --- a/assets/themes/speelplekken/speelplekken.json +++ b/assets/themes/speelplekken/speelplekken.json @@ -33,6 +33,7 @@ "layers": [ { "id": "shadow", + "title": null, "source": { "geoJson": "https://raw.githubusercontent.com/pietervdvn/MapComplete/master/assets/themes/speelplekken/shadow.geojson", "osmTags": "shadow=yes", diff --git a/scripts/thieves/readIdPresets.ts b/scripts/thieves/readIdPresets.ts index 0420c7064..37e414e13 100644 --- a/scripts/thieves/readIdPresets.ts +++ b/scripts/thieves/readIdPresets.ts @@ -296,8 +296,8 @@ const iconThief = new AggregateIconThief( const thief = new IdThief("../id-tagging-schema/", iconThief) -const shopLayerPath = targetDir + "id_presets.json" -const idPresets = JSON.parse(readFileSync(shopLayerPath, 'utf8')) +const id_presets_path = targetDir + "id_presets.json" +const idPresets = JSON.parse(readFileSync(id_presets_path, 'utf8')) idPresets.tagRenderings = [ { id: "shop_types", @@ -309,4 +309,4 @@ idPresets.tagRenderings = [ } ] -writeFileSync(shopLayerPath, JSON.stringify(idPresets, null, " "), 'utf8') \ No newline at end of file +writeFileSync(id_presets_path, JSON.stringify(idPresets, null, " "), 'utf8') \ No newline at end of file diff --git a/scripts/thieves/stealLanguages.ts b/scripts/thieves/stealLanguages.ts index cc775babf..94cf95362 100644 --- a/scripts/thieves/stealLanguages.ts +++ b/scripts/thieves/stealLanguages.ts @@ -54,11 +54,14 @@ function main(){ const wikidataLayer = { id: "wikidata", - description: "Various tagrenderings which are generated from Wikidata. Automatically generated with a script, don't edit manually", + description: { + en: "Various tagrenderings which are generated from Wikidata. Automatically generated with a script, don't edit manually" + }, "#dont-translate": "*", "source": { "osmTags": "id~*" }, + title: null, "mapRendering": null, tagRenderings: [ {