diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index f4986e0aa..458a64361 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -1,33 +1,13 @@ { "id": "mapcomplete-changes", "title": { - "en": "Changes made with MapComplete", - "ca": "Canvis fets amb MapComplete", - "cs": "Změny provedené pomocí MapComplete", - "de": "Mit MapComplete erstellte Änderungen", - "es": "Cambios realizados con MapComplete", - "fr": "Changements faits avec MapComplete", - "nl": "Wijzigingen gemaakt met MapComplete", - "pl": "Zmiany wprowadzone za pomocą MapComplete" + "en": "Changes made with MapComplete" }, "shortDescription": { - "en": "Show changes made with MapComplete", - "ca": "Mostra els canvis fets amb MapComplete", - "cs": "Zobrazení změn provedených pomocí nástroje MapComplete", - "de": "Mit MapComplete erstellte Änderungen anzeigen", - "es": "Mostrar cambios realizados con MapComplete", - "nl": "Toon wijzigingen gemaakt met MapComplete", - "pl": "Pokaż zmiany wprowadzone za pomocą MapComplete" + "en": "Shows changes made by MapComplete" }, "description": { - "en": "This maps shows all the changes made with MapComplete", - "ca": "Aquest mapa mostra tots els canvis fets amb MapComplete", - "cs": "Tato mapa zobrazuje všechny změny provedené pomocí MapComplete", - "de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen", - "es": "Este mapa muestra todos los cambios realizados con MapComplete", - "fr": "Cette carte montre tous les changements faits avec MapComplete", - "nl": "Deze kaart toont alle wijzigingen die met MapComplete gemaakt werden", - "pl": "Ta mapa pokazuje wszystkie zmiany wprowadzone za pomocą MapComplete" + "en": "This maps shows all the changes made with MapComplete" }, "icon": "./assets/svg/logo.svg", "hideFromOverview": true, @@ -40,13 +20,7 @@ { "id": "mapcomplete-changes", "name": { - "en": "Changeset centers", - "ca": "Centre del conjunt de canvis", - "cs": "Centrum změn", - "de": "Zentrum der Änderungssätze", - "es": "Centro del conjunto de cambios", - "nl": "Centerpunt van changeset", - "pl": "Centra zmian" + "en": "Changeset centers" }, "minzoom": 0, "source": { @@ -57,85 +31,41 @@ }, "title": { "render": { - "en": "Changeset for {theme}", - "ca": "Conjunt de canvis per a {theme}", - "cs": "Změna pro {theme}", - "de": "Änderungssatz für {theme}", - "es": "Conjunto de cambios para {theme}", - "fr": "Groupe de modifications pour {theme}", - "pl": "Zestaw zmian dla {theme}" + "en": "Changeset for {theme}" } }, "description": { - "en": "Show all MapComplete changes", - "ca": "Mostra tots els canvis de MapComplete", - "cs": "Zobrazit všechny změny MapComplete", - "de": "Alle MapComplete-Änderungen anzeigen", - "es": "Mostrar todos los cambios de MapComplete", - "nl": "Toon alle MapComplete wijzigingen", - "pl": "Wyświetl wszystkie zmiany MapComplete" + "en": "Shows all MapComplete changes" }, "tagRenderings": [ { "id": "show_changeset_id", "render": { - "en": "Changeset {id}", - "ca": "Conjunt de canvi {id}", - "cs": "Změny {id}", - "de": "Änderungssatz {id}", - "es": "Conjunto de cambios {id}", - "fr": "Groupe de modifications {id}", - "pl": "Zestaw zmian {id}" + "en": "Changeset {id}" } }, { "id": "contributor", "question": { - "en": "Which contributor made this change?", - "ca": "Quin col·laborador va fer aquest canvi?", - "cs": "Který přispěvatel tuto změnu provedl?", - "de": "Wer hat diese Änderung vorgenommen?", - "es": "¿Qué contribuidor hizo este cambio?", - "fr": "Quel contributeur a fait cette modification ?", - "nl": "Welke bijdrager maakte deze wijziging?", - "pl": "Który współautor dokonał tej zmiany?" + "en": "What contributor did make this change?" }, "freeform": { "key": "user" }, "render": { - "en": "Change made by {user}", - "ca": "Canvi fet per {user}", - "cs": "Změna provedená {user}", - "de": "Änderung von {user}", - "es": "Cambio realizado por {user}", - "fr": "Modification faite par {user}", - "nl": "Wijziging gemaakt door {user}", - "pl": "Zmiana dokonana przez {user}" + "en": "Change made by {user}" } }, { "id": "theme-id", "question": { - "en": "What theme was used to make this change?", - "ca": "Quin tema es va utilitzar per fer aquest canvi?", - "cs": "Jaké téma bylo použito k provedení této změny?", - "de": "Welches Thema wurde für diese Änderung verwendet?", - "es": "¿Qué tema se utilizó para realizar este cambio?", - "fr": "Quel thème a été utilisé pour faire cette modification ?", - "pl": "Jakiego tematu użyto do wprowadzenia tej zmiany?" + "en": "What theme was used to make this change?" }, "freeform": { "key": "theme" }, "render": { - "en": "Change with theme {theme}", - "ca": "Canvi amb el tema {theme}", - "cs": "Změna s motivem {theme}", - "de": "Geändert mit Thema {theme}", - "es": "Cambio con tema {theme}", - "fr": "Modifié avec le thème {theme}", - "pl": "Zmiana za pomocą motywu {theme}" + "en": "Change with theme {theme}" } }, { @@ -144,45 +74,19 @@ "key": "locale" }, "question": { - "en": "What locale (language) was this change made in?", - "ca": "Amb quina configuració regional (idioma) s'ha fet aquest canvi?", - "cs": "V jakém národním prostředí (jazyce) byla tato změna provedena?", - "de": "In welcher Benutzersprache wurde diese Änderung vorgenommen?", - "es": "¿En qué configuración regional (idioma) se realizó este cambio?", - "fr": "En quelle langue est-ce que ce changement a été fait ?", - "nl": "In welke locale (taal) werd deze wijziging gemaakt?", - "pl": "W jakim języku wprowadzono tę zmianę?" + "en": "What locale (language) was this change made in?" }, "render": { - "en": "User locale is {locale}", - "ca": "La configuració regional de l'usuari és {locale}", - "cs": "Uživatelské prostředí je {locale}", - "de": "Benutzersprache {locale}", - "es": "La configuración regional del usuario es {locale}", - "nl": "De gebruikerstaal is {locale}", - "pl": "Ustawienia regionalne użytkownika to {locale}" + "en": "User locale is {locale}" } }, { "id": "host", "render": { - "en": "Change made with {host}", - "ca": "Canviat fet amb {host}", - "cs": "Změna provedená pomocí {host}", - "de": "Geändert über {host}", - "es": "Cambio realizado con {host}", - "fr": "Modification faite avec {host}", - "nl": "Wijziging gemaakt met {host}", - "pl": "Zmiana dokonana w {host}" + "en": "Change with with {host}" }, "question": { - "en": "What host (website) was this change made with?", - "ca": "Amb quin amfitrió (lloc web) es va fer aquest canvi?", - "cs": "U jakého hostitele (webové stránky) byla tato změna provedena?", - "de": "Über welchen Host (Webseite) wurde diese Änderung vorgenommen?", - "es": "¿Con qué host (página web) se realizó este cambio?", - "nl": "Met welke host (website) werd deze wijziging gemaakt?", - "pl": "Na jakim hoście (stronie internetowej) dokonano tej zmiany?" + "en": "What host (website) was this change made with?" }, "freeform": { "key": "host" @@ -203,22 +107,10 @@ { "id": "version", "question": { - "en": "What version of MapComplete was used to make this change?", - "ca": "Quina versió de MapComplete es va utilitzar per fer aquest canvi?", - "cs": "Jaká verze aplikace MapComplete byla použita k provedení této změny?", - "de": "Mit welcher Version von MapComplete wurde diese Änderung gemacht?", - "es": "¿Qué versión de MapComplete se usó para realizar este cambio?", - "fr": "Quelle version de MapComplete a été utilisée pour faire cette modification ?", - "pl": "Która wersja MapComplete została wykorzystana, aby zrobić tę zmianę?" + "en": "What version of MapComplete was used to make this change?" }, "render": { - "en": "Made with {editor}", - "ca": "Fet amb {editor}", - "cs": "Vyrobeno pomocí {editor}", - "de": "Erstellt mit {editor}", - "es": "Realizado con {editor}", - "fr": "Fait avec {editor}", - "pl": "Zrobione za pomocą {editor}" + "en": "Made with {editor}" }, "freeform": { "key": "editor" @@ -392,6 +284,10 @@ "if": "theme=kerbs_and_crossings", "then": "./assets/layers/kerbs/KerbIcon.svg" }, + { + "if": "theme=mapcomplete-changes", + "then": "./assets/svg/logo.svg" + }, { "if": "theme=maproulette", "then": "./assets/layers/maproulette/logomark.svg" @@ -564,13 +460,45 @@ } ], "question": { - "en": "Theme name contains {search}", - "ca": "El nom del tema conté {search}", - "cs": "Název motivu obsahuje {search}", - "de": "Themenname enthält {search}", - "es": "El nombre del tema contiene {search}", - "nl": "Themenaam bevat {search}", - "pl": "Nazwa tematu zawiera {search}" + "en": "Themename contains {search}" + } + } + ] + }, + { + "id": "theme-not-search", + "options": [ + { + "osmTags": "theme!~i~.*{search}.*", + "fields": [ + { + "name": "search" + } + ], + "question": { + "en": "Themename does not contain {search}" + } + } + ] + }, + { + "id": "exclude_grb", + "options": [ + { + "osmTags": "theme!=grb", + "question": { + "en": "Exclude GRB theme" + } + } + ] + }, + { + "id": "exclude_etymology", + "options": [ + { + "osmTags": "theme!=etymology", + "question": { + "en": "Exclude etymology theme" } } ] @@ -586,13 +514,7 @@ } ], "question": { - "en": "Made by contributor {search}", - "ca": "Fet pel col·laborador {search}", - "cs": "Vytvořil přispěvatel {search}", - "de": "Erstellt von {search}", - "es": "Hecho por el colaborador {search}", - "nl": "Gemaakt door bijdrager {search}", - "pl": "Wykonane przez współautora {search}" + "en": "Made by contributor {search}" } } ] @@ -608,13 +530,7 @@ } ], "question": { - "en": "Not made by contributor {search}", - "ca": "No fet pel col·laborador {search}", - "cs": "Není vytvořeno přispěvatelem {search}", - "de": "Nicht erstellt von {search}", - "es": "No hecho por el colaborador {search}", - "nl": "Niet gemaakt door bijdrager {search}", - "pl": "Nie wykonane przez współautora {search}" + "en": "Not made by contributor {search}" } } ] @@ -631,13 +547,7 @@ } ], "question": { - "en": "Made before {search}", - "ca": "Fet abans de {search}", - "cs": "Vytvořeno před {search}", - "de": "Erstellt vor {search}", - "es": "Hecho antes de {search}", - "nl": "Gemaakt voor {search}", - "pl": "Stworzone przed {search}" + "en": "Made before {search}" } } ] @@ -654,13 +564,7 @@ } ], "question": { - "en": "Made after {search}", - "ca": "Fet després de {search}", - "cs": "Vytvořeno po {search}", - "de": "Erstellt nach {search}", - "es": "Hecho después de {search}", - "nl": "Gemaakt na {search}", - "pl": "Stworzone po {search}" + "en": "Made after {search}" } } ] @@ -676,14 +580,7 @@ } ], "question": { - "en": "User language (iso-code) {search}", - "ca": "Idioma de l'usuari (codi iso) {search}", - "cs": "Jazyk uživatele (iso-kód) {search}", - "de": "Benutzersprache (ISO-Code) {search}", - "es": "Use idioma (ISO-code) {search}", - "fr": "Langage utilisateur (code-ISO) {search}", - "nl": "De taal van de bijdrager is {search}", - "pl": "Język użytkownika (kod iso) {search}" + "en": "User language (iso-code) {search}" } } ] @@ -699,13 +596,7 @@ } ], "question": { - "en": "Made with host {search}", - "ca": "Fet amb l'amfitrió {search}", - "cs": "Vytvořeno pomocí hostitele {search}", - "de": "Erstellt mit Host {search}", - "es": "Hecho con el host {search}", - "nl": "Gemaakt met host {search}", - "pl": "Wykonane z hostem {search}" + "en": "Made with host {search}" } } ] @@ -716,14 +607,7 @@ { "osmTags": "add-image>0", "question": { - "en": "Changeset added at least one image", - "ca": "El conjunt de canvis ha afegit almenys una imatge", - "cs": "Sada změn přidala alespoň jeden obrázek", - "de": "Im Änderungssatz wurde mindestens ein Bild hinzugefügt", - "es": "El conjunto de cambios ha añadido al menos una imagen", - "fr": "Le groupe de modifications a ajouté au moins une image", - "nl": "Changeset bevat minstens één afbeelding", - "pl": "Zestaw zmian dodał co najmniej jedno zdjęcie" + "en": "Changeset added at least one image" } } ] @@ -738,13 +622,7 @@ { "id": "link_to_more", "render": { - "en": "More statistics can be found here", - "ca": "Es pot trobar més estadística aquí", - "cs": "Další statistiky najdete here", - "de": "Mehr Statistiken gibt es hier", - "es": "Puede encontrar más estadísticas aquí", - "fr": "D'autres statistiques sont disponibles ici", - "pl": "Więcej statystyk można znaleźć tutaj" + "en": "More statistics can be found here" } }, { @@ -778,4 +656,4 @@ } } ] -} +} \ No newline at end of file diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json index e7a05ff6e..5d4ac38cc 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json @@ -151,6 +151,44 @@ } ] }, + { + "id": "theme-not-search", + "options": [ + { + "osmTags": "theme!~i~.*{search}.*", + "fields": [ + { + "name": "search" + } + ], + "question": { + "en": "Themename does not contain {search}" + } + } + ] + }, + { + "id": "exclude_grb", + "options": [ + { + "osmTags": "theme!=grb", + "question": { + "en": "Exclude GRB theme" + } + } + ] + }, + { + "id": "exclude_etymology", + "options": [ + { + "osmTags": "theme!=etymology", + "question": { + "en": "Exclude etymology theme" + } + } + ] + }, { "id": "created_by", "options": [ diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index dcfbb71ad..75422520c 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -392,8 +392,10 @@ class LayerOverviewUtils extends Script { const mcChangesPath = "./assets/themes/mapcomplete-changes/mapcomplete-changes.json" if ( (recompiledThemes.length > 0 && - !(recompiledThemes.length === 1 && recompiledThemes[0] === "mapcomplete-changes") && - args.indexOf("--generate-change-map") >= 0) || + !( + recompiledThemes.length === 1 && recompiledThemes[0] === "mapcomplete-changes" + )) || + args.indexOf("--generate-change-map") >= 0 || !existsSync(mcChangesPath) ) { // mapcomplete-changes shows an icon for each corresponding mapcomplete-theme diff --git a/src/UI/BigComponents/TagRenderingChart.ts b/src/UI/BigComponents/TagRenderingChart.ts index 2fb359519..c187fb80e 100644 --- a/src/UI/BigComponents/TagRenderingChart.ts +++ b/src/UI/BigComponents/TagRenderingChart.ts @@ -18,6 +18,8 @@ export class StackedRenderingChart extends ChartJs { options?: { period: "day" | "month" groupToOtherCutoff?: 3 | number + // If given, take the sum of these fields to get the feature weight + sumFields?: string[] } ) { const { labels, data } = TagRenderingChart.extractDataAndLabels(tr, features, { @@ -78,7 +80,30 @@ export class StackedRenderingChart extends ChartJs { const countsPerDay: number[] = [] for (let i = 0; i < trimmedDays.length; i++) { const day = trimmedDays[i] - countsPerDay[i] = perDay[day]?.length ?? 0 + + const featuresForDay = perDay[day] + if (!featuresForDay) { + continue + } + if (options.sumFields !== undefined) { + let sum = 0 + for (const featuresForDayElement of featuresForDay) { + const props = featuresForDayElement.properties + for (const key of options.sumFields) { + if (!props[key]) { + continue + } + const v = Number(props[key]) + if (isNaN(v)) { + continue + } + sum += v + } + } + countsPerDay[i] = sum + } else { + countsPerDay[i] = featuresForDay?.length ?? 0 + } } let backgroundColor = TagRenderingChart.borderColors[i % TagRenderingChart.borderColors.length] diff --git a/src/UI/Favourites/FavouriteSummary.svelte b/src/UI/Favourites/FavouriteSummary.svelte index 4ac879628..589280740 100644 --- a/src/UI/Favourites/FavouriteSummary.svelte +++ b/src/UI/Favourites/FavouriteSummary.svelte @@ -13,8 +13,8 @@ let tags = state.featureProperties.getStore(properties.id) ?? new ImmutableStore(properties); const favLayer = state.layerState.filteredLayers.get("favourite"); - const favConfig = favLayer.layerDef; - const titleConfig = favConfig.title; + const favConfig = favLayer?.layerDef; + const titleConfig = favConfig?.title; function center() { const [lon, lat] = GeoOperations.centerpointCoordinates(feature); @@ -50,6 +50,7 @@ +{#if favLayer !== undefined}