diff --git a/Docs/Schemas/LayerConfigJson.schema.json b/Docs/Schemas/LayerConfigJson.schema.json index 4a531c488..3e759fd10 100644 --- a/Docs/Schemas/LayerConfigJson.schema.json +++ b/Docs/Schemas/LayerConfigJson.schema.json @@ -167,7 +167,7 @@ ] }, "mapRendering": { - "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering", + "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering\ntypes: PointRendering ; LineRendering ;", "type": "array", "items": { "anyOf": [ diff --git a/Docs/Schemas/LayerConfigJsonJSC.ts b/Docs/Schemas/LayerConfigJsonJSC.ts index 6d732e83c..3f12e9b9b 100644 --- a/Docs/Schemas/LayerConfigJsonJSC.ts +++ b/Docs/Schemas/LayerConfigJsonJSC.ts @@ -167,7 +167,7 @@ export default { ] }, "mapRendering": { - "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering", + "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering\ntypes: PointRendering ; LineRendering ;", "type": "array", "items": { "anyOf": [ diff --git a/Docs/Schemas/LayoutConfigJson.schema.json b/Docs/Schemas/LayoutConfigJson.schema.json index 71487576f..a8bf86f88 100644 --- a/Docs/Schemas/LayoutConfigJson.schema.json +++ b/Docs/Schemas/LayoutConfigJson.schema.json @@ -1898,7 +1898,7 @@ ] }, "mapRendering": { - "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering", + "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering\ntypes: PointRendering ; LineRendering ;", "type": "array", "items": { "anyOf": [ @@ -2300,7 +2300,7 @@ ] }, "mapRendering": { - "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering", + "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering\ntypes: PointRendering ; LineRendering ;", "type": "array", "items": { "anyOf": [ diff --git a/Docs/Schemas/LayoutConfigJsonJSC.ts b/Docs/Schemas/LayoutConfigJsonJSC.ts index a9a11f85e..c840dfce9 100644 --- a/Docs/Schemas/LayoutConfigJsonJSC.ts +++ b/Docs/Schemas/LayoutConfigJsonJSC.ts @@ -1877,7 +1877,7 @@ export default { ] }, "mapRendering": { - "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering", + "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering\ntypes: PointRendering ; LineRendering ;", "type": "array", "items": { "anyOf": [ @@ -2278,7 +2278,7 @@ export default { ] }, "mapRendering": { - "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering", + "description": "Visualisation of the items on the map\nSet 'null' explicitly if you do not want a maprendering\ngroup: maprendering\ntypes: PointRendering ; LineRendering ;", "type": "array", "items": { "anyOf": [ diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 3bd0b3b29..dabbec8e1 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -1,21 +1,13 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete", - "de": "Mit MapComplete erstellte Änderungen", - "fr": "Changements faits avec MapComplete", - "nl": "Wijzigingen gemaakt met MapComplete" + "en": "Changes made with MapComplete" }, "shortDescription": { - "en": "Show changes made with MapComplete", - "de": "Mit MapComplete erstellte Änderungen anzeigen", - "nl": "Toon wijzigingen gemaakt met MapComplete" + "en": "Shows changes made by MapComplete" }, "description": { - "en": "This maps shows all the changes made with MapComplete", - "de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen", - "fr": "Cette carte montre tous les changements faits avec MapComplete", - "nl": "Deze kaart toont alle wijzigingen die met MapComplete gemaakt werden" + "en": "This maps shows all the changes made with MapComplete" }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -28,9 +20,7 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers", - "de": "Zentrum der Änderungssätze", - "nl": "Centerpunt van changeset" + "en": "Changeset centers" }, "minzoom": 0, "source": { @@ -41,57 +31,41 @@ }, "title": { "render": { - "en": "Changeset for {theme}", - "de": "Änderungssatz für {theme}", - "fr": "Groupe de modifications pour {theme}" + "en": "Changeset for {theme}" } }, "description": { - "en": "Show all MapComplete changes", - "de": "Alle MapComplete-Änderungen anzeigen", - "nl": "Toon alle MapComplete wijzigingen" + "en": "Shows all MapComplete changes" }, "tagRenderings": [ { "id": "show_changeset_id", "render": { - "en": "Changeset {id}", - "de": "Änderungssatz {id}", - "fr": "Groupe de modifications {id}" + "en": "Changeset {id}" } }, { "id": "contributor", "question": { - "en": "Which contributor made this change?", - "de": "Welcher Mitwirkende hat diese Änderung vorgenommen?", - "fr": "Quel contributeur a fait cette modification ?", - "nl": "Welke bijdrager maakte deze wijziging?" + "en": "What contributor did make this change?" }, "freeform": { "key": "user" }, "render": { - "en": "Change made by {user}", - "de": "Änderung gemacht von {user}", - "fr": "Modification faite par {user}", - "nl": "Wijziging gemaakt door {user}" + "en": "Change made by {user}" } }, { "id": "theme-id", "question": { - "en": "What theme was used to make this change?", - "de": "Welches Thema wurde für diese Änderung verwendet?", - "fr": "Quel thème a été utilisé pour faire cette modification ?" + "en": "What theme was used to make this change?" }, "freeform": { "key": "theme" }, "render": { - "en": "Change with theme {theme}", - "de": "Geändert mit Thema {theme}", - "fr": "Modifié avec le thème {theme}" + "en": "Change with theme {theme}" } }, { @@ -100,29 +74,19 @@ "key": "locale" }, "question": { - "en": "What locale (language) was this change made in?", - "de": "In welcher Sprache wurde diese Änderung vorgenommen?", - "fr": "En quelle langue est-ce que ce changement a été fait ?", - "nl": "In welke locale (taal) werd deze wijziging gemaakt?" + "en": "What locale (language) was this change made in?" }, "render": { - "en": "User locale is {locale}", - "de": "Usersprache ist {locale}", - "nl": "De gebruikerstaal is {locale}" + "en": "User locale is {locale}" } }, { "id": "host", "render": { - "en": "Change made with {host}", - "de": "Änderung vorgenommen mit {host}", - "fr": "Modification faite avec {host}", - "nl": "Wijziging gemaakt met {host}" + "en": "Change with with {host}" }, "question": { - "en": "What host (website) was this change made with?", - "de": "Mit welchem Host / welcher Website wurde diese Änderung gemacht?", - "nl": "Met welke host (website) werd deze wijziging gemaakt?" + "en": "What host (website) was this change made with?" }, "freeform": { "key": "host" @@ -143,14 +107,10 @@ { "id": "version", "question": { - "en": "What version of MapComplete was used to make this change?", - "de": "Mit welcher Version von MapComplete wurde diese Änderung gemacht?", - "fr": "Quelle version de MapComplete a été utilisée pour faire cette modification ?" + "en": "What version of MapComplete was used to make this change?" }, "render": { - "en": "Made with {editor}", - "de": "Erstellt mit {editor}", - "fr": "Fait avec {editor}" + "en": "Made with {editor}" }, "freeform": { "key": "editor" @@ -492,9 +452,7 @@ } ], "question": { - "en": "Theme name contains {search}", - "de": "Themenname enthält {search}", - "nl": "Themenaam bevat {search}" + "en": "Themename contains {search}" } } ] @@ -510,9 +468,7 @@ } ], "question": { - "en": "Made by contributor {search}", - "de": "Erstellt von {search}", - "nl": "Gemaakt door bijdrager {search}" + "en": "Made by contributor {search}" } } ] @@ -528,9 +484,7 @@ } ], "question": { - "en": "Not made by contributor {search}", - "de": "Nicht erstellt von {search}", - "nl": "Niet gemaakt door bijdrager {search}" + "en": "Not made by contributor {search}" } } ] @@ -547,9 +501,7 @@ } ], "question": { - "en": "Made before {search}", - "de": "Erstellt vor {search}", - "nl": "Gemaakt voor {search}" + "en": "Made before {search}" } } ] @@ -566,9 +518,7 @@ } ], "question": { - "en": "Made after {search}", - "de": "Erstellt nach {search}", - "nl": "Gemaakt na {search}" + "en": "Made after {search}" } } ] @@ -584,10 +534,7 @@ } ], "question": { - "en": "User language (iso-code) {search}", - "de": "Benutzersprache (ISO-Code) {search}", - "fr": "Langage utilisateur (code-ISO) {search}", - "nl": "De taal van de bijdrager is {search}" + "en": "User language (iso-code) {search}" } } ] @@ -603,9 +550,7 @@ } ], "question": { - "en": "Made with host {search}", - "de": "Erstellt mit Host {search}", - "nl": "Gemaakt met host {search}" + "en": "Made with host {search}" } } ] @@ -616,10 +561,7 @@ { "osmTags": "add-image>0", "question": { - "en": "Changeset added at least one image", - "de": "Changeset fügte mindestens ein Bild hinzu", - "fr": "Le groupe de modifications a ajouté au moins une image", - "nl": "Changeset bevat minstens één afbeelding" + "en": "Changeset added at least one image" } } ] @@ -634,9 +576,7 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here", - "de": "Mehr Statistiken gibt es hier", - "fr": "D'autres statistiques sont disponibles ici" + "en": "More statistics can be found here" } }, { @@ -666,4 +606,4 @@ } } ] -} +} \ No newline at end of file diff --git a/src/Models/ThemeConfig/Conversion/Conversion.ts b/src/Models/ThemeConfig/Conversion/Conversion.ts index 8ef98a428..461c1c859 100644 --- a/src/Models/ThemeConfig/Conversion/Conversion.ts +++ b/src/Models/ThemeConfig/Conversion/Conversion.ts @@ -1,9 +1,10 @@ import { TagRenderingConfigJson } from "../Json/TagRenderingConfigJson" import { LayerConfigJson } from "../Json/LayerConfigJson" import { Utils } from "../../../Utils" +import { QuestionableTagRenderingConfigJson } from "../Json/QuestionableTagRenderingConfigJson" export interface DesugaringContext { - tagRenderings: Map + tagRenderings: Map sharedLayers: Map publicLayers?: Set } diff --git a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts index 8e40718ff..137e15bbc 100644 --- a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts +++ b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts @@ -161,9 +161,12 @@ class ExpandTagRendering extends Conversion< } convert( - json: string | TagRenderingConfigJson | { builtin: string | string[]; override: any }, + json: + | string + | QuestionableTagRenderingConfigJson + | { builtin: string | string[]; override: any }, context: string - ): { result: TagRenderingConfigJson[]; errors: string[]; warnings: string[] } { + ): { result: QuestionableTagRenderingConfigJson[]; errors: string[]; warnings: string[] } { const errors = [] const warnings = [] @@ -303,7 +306,7 @@ class ExpandTagRendering extends Conversion< } return [ - { + { render: tr, id: tr.replace(/[^a-zA-Z0-9]/g, ""), }, @@ -416,7 +419,7 @@ class ExpandTagRendering extends Conversion< warnings: string[], errors: string[], ctx: string - ): TagRenderingConfigJson[] { + ): QuestionableTagRenderingConfigJson[] { const trs = this.convertOnce(spec, warnings, errors, ctx) const result = [] @@ -547,7 +550,11 @@ export class AddQuestionBox extends DesugaringStep { // ALl labels that are used in this layer const allLabels = new Set( - [].concat(...json.tagRenderings.map((tr) => (tr).labels ?? [])) + [].concat( + ...json.tagRenderings.map( + (tr) => (tr).labels ?? [] + ) + ) ) const seen = new Set() for (const questionSpecial of questionSpecials) { @@ -593,7 +600,7 @@ export class AddQuestionBox extends DesugaringStep { /* At this point, we know which question labels are not yet handled and which already are handled, and we * know there is no previous catch-all questions */ - const question: TagRenderingConfigJson = { + const question: QuestionableTagRenderingConfigJson = { id: "leftover-questions", render: { "*": `{questions( ,${Array.from(seen).join(";")})}`, @@ -670,7 +677,7 @@ export class AddEditingElements extends DesugaringStep { } if (!ValidationUtils.hasSpecialVisualisation(json, "all_tags")) { - const trc: TagRenderingConfigJson = { + const trc: QuestionableTagRenderingConfigJson = { id: "all-tags", render: { "*": "{all_tags()}" }, @@ -803,6 +810,8 @@ export class ExpandRewrite extends Conversion, T[ return { result: [json] } } + console.log("Rewriting at", context) + const rewrite = >json const keysToRewrite = rewrite.rewrite const ts: T[] = [] @@ -1142,7 +1151,7 @@ class ExpandIconBadges extends DesugaringStepiconBadge.then, context + ".iconBadges[" + i + "]" ) errs.push(...errors) diff --git a/src/Models/ThemeConfig/Json/LayerConfigJson.ts b/src/Models/ThemeConfig/Json/LayerConfigJson.ts index 3e17c1e12..664c6662d 100644 --- a/src/Models/ThemeConfig/Json/LayerConfigJson.ts +++ b/src/Models/ThemeConfig/Json/LayerConfigJson.ts @@ -10,6 +10,8 @@ import { QuestionableTagRenderingConfigJson } from "./QuestionableTagRenderingCo import RewritableConfigJson from "./RewritableConfigJson" import { Translatable } from "./Translatable" +type MapRendering = {} + /** * Configuration for a single layer */ @@ -239,17 +241,9 @@ export interface LayerConfigJson { * Visualisation of the items on the map * Set 'null' explicitly if you do not want a maprendering * group: maprendering + * types: PointRendering ; LineRendering */ - mapRendering?: ( - | PointRenderingConfigJson - | LineRenderingConfigJson - | RewritableConfigJson< - | LineRenderingConfigJson - | PointRenderingConfigJson - | LineRenderingConfigJson[] - | PointRenderingConfigJson[] - > - )[] + mapRendering?: (PointRenderingConfigJson | LineRenderingConfigJson)[] /** * If set, this layer will pass all the features it receives onto the next layer. diff --git a/src/UI/Studio/Region.svelte b/src/UI/Studio/Region.svelte index 9b07c6efb..aafc537a9 100644 --- a/src/UI/Studio/Region.svelte +++ b/src/UI/Studio/Region.svelte @@ -28,9 +28,6 @@ export let path: (string | number)[] = []; {:else} -
- {JSON.stringify(configs, null, " ")} -
{#each configs as config} diff --git a/src/UI/Studio/SchemaBasedMultiType.svelte b/src/UI/Studio/SchemaBasedMultiType.svelte index 6b141b34f..5df7213ae 100644 --- a/src/UI/Studio/SchemaBasedMultiType.svelte +++ b/src/UI/Studio/SchemaBasedMultiType.svelte @@ -122,7 +122,6 @@ const oldOption = chosenOption; chosenOption = tags["value"] ? Number(tags["value"]) : defaultOption; const type = schema.type[chosenOption]; - console.log("Subtype is", type, {chosenOption, oldOption, schema}); if (chosenOption !== oldOption) { // Reset the values beneath subSchemas = []; diff --git a/src/assets/schemas/layerconfigmeta.json b/src/assets/schemas/layerconfigmeta.json index 742d426f9..a0ade2343 100644 --- a/src/assets/schemas/layerconfigmeta.json +++ b/src/assets/schemas/layerconfigmeta.json @@ -1583,6 +1583,7 @@ ], "required": false, "hints": { + "types": "PointRendering ; LineRendering ;", "group": "maprendering" }, "type": [ @@ -43330,6 +43331,10 @@ "if": "value=elevator", "then": "elevator - This layer show elevators and asks for operational status and elevator dimensions. Useful for wheelchair accessibility information" }, + { + "if": "value=elongated_coin", + "then": "elongated_coin - Layer showing penny presses." + }, { "if": "value=entrance", "then": "entrance - A layer showing entrances and offering capabilities to survey some advanced data which is important for e.g. wheelchair users (but also bicycle users, people who want to deliver, …)"