diff --git a/assets/layers/hostel/hostel.json b/assets/layers/hostel/hostel.json deleted file mode 100644 index 93c4bf262..000000000 --- a/assets/layers/hostel/hostel.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "minzoom": 12, - "pointRendering": [ - {id": - "location": [ - "point", - "centroid" - ], - "marker": [ - { - "icon": "circle", - "color": "white" - }, - { - "icon": "./assets/layers/hostels/hostel.svg" - } - ] - } - ], - "tagRenderings": [ - "images", - "reviews", - { - "id": "name", - "question": { - "en": "What is the name of this hostel?" - }, - "render": { - "en": "This hostel is called {name}" - }, - "freeform": { - "key": "name" - } - }, - { - "builtin": "brand", - "override": { - "question": { - "en": "Is this hostel part of a bigger brand?" - } - } - }, - "contact", - "internet-all", - "dog-access" - ], - "lineRendering": [ - { - "width": 1, - "color": "blue" - } - ], - "name": { - "en": "Hostels" - }, - "id": "hostel", - "description": { - "en": "A hostel is a type of tourist accomodation where people can sleep in a room shared with strangers" - }, - "source": { - "osmTags": "tourism=hostel" - }, - "title": { - "render": { - "en": "Hostel {name}" - } - } -} diff --git a/assets/layers/hostel/hostel.svg b/assets/layers/hostel/hostel.svg deleted file mode 100644 index 7cda45f6b..000000000 --- a/assets/layers/hostel/hostel.svg +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/assets/layers/hostel/hostel.svg.license b/assets/layers/hostel/hostel.svg.license deleted file mode 100644 index f752f0ddd..000000000 --- a/assets/layers/hostel/hostel.svg.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: OSM-Carto -SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/layers/hostel/license_info.json b/assets/layers/hostel/license_info.json deleted file mode 100644 index ca65ed7bc..000000000 --- a/assets/layers/hostel/license_info.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "path": "hostel.svg", - "license": "CC0-1.0", - "authors": [ - "OSM-Carto" - ], - "sources": [ - "https://wiki.openstreetmap.org/wiki/File:Hostel-16.svg" - ] - } -] \ No newline at end of file diff --git a/assets/layers/hotel/hotel.json b/assets/layers/hotel/hotel.json deleted file mode 100644 index ad4f73b3b..000000000 --- a/assets/layers/hotel/hotel.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "id": "hotel", - "name": { - "en": "Hotels", - "nl": "Hotels", - "de": "Hotels", - "pa_PK": "ہوٹل", - "ru": "Гостиницы", - "fr": "Hôtels", - "ca": "Hotels", - "cs": "Hotely", - "pl": "Hotele" - }, - "description": { - "en": "Layer showing all hotels", - "nl": "Laag die alle hotels toont", - "de": "Eine Ebene mit Hotels", - "fr": "Couche affichant les hôtels", - "ca": "Capa que mostra tots els hotels", - "cs": "Vrstva zobrazující všechny hotely", - "pl": "Warstwa pokazująca wszystkie hotele" - }, - "source": { - "osmTags": "tourism=hotel" - }, - "minzoom": 13, - "title": { - "render": { - "en": "Hotel", - "nl": "Hotel", - "de": "Hotel", - "pa_PK": "ہوٹل", - "fr": "Hôtel", - "ca": "Hotel", - "cs": "Hotel", - "pl": "Hotel" - }, - "mappings": [ - { - "if": "name~*", - "then": { - "en": "Hotel {name}", - "nl": "Hotel {name}", - "de": "Hotel {name}", - "fr": "Hôtel {name}", - "ca": "Hotel {name}", - "cs": "Hotel {name}", - "pl": "Hotel {name}" - } - } - ] - }, - "pointRendering": [ - { - "location": [ - "point", - "centroid" - ], - "iconSize": "40,40", - "anchor": "center", - "marker": [ - { - "icon": "circle", - "color": "white" - }, - { - "icon": "./assets/layers/hotel/hotel.svg" - } - ] - } - ], - "lineRendering": [], - "presets": [ - { - "title": { - "en": "a hotel", - "nl": "een hotel", - "de": "ein Hotel", - "ca": "un hotel", - "ru": "гостиница", - "fr": "un hôtel", - "cs": "hotel", - "pl": "hotel" - }, - "tags": [ - "tourism=hotel" - ] - } - ], - "tagRenderings": [ - "images", - "reviews", - { - "id": "name", - "freeform": { - "key": "name", - "placeholder": { - "en": "Name of the hotel", - "nl": "Naam van het hotel", - "de": "Name des Hotels", - "ru": "Название гостиницы", - "fr": "Nom de l'hôtel", - "ca": "Nom de l'hotel", - "cs": "Název hotelu", - "pl": "Nazwa hotelu" - } - }, - "question": { - "en": "What is the name of this hotel?", - "nl": "Wat is de naam van dit hotel?", - "de": "Wie lautet der Name des Hotels?", - "ru": "Как называется эта гостиница?", - "fr": "Quel est le nom de cet hôtel ?", - "ca": "Quin és el nom d'aquest hotel?", - "cs": "Jak se tento hotel jmenuje?", - "pl": "Jak nazywa się ten hotel?" - }, - "render": { - "en": "This hotel is called {name}", - "nl": "Dit hotel heet {name}", - "de": "Der Name des Hotels lautet {name}", - "ca": "Aquest hotel es diu {name}", - "fr": "Cet hôtel s'appelle {name}", - "cs": "Tento hotel se jmenuje {name}", - "pl": "Nazwa tego hotelu to {name}" - } - }, - { - "builtin": "brand", - "override": { - "question": { - "en": "Is this hotel part of a bigger brand?" - } - } - }, - "contact", - "wheelchair-access", - "internet-all", - "dog-access" - ], - "allowMove": { - "enableImproveAccuracy": true, - "enableRelocation": true - } -} diff --git a/assets/layers/hotel/hotel.svg b/assets/layers/hotel/hotel.svg deleted file mode 100644 index efd17fb6b..000000000 --- a/assets/layers/hotel/hotel.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - diff --git a/assets/layers/hotel/hotel.svg.license b/assets/layers/hotel/hotel.svg.license deleted file mode 100644 index 01764961f..000000000 --- a/assets/layers/hotel/hotel.svg.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: Andy Allan; Michael Glanznig; Adamant36; Paul Dicker -SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/layers/hotel/license_info.json b/assets/layers/hotel/license_info.json deleted file mode 100644 index 322495cd9..000000000 --- a/assets/layers/hotel/license_info.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "path": "hotel.svg", - "license": "CC0-1.0", - "authors": [ - "Andy Allan", - "Michael Glanznig", - "Adamant36", - "Paul Dicker" - ], - "sources": [ - "https://github.com/gravitystorm/openstreetmap-carto/blob/master/symbols/tourism/hotel.svg" - ] - } -] \ No newline at end of file diff --git a/assets/layers/love_hotel/love_hotel.json b/assets/layers/love_hotel/love_hotel.json index 884506c6d..83bd39286 100644 --- a/assets/layers/love_hotel/love_hotel.json +++ b/assets/layers/love_hotel/love_hotel.json @@ -42,7 +42,7 @@ ], "marker": [ { - "icon": "./assets/layers/hotel/hotel.svg" + "icon": "./assets/layers/tourism_accomodation/hotel.svg" } ], "iconSize": "27,27" diff --git a/assets/layers/questions/questions.json b/assets/layers/questions/questions.json index a93570559..d16d782a7 100644 --- a/assets/layers/questions/questions.json +++ b/assets/layers/questions/questions.json @@ -2906,14 +2906,16 @@ { "id": "brand", "question": { - "en": "Is this part of a bigger brand?" + "en": "Is {title()} part of a bigger brand?" }, "render": { "en": "Part of {brand}" }, "freeform": { "key": "brand", - "addExtraTags": ["nobrand="] + "addExtraTags": [ + "nobrand=" + ] }, "mappings": [ { diff --git a/assets/layers/tourism_accomodation/tourism_accomodation.json b/assets/layers/tourism_accomodation/tourism_accomodation.json new file mode 100644 index 000000000..0cb6f4f7a --- /dev/null +++ b/assets/layers/tourism_accomodation/tourism_accomodation.json @@ -0,0 +1,130 @@ +{ + "minzoom": 12, + "pointRendering": [ + { + "location": [ + "point", + "centroid" + ], + "marker": [ + { + "icon": "circle", + "color": "white" + }, + { + "icon": { + "mappings": [ + { + "if": "tourism=hostel", + "then": "./assets/layers/tourism_accomodation/hostel.svg" + }, + { + "if": "tourism=hotel", + "then": "./assets/layers/tourism_accomodation/hotel.svg" + } + ], + "render": "./assets/layers/tourism_accomodation/hostel.svg" + } + } + ] + } + ], + "tagRenderings": [ + "images", + "reviews", + { + "id": "name", + "question": { + "en": "What is the name of this {title()}?" + }, + "render": { + "en": "{name}" + }, + "freeform": { + "key": "name" + } + }, + "{preset_type_select()}", + "brand", + "contact", + "wheelchair-access", + "internet-all", + "dog-access" + ], + "lineRendering": [ + { + "width": 1, + "color": "blue" + } + ], + "name": { + "en": "Tourism accomodation" + }, + "id": "tourism_accomodation", + "description": {}, + "presets": [ + { + "title": { + "en": "a hotel", + "nl": "een hotel", + "de": "ein Hotel", + "ca": "un hotel", + "ru": "гостиница", + "fr": "un hôtel", + "cs": "hotel", + "pl": "hotel" + }, + "description": { + "en": "A hotel is an establishment that provides paid lodging, usually on a short-term basis. Rooms are not shared with strangers." + }, + "tags": [ + "tourism=hotel" + ] + }, + { + "tags": [ + "tourism=hostel" + ], + "title": { + "en": "a hostel" + }, + "description": { + "en": "A hostel is a type of tourist accommodation where people can sleep in a room shared with strangers" + } + } + ], + "source": { + "osmTags": { + "or": [ + "tourism=hostel", + "tourism=hotel" + ] + } + }, + "title": { + "mappings": [ + { + "if": "tourism=hotel", + "then": { + "en": "Hotel {name}", + "nl": "Hotel {name}", + "de": "Hotel {name}", + "fr": "Hôtel {name}", + "ca": "Hotel {name}", + "cs": "Hotel {name}", + "pl": "Hotel {name}" + } + }, + { + "if": "tourism=hostel", + "then": { + "en": "Hostel {name}" + } + } + ], + "render": { + "en": "Tourist accomodation {name}" + } + }, + "allowMove": true +} diff --git a/assets/layers/usersettings/usersettings.json b/assets/layers/usersettings/usersettings.json index 855de0b76..c9f98f991 100644 --- a/assets/layers/usersettings/usersettings.json +++ b/assets/layers/usersettings/usersettings.json @@ -45,7 +45,9 @@ }, { "id": "profile-title", - "labels": ["hidden"], + "labels": [ + "hidden" + ], "icon": "user_circle", "render": { "*": "

{_name}

" @@ -63,7 +65,8 @@ { "id": "profile-description", "labels": [ - "profile-content","hidden" + "profile-content", + "hidden" ], "render": { "*": "{_description_html}" @@ -71,7 +74,6 @@ "mappings": [ { "if": "_description=", - "then": { "special": { "type": "link", @@ -98,7 +100,8 @@ { "id": "edit-profile", "labels": [ - "profile-content","hidden" + "profile-content", + "hidden" ], "condition": "_description!=", "render": { @@ -126,7 +129,8 @@ { "id": "verified-mastodon", "labels": [ - "profile-content","hidden" + "profile-content", + "hidden" ], "mappings": [ { @@ -157,7 +161,8 @@ { "id": "cscount-thanks", "labels": [ - "profile-content","hidden" + "profile-content", + "hidden" ], "mappings": [ { @@ -180,7 +185,8 @@ { "id": "translation-thanks", "labels": [ - "profile-content","hidden" + "profile-content", + "hidden" ], "mappings": [ { @@ -197,7 +203,8 @@ { "id": "contributor-thanks", "labels": [ - "profile-content","hidden" + "profile-content", + "hidden" ], "mappings": [ { diff --git a/assets/themes/hotels/hotels.json b/assets/themes/hotels/hotels.json index 70d033f40..5f883cb1a 100644 --- a/assets/themes/hotels/hotels.json +++ b/assets/themes/hotels/hotels.json @@ -29,13 +29,12 @@ "pl": "Na tej mapie znajdziesz hotele w Twojej okolicy", "it": "Su questa mappa, troverai gli hotel della tua zona" }, - "icon": "./assets/layers/hotel/hotel.svg", + "icon": "./assets/layers/tourism_accomodation/hotel.svg", "startZoom": 13, "startLat": 50.8552, "startLon": 4.3755, "layers": [ - "hotel", - "hostel", + "tourism_accomodation", { "builtin": [ "love_hotel" diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index fbcd5c35c..e2d5bf078 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -291,7 +291,7 @@ }, { "if": "theme=hotels", - "then": "./assets/layers/hotel/hotel.svg" + "then": "./assets/layers/tourism_accomodation/hotel.svg" }, { "if": "theme=icecream", @@ -317,10 +317,6 @@ "if": "theme=lighthouses", "then": "./assets/themes/lighthouses/lighthouse.svg" }, - { - "if": "theme=mapcomplete-changes", - "then": "./assets/svg/logo.svg" - }, { "if": "theme=maproulette", "then": "./assets/layers/maproulette/logomark.svg" diff --git a/assets/themes/onwheels/onwheels.json b/assets/themes/onwheels/onwheels.json index 3fe4c6c40..6cdf2f514 100644 --- a/assets/themes/onwheels/onwheels.json +++ b/assets/themes/onwheels/onwheels.json @@ -422,7 +422,7 @@ } }, { - "builtin": "hotel", + "builtin": "tourism_accomodation", "override": { "minzoom": 15, "shownByDefault": false, @@ -505,7 +505,7 @@ "geoJson": "https://maproulette.org/api/v2/challenge/view/28012" }, "calculatedTags": [ - "_closest_osm_hotel=closest(feat)('hotel')?.properties?.id", + "_closest_osm_hotel=closest(feat)('tourism_accomodation')?.properties?.id", "_closest_osm_hotel_distance=distanceTo(feat)(feat.properties._closest_osm_hotel)", "_has_closeby_feature=Number(feat.properties._closest_osm_hotel_distance) < 50 ? 'yes' : 'no'" ], @@ -516,7 +516,7 @@ "render": { "special": { "type": "import_button", - "targetLayer": "hotel", + "targetLayer": "tourism_accomodation", "tags": "tags", "text": { "en": "Import", @@ -593,4 +593,4 @@ }, "enableDownload": true, "widenFactor": 2 -} \ No newline at end of file +} diff --git a/assets/themes/openlovemap/openlovemap.json b/assets/themes/openlovemap/openlovemap.json index f4e9c8d01..fd3ee0a40 100644 --- a/assets/themes/openlovemap/openlovemap.json +++ b/assets/themes/openlovemap/openlovemap.json @@ -261,7 +261,7 @@ }, "love_hotel", { - "builtin": "hotel", + "builtin": "tourism_accomodation", "override": { "minzoom": 17, "+tagRenderings": [ diff --git a/langs/en.json b/langs/en.json index e68ab5de7..ff60ed212 100644 --- a/langs/en.json +++ b/langs/en.json @@ -699,6 +699,11 @@ "takeImages": "Take images of the tree to automatically detect the tree type", "tryAgain": "Select a different species" }, + "preset_type": { + "question": "Of what type is this object?", + "typeDescription": "This is a {title}. {description}", + "typeTitle": "This is a {title}" + }, "privacy": { "editingIntro": "When you make a change to the map, this change is recorded on OpenStreetMap and is publicly available to anyone. A changeset made with MapComplete includes the following data:", "editingOutro": "Please refer to the privacy policy on OpenStreetMap.org for detailed information. We'd like to remind you that you can use a fictional name when signing up.", diff --git a/langs/layers/ca.json b/langs/layers/ca.json index cf4593967..e8d86ed3b 100644 --- a/langs/layers/ca.json +++ b/langs/layers/ca.json @@ -4162,32 +4162,6 @@ "render": "Hospital" } }, - "hotel": { - "description": "Capa que mostra tots els hotels", - "name": "Hotels", - "presets": { - "0": { - "title": "un hotel" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Nom de l'hotel" - }, - "question": "Quin és el nom d'aquest hotel?", - "render": "Aquest hotel es diu {name}" - } - }, - "title": { - "mappings": { - "0": { - "then": "Hotel {name}" - } - }, - "render": "Hotel" - } - }, "hydrant": { "description": "Una capa que mostra hidrants.", "name": "Mapa d'hidrants", @@ -7972,6 +7946,20 @@ "render": "Lavabo a la instal·lació" } }, + "tourism_accomodation": { + "presets": { + "0": { + "title": "un hotel" + } + }, + "title": { + "mappings": { + "0": { + "then": "Hotel {name}" + } + } + } + }, "trail": { "description": "Rutes marcades", "name": "Camins", @@ -8468,6 +8456,13 @@ } } }, + "edit-profile": { + "render": { + "special": { + "text": "Editeu la descripció del vostre perfil" + } + } + }, "fixate-north": { "mappings": { "0": { @@ -8529,6 +8524,17 @@ }, "question": "Sota quina llicència vols publicar les teves fotos?" }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Afegeix una descripció del perfil" + } + } + } + } + }, "settings-link": { "render": { "special": { diff --git a/langs/layers/cs.json b/langs/layers/cs.json index 632be827e..83514c9b7 100644 --- a/langs/layers/cs.json +++ b/langs/layers/cs.json @@ -4301,32 +4301,6 @@ "render": "Nemocnice" } }, - "hotel": { - "description": "Vrstva zobrazující všechny hotely", - "name": "Hotely", - "presets": { - "0": { - "title": "hotel" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Název hotelu" - }, - "question": "Jak se tento hotel jmenuje?", - "render": "Tento hotel se jmenuje {name}" - } - }, - "title": { - "mappings": { - "0": { - "then": "Hotel {name}" - } - }, - "render": "Hotel" - } - }, "hydrant": { "description": "Mapová vrstva zobrazující požární hydranty.", "name": "Mapa hydrantů", @@ -8272,6 +8246,20 @@ "render": "Toaleta v objektu" } }, + "tourism_accomodation": { + "presets": { + "0": { + "title": "hotel" + } + }, + "title": { + "mappings": { + "0": { + "then": "Hotel {name}" + } + } + } + }, "trail": { "name": "Stezky", "tagRenderings": { @@ -8723,6 +8711,13 @@ } } }, + "edit-profile": { + "render": { + "special": { + "text": "Úprava popisu vašeho profilu" + } + } + }, "fixate-north": { "mappings": { "0": { @@ -8784,6 +8779,17 @@ }, "question": "Pod jakou licencí chcete své fotografie zveřejnit?" }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Přidat popis profilu" + } + } + } + } + }, "settings-link": { "render": { "special": { diff --git a/langs/layers/da.json b/langs/layers/da.json index 3ff20dea0..9d7541137 100644 --- a/langs/layers/da.json +++ b/langs/layers/da.json @@ -2485,6 +2485,13 @@ } } }, + "edit-profile": { + "render": { + "special": { + "text": "Ret din profilbeskrivelse" + } + } + }, "fixate-north": { "mappings": { "0": { diff --git a/langs/layers/de.json b/langs/layers/de.json index 595f678a4..a5cbc433e 100644 --- a/langs/layers/de.json +++ b/langs/layers/de.json @@ -5497,32 +5497,6 @@ "render": "Krankenhaus" } }, - "hotel": { - "description": "Eine Ebene mit Hotels", - "name": "Hotels", - "presets": { - "0": { - "title": "ein Hotel" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Name des Hotels" - }, - "question": "Wie lautet der Name des Hotels?", - "render": "Der Name des Hotels lautet {name}" - } - }, - "title": { - "mappings": { - "0": { - "then": "Hotel {name}" - } - }, - "render": "Hotel" - } - }, "hydrant": { "description": "Kartenebene zur Anzeige von Hydranten.", "name": "Hydranten", @@ -10492,6 +10466,20 @@ "render": "Werkzeugbibliothek {name}" } }, + "tourism_accomodation": { + "presets": { + "0": { + "title": "ein Hotel" + } + }, + "title": { + "mappings": { + "0": { + "then": "Hotel {name}" + } + } + } + }, "trail": { "description": "Markierte Wanderwege", "name": "Wanderwege", @@ -11119,6 +11107,13 @@ } } }, + "edit-profile": { + "render": { + "special": { + "text": "Eigene Profilbeschreibung bearbeiten" + } + } + }, "fixate-north": { "mappings": { "0": { @@ -11207,6 +11202,17 @@ }, "question": "Unter welcher Lizenz möchten Sie Ihre Bilder veröffentlichen?" }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Profilbeschreibung hinzufügen" + } + } + } + } + }, "settings-link": { "render": { "special": { diff --git a/langs/layers/en.json b/langs/layers/en.json index 72f4da118..c68fd5d59 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -5534,32 +5534,6 @@ "render": "Hospital" } }, - "hotel": { - "description": "Layer showing all hotels", - "name": "Hotels", - "presets": { - "0": { - "title": "a hotel" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Name of the hotel" - }, - "question": "What is the name of this hotel?", - "render": "This hotel is called {name}" - } - }, - "title": { - "mappings": { - "0": { - "then": "Hotel {name}" - } - }, - "render": "Hotel" - } - }, "hydrant": { "description": "Map layer to show fire hydrants.", "name": "Map of hydrants", @@ -7788,6 +7762,15 @@ }, "questions": { "tagRenderings": { + "brand": { + "mappings": { + "0": { + "then": "Not part of a bigger brand" + } + }, + "question": "Is {title()} part of a bigger brand?", + "render": "Part of {brand}" + }, "check_date": { "mappings": { "0": { @@ -10532,6 +10515,35 @@ "render": "Tool library {name}" } }, + "tourism_accomodation": { + "name": "Tourism accomodation", + "presets": { + "0": { + "title": "a hotel" + }, + "1": { + "description": "A hostel is a type of tourist accommodation where people can sleep in a room shared with strangers", + "title": "a hostel" + } + }, + "tagRenderings": { + "name": { + "question": "What is the name of this {title()}?", + "render": "{name}" + } + }, + "title": { + "mappings": { + "0": { + "then": "Hotel {name}" + }, + "1": { + "then": "Hostel {name}" + } + }, + "render": "Tourist accomodation {name}" + } + }, "trail": { "description": "Waymarked trails", "name": "Trails", @@ -11170,6 +11182,13 @@ "debug-title": { "render": "

Debugging options

" }, + "edit-profile": { + "render": { + "special": { + "text": "Edit your profile description" + } + } + }, "fixate-north": { "mappings": { "0": { @@ -11258,6 +11277,17 @@ }, "question": "Under what license do you want to publish your pictures?" }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Add a profile description" + } + } + } + } + }, "settings-link": { "render": { "special": { diff --git a/langs/layers/fi.json b/langs/layers/fi.json index 6ad318e18..2bb7ab510 100644 --- a/langs/layers/fi.json +++ b/langs/layers/fi.json @@ -122,6 +122,26 @@ } }, "usersettings": { + "tagRenderings": { + "edit-profile": { + "render": { + "special": { + "text": "Muokkaa profiilin kuvausta" + } + } + }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Lisää profiilin kuvaus" + } + } + } + } + } + }, "title": { "render": "Asetukset" } diff --git a/langs/layers/fr.json b/langs/layers/fr.json index 88af4f47e..2e39125f4 100644 --- a/langs/layers/fr.json +++ b/langs/layers/fr.json @@ -3676,32 +3676,6 @@ } } }, - "hotel": { - "description": "Couche affichant les hôtels", - "name": "Hôtels", - "presets": { - "0": { - "title": "un hôtel" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Nom de l'hôtel" - }, - "question": "Quel est le nom de cet hôtel ?", - "render": "Cet hôtel s'appelle {name}" - } - }, - "title": { - "mappings": { - "0": { - "then": "Hôtel {name}" - } - }, - "render": "Hôtel" - } - }, "hydrant": { "description": "Couche des bornes incendie.", "name": "Carte des bornes incendie", @@ -6524,6 +6498,20 @@ } } }, + "tourism_accomodation": { + "presets": { + "0": { + "title": "un hôtel" + } + }, + "title": { + "mappings": { + "0": { + "then": "Hôtel {name}" + } + } + } + }, "trail": { "name": "Sentiers", "tagRenderings": { @@ -6925,6 +6913,13 @@ } } }, + "edit-profile": { + "render": { + "special": { + "text": "Modifier ton profil" + } + } + }, "fixate-north": { "mappings": { "0": { diff --git a/langs/layers/nb_NO.json b/langs/layers/nb_NO.json index 31e212e2c..83c930c1f 100644 --- a/langs/layers/nb_NO.json +++ b/langs/layers/nb_NO.json @@ -842,6 +842,17 @@ }, "usersettings": { "tagRenderings": { + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Legg til profilbeskrivelse" + } + } + } + } + }, "translation-completeness": { "render": "Oversettelsen for {_theme} i {_language} har {_translation_percentage}% dekning: {_translation_translated_count} strenger av {_translation_total} har blitt oversatt" } diff --git a/langs/layers/nl.json b/langs/layers/nl.json index a34b5fc90..be86bcb90 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -4542,32 +4542,6 @@ "render": "Ziekenhuis" } }, - "hotel": { - "description": "Laag die alle hotels toont", - "name": "Hotels", - "presets": { - "0": { - "title": "een hotel" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Naam van het hotel" - }, - "question": "Wat is de naam van dit hotel?", - "render": "Dit hotel heet {name}" - } - }, - "title": { - "mappings": { - "0": { - "then": "Hotel {name}" - } - }, - "render": "Hotel" - } - }, "hydrant": { "description": "Kaartlaag met brandkranen.", "name": "Kaart van brandkranen", @@ -8367,6 +8341,20 @@ "render": "Toilet in een voorziening" } }, + "tourism_accomodation": { + "presets": { + "0": { + "title": "een hotel" + } + }, + "title": { + "mappings": { + "0": { + "then": "Hotel {name}" + } + } + } + }, "trail": { "description": "Aangeduide wandeltochten", "name": "Wandeltochten", @@ -8871,6 +8859,13 @@ } } }, + "edit-profile": { + "render": { + "special": { + "text": "Pas je profielbeschrijving aan" + } + } + }, "fixate-north": { "mappings": { "0": { @@ -8959,6 +8954,17 @@ }, "question": "Met welke licentie wil je je afbeeldingen toevoegen?" }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Voeg een profielbeschrijving toe" + } + } + } + } + }, "settings-link": { "render": { "special": { diff --git a/langs/layers/pa_PK.json b/langs/layers/pa_PK.json index 306d966c5..a0d8a8ed8 100644 --- a/langs/layers/pa_PK.json +++ b/langs/layers/pa_PK.json @@ -135,12 +135,6 @@ "render": "ہسپتال" } }, - "hotel": { - "name": "ہوٹل", - "title": { - "render": "ہوٹل" - } - }, "hydrant": { "title": { "render": "ہائڈرنٹ" diff --git a/langs/layers/pl.json b/langs/layers/pl.json index db175d09a..1281fd6e3 100644 --- a/langs/layers/pl.json +++ b/langs/layers/pl.json @@ -1875,32 +1875,6 @@ "render": "Szpital" } }, - "hotel": { - "description": "Warstwa pokazująca wszystkie hotele", - "name": "Hotele", - "presets": { - "0": { - "title": "hotel" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Nazwa hotelu" - }, - "question": "Jak nazywa się ten hotel?", - "render": "Nazwa tego hotelu to {name}" - } - }, - "title": { - "mappings": { - "0": { - "then": "Hotel {name}" - } - }, - "render": "Hotel" - } - }, "hydrant": { "description": "Warstwa mapy pokazująca hydranty.", "name": "Mapa hydrantów", @@ -3304,6 +3278,20 @@ } } }, + "tourism_accomodation": { + "presets": { + "0": { + "title": "hotel" + } + }, + "title": { + "mappings": { + "0": { + "then": "Hotel {name}" + } + } + } + }, "trolley_bay": { "tagRenderings": { "denominations": { @@ -3338,6 +3326,28 @@ } } }, + "usersettings": { + "tagRenderings": { + "edit-profile": { + "render": { + "special": { + "text": "Edytuj opis swojego profilu" + } + } + }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Dodaj opis profilu" + } + } + } + } + } + } + }, "walls_and_buildings": { "description": "Specjalna warstwa zabudowana zapewniająca wszystkie mury i budynki. Warstwa ta jest przydatna w ustawieniach wstępnych obiektów, które można umieścić przy ścianach (np. AED, skrzynki pocztowe, wejścia, adresy, kamery monitorujące itp.). Warstwa ta jest domyślnie niewidoczna i użytkownik nie może jej przełączać." }, diff --git a/langs/layers/pt.json b/langs/layers/pt.json index 5633ea9b8..604a9488b 100644 --- a/langs/layers/pt.json +++ b/langs/layers/pt.json @@ -1768,6 +1768,13 @@ } } }, + "edit-profile": { + "render": { + "special": { + "text": "Editar a descrição do seu perfil" + } + } + }, "picture-license": { "mappings": { "0": { @@ -1785,6 +1792,17 @@ }, "question": "Sob que licença você deseja publicar suas fotos?" }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "Adicionar uma descrição do perfil" + } + } + } + } + }, "show_debug": { "mappings": { "0": { diff --git a/langs/layers/ru.json b/langs/layers/ru.json index 4a8e1e097..db3f0aeda 100644 --- a/langs/layers/ru.json +++ b/langs/layers/ru.json @@ -906,22 +906,6 @@ "render": "Больница" } }, - "hotel": { - "name": "Гостиницы", - "presets": { - "0": { - "title": "гостиница" - } - }, - "tagRenderings": { - "name": { - "freeform": { - "placeholder": "Название гостиницы" - }, - "question": "Как называется эта гостиница?" - } - } - }, "hydrant": { "description": "Слой карты, отображающий пожарные гидранты.", "name": "Карта пожарных гидрантов", @@ -1790,6 +1774,13 @@ } } }, + "tourism_accomodation": { + "presets": { + "0": { + "title": "гостиница" + } + } + }, "trail": { "name": "Тропы", "title": { diff --git a/langs/layers/zh_Hant.json b/langs/layers/zh_Hant.json index 615b0e8fd..370066886 100644 --- a/langs/layers/zh_Hant.json +++ b/langs/layers/zh_Hant.json @@ -782,6 +782,24 @@ }, "usersettings": { "tagRenderings": { + "edit-profile": { + "render": { + "special": { + "text": "編輯你的個人檔敘述" + } + } + }, + "profile-description": { + "mappings": { + "0": { + "then": { + "special": { + "text": "新增個人檔敘述" + } + } + } + } + }, "translation-completeness": { "render": "{_theme} 的 {_language} 翻譯目前是 {_translation_percentage}%:{_translation_total} 中的 {_translation_translated_count} 已經翻譯了" }, diff --git a/src/Customizations/AllKnownLayouts.ts b/src/Customizations/AllKnownLayouts.ts index 6d3ada24b..04b6ff72e 100644 --- a/src/Customizations/AllKnownLayouts.ts +++ b/src/Customizations/AllKnownLayouts.ts @@ -36,6 +36,10 @@ export class AllKnownLayoutsLazy { return this.raw.get(key) } + public size(){ + return this.raw.size + } + public get(key: string): LayoutConfig { const cached = this.dict.get(key) if (cached !== undefined) { diff --git a/src/Logic/DetermineLayout.ts b/src/Logic/DetermineLayout.ts index 86beedfe0..09bc96cba 100644 --- a/src/Logic/DetermineLayout.ts +++ b/src/Logic/DetermineLayout.ts @@ -108,6 +108,9 @@ export default class DetermineLayout { ).data const id = layoutId?.toLowerCase() const layouts = AllKnownLayouts.allKnownLayouts + if(layouts.size() == 0){ + throw "Build failed or running, no layouts are known at all" + } if (layouts.getConfig(id) === undefined) { const alternatives = Utils.sortedByLevenshteinDistance(id, Array.from(layouts.keys()), i => i).slice(0, 3) const msg = (`No builtin map theme with name ${layoutId} exists. Perhaps you meant one of ${alternatives.join(", ")}`) diff --git a/src/UI/SpecialVisualizations.ts b/src/UI/SpecialVisualizations.ts index e81aa5aaa..26646c435 100644 --- a/src/UI/SpecialVisualizations.ts +++ b/src/UI/SpecialVisualizations.ts @@ -23,7 +23,7 @@ import { ImageCarousel } from "./Image/ImageCarousel" import { VariableUiElement } from "./Base/VariableUIElement" import { Utils } from "../Utils" import Wikidata, { WikidataResponse } from "../Logic/Web/Wikidata" -import { Translation } from "./i18n/Translation" +import { Translation, TypedTranslation } from "./i18n/Translation" import Translations from "./i18n/Translations" import OpeningHoursVisualization from "./OpeningHours/OpeningHoursVisualization" import { SubtleButton } from "./Base/SubtleButton" @@ -102,6 +102,7 @@ import PendingChangesIndicator from "./BigComponents/PendingChangesIndicator.sve import QrCode from "./Popup/QrCode.svelte" import ClearCaches from "./Popup/ClearCaches.svelte" import GroupedView from "./Popup/GroupedView.svelte" +import { QuestionableTagRenderingConfigJson } from "../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson" class NearbyImageVis implements SpecialVisualization { // Class must be in SpecialVisualisations due to weird cyclical import that breaks the tests @@ -127,7 +128,7 @@ class NearbyImageVis implements SpecialVisualization { tags: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): SvelteUIElement { const isOpen = args[0] === "open" const readonly = args[1] === "readonly" @@ -194,7 +195,7 @@ class StealViz implements SpecialVisualization { selectedElement: otherFeature, state, layer, - }) + }), ) } if (elements.length === 1) { @@ -202,8 +203,8 @@ class StealViz implements SpecialVisualization { } return new Combine(elements).SetClass("flex flex-col") }, - [state.indexedFeatures.featuresById] - ) + [state.indexedFeatures.featuresById], + ), ) } @@ -260,7 +261,7 @@ class CloseNoteViz implements SpecialVisualization { idkey, comment, minZoom, - zoomButton + zoomButton, } = Utils.ParseVisArgs(this.args, args) @@ -272,7 +273,7 @@ class CloseNoteViz implements SpecialVisualization { message: comment, text: Translations.T(text), minzoom: minZoom, - zoomMoreMessage: zoomButton + zoomMoreMessage: zoomButton, }) } } @@ -302,7 +303,7 @@ export class QuestionViz implements SpecialVisualization { tags: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): SvelteUIElement { const labels = args[0] ?.split(";") @@ -341,15 +342,15 @@ export default class SpecialVisualizations { viz.docs, viz.args.length > 0 ? MarkdownUtils.table( - ["name", "default", "description"], - viz.args.map((arg) => { - let defaultArg = arg.defaultValue ?? "_undefined_" - if (defaultArg == "") { - defaultArg = "_empty string_" - } - return [arg.name, defaultArg, arg.doc] - }) - ) + ["name", "default", "description"], + viz.args.map((arg) => { + let defaultArg = arg.defaultValue ?? "_undefined_" + if (defaultArg == "") { + defaultArg = "_empty string_" + } + return [arg.name, defaultArg, arg.doc] + }), + ) : undefined, "#### Example usage of " + viz.funcName, "" + example + "", @@ -358,14 +359,14 @@ export default class SpecialVisualizations { public static constructSpecification( template: string, - extraMappings: SpecialVisualization[] = [] + extraMappings: SpecialVisualization[] = [], ): RenderingSpecification[] { return SpecialVisualisationUtils.constructSpecification(template, extraMappings) } public static HelpMessage(): string { const helpTexts: string[] = SpecialVisualizations.specialVisualizations.map((viz) => - SpecialVisualizations.DocumentationFor(viz) + SpecialVisualizations.DocumentationFor(viz), ) const firstPart = new Combine([ @@ -398,10 +399,10 @@ export default class SpecialVisualizations { }, }, null, - " " - ) + " ", + ), ).SetClass("code"), - 'In other words: use `{ "before": ..., "after": ..., "special": {"type": ..., "argname": ...argvalue...}`. The args are in the `special` block; an argvalue can be a string, a translation or another value. (Refer to class `RewriteSpecial` in case of problems)', + "In other words: use `{ \"before\": ..., \"after\": ..., \"special\": {\"type\": ..., \"argname\": ...argvalue...}`. The args are in the `special` block; an argvalue can be a string, a translation or another value. (Refer to class `RewriteSpecial` in case of problems)", ]) .SetClass("flex flex-col") .AsMarkdown() @@ -439,10 +440,10 @@ export default class SpecialVisualizations { assignTo: state.userRelatedState.language, availableLanguages: languages, preferredLanguages: state.osmConnection.userDetails.map( - (ud) => ud.languages + (ud) => ud.languages, ), }) - }) + }), ) }, }, @@ -481,7 +482,7 @@ export default class SpecialVisualizations { state: SpecialVisualizationState, tagSource: UIEventSource>, args: string[], - feature: Feature + feature: Feature, ): SvelteUIElement { return new SvelteUIElement(MinimapViz, { state, args, feature, tagSource }) }, @@ -493,7 +494,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, - tagSource: UIEventSource> + tagSource: UIEventSource>, ): BaseUIElement { return new VariableUiElement( tagSource @@ -503,7 +504,7 @@ export default class SpecialVisualizations { return new SvelteUIElement(SplitRoadWizard, { id, state }) } return undefined - }) + }), ) }, }, @@ -517,7 +518,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { if (feature.geometry.type !== "Point") { return undefined @@ -540,7 +541,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { if (!layer.deletion) { return undefined @@ -568,7 +569,7 @@ export default class SpecialVisualizations { state: SpecialVisualizationState, tagSource: UIEventSource>, argument: string[], - feature: Feature + feature: Feature, ): BaseUIElement { const [lon, lat] = GeoOperations.centerpointCoordinates(feature) return new SvelteUIElement(CreateNewNote, { @@ -631,7 +632,7 @@ export default class SpecialVisualizations { .map((tags) => tags[args[0]]) .map((wikidata) => { wikidata = Utils.NoEmpty( - wikidata?.split(";")?.map((wd) => wd.trim()) ?? [] + wikidata?.split(";")?.map((wd) => wd.trim()) ?? [], )[0] const entry = Wikidata.LoadWikidataEntry(wikidata) return new VariableUiElement( @@ -641,9 +642,9 @@ export default class SpecialVisualizations { } const response = e["success"] return Translation.fromMap(response.labels) - }) + }), ) - }) + }), ), }, new MapillaryLinkVis(), @@ -657,7 +658,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, _, __, - layer: LayerConfig + layer: LayerConfig, ) => new SvelteUIElement(AllTagsPanel, { tags, layer }), }, { @@ -679,7 +680,7 @@ export default class SpecialVisualizations { return new ImageCarousel( AllImageProviders.LoadImagesFor(tags, imagePrefixes), tags, - state + state, ) }, }, @@ -736,7 +737,7 @@ export default class SpecialVisualizations { nameKey: nameKey, fallbackName, }, - state.featureSwitchIsTesting + state.featureSwitchIsTesting, ) return new SvelteUIElement(StarsBarIcon, { score: reviews.average, @@ -770,7 +771,7 @@ export default class SpecialVisualizations { nameKey: nameKey, fallbackName, }, - state.featureSwitchIsTesting + state.featureSwitchIsTesting, ) return new SvelteUIElement(ReviewForm, { reviews, state, tags, feature, layer }) }, @@ -803,7 +804,7 @@ export default class SpecialVisualizations { nameKey: nameKey, fallbackName, }, - state.featureSwitchIsTesting + state.featureSwitchIsTesting, ) return new SvelteUIElement(AllReviews, { reviews, state, tags, feature, layer }) }, @@ -821,7 +822,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, _: UIEventSource>, - argument: string[] + argument: string[], ): BaseUIElement { const [text] = argument return new SvelteUIElement(ImportReviewIdentity, { state, text }) @@ -878,7 +879,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, tags: UIEventSource>, - args: string[] + args: string[], ): SvelteUIElement { const keyToUse = args[0] const prefix = args[1] @@ -915,17 +916,17 @@ export default class SpecialVisualizations { return undefined } const allUnits: Unit[] = [].concat( - ...(state?.layout?.layers?.map((lyr) => lyr.units) ?? []) + ...(state?.layout?.layers?.map((lyr) => lyr.units) ?? []), ) const unit = allUnits.filter((unit) => - unit.isApplicableToKey(key) + unit.isApplicableToKey(key), )[0] if (unit === undefined) { return value } const getCountry = () => tagSource.data._country return unit.asHumanLongValue(value, getCountry) - }) + }), ) }, }, @@ -942,7 +943,7 @@ export default class SpecialVisualizations { new Combine([ t.downloadFeatureAsGeojson.SetClass("font-bold text-lg"), t.downloadGeoJsonHelper.SetClass("subtle"), - ]).SetClass("flex flex-col") + ]).SetClass("flex flex-col"), ) .onClick(() => { console.log("Exporting as Geojson") @@ -955,7 +956,7 @@ export default class SpecialVisualizations { title + "_mapcomplete_export.geojson", { mimetype: "application/vnd.geo+json", - } + }, ) }) .SetClass("w-full") @@ -991,7 +992,7 @@ export default class SpecialVisualizations { constr: (state) => { return new SubtleButton( new SvelteUIElement(Trash).SetClass("h-6"), - Translations.t.general.removeLocationHistory + Translations.t.general.removeLocationHistory, ).onClick(() => { state.historicalUserLocations.features.setData([]) state.selectedElement.setData(undefined) @@ -1029,10 +1030,10 @@ export default class SpecialVisualizations { .filter((c) => c.text !== "") .map( (c, i) => - new NoteCommentElement(c, state, i, comments.length) - ) + new NoteCommentElement(c, state, i, comments.length), + ), ).SetClass("flex flex-col") - }) + }), ), }, { @@ -1066,7 +1067,7 @@ export default class SpecialVisualizations { tagsSource: UIEventSource>, _: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ) => new VariableUiElement( tagsSource.map((tags) => { @@ -1086,7 +1087,7 @@ export default class SpecialVisualizations { }) .SetClass("px-1") .setSpan() - }) + }), ), }, { @@ -1102,8 +1103,8 @@ export default class SpecialVisualizations { const challenge = Stores.FromPromise( Utils.downloadJsonCached( `${Maproulette.defaultEndpoint}/challenge/${parentId}`, - 24 * 60 * 60 * 1000 - ) + 24 * 60 * 60 * 1000, + ), ) return new VariableUiElement( @@ -1128,7 +1129,7 @@ export default class SpecialVisualizations { } else { return [title, new List(listItems)] } - }) + }), ) }, docs: "Fetches the metadata of MapRoulette campaign that this task is part of and shows those details (namely `title`, `description` and `instruction`).\n\nThis reads the property `mr_challengeId` to detect the parent campaign.", @@ -1142,15 +1143,15 @@ export default class SpecialVisualizations { "\n" + "```json\n" + "{\n" + - ' "id": "mark_duplicate",\n' + - ' "render": {\n' + - ' "special": {\n' + - ' "type": "maproulette_set_status",\n' + - ' "message": {\n' + - ' "en": "Mark as not found or false positive"\n' + + " \"id\": \"mark_duplicate\",\n" + + " \"render\": {\n" + + " \"special\": {\n" + + " \"type\": \"maproulette_set_status\",\n" + + " \"message\": {\n" + + " \"en\": \"Mark as not found or false positive\"\n" + " },\n" + - ' "status": "2",\n' + - ' "image": "close"\n' + + " \"status\": \"2\",\n" + + " \"image\": \"close\"\n" + " }\n" + " }\n" + "}\n" + @@ -1226,7 +1227,7 @@ export default class SpecialVisualizations { (l) => l.name !== null && l.title && - state.perLayer.get(l.id) !== undefined + state.perLayer.get(l.id) !== undefined, ) .map( (l) => { @@ -1236,8 +1237,8 @@ export default class SpecialVisualizations { const fsBboxed = new BBoxFeatureSourceForLayer(fs, bbox) return new StatisticsPanel(fsBboxed) }, - [state.mapProperties.bounds] - ) + [state.mapProperties.bounds], + ), ) }, }, @@ -1300,14 +1301,19 @@ export default class SpecialVisualizations { }, { name: "icon", +<<<<<<< HEAD doc: "If set, show this icon next to the link. You might want to combine this with `class: button`" } +======= + doc: "If set, show this icon next to the link. You might want to combine this with `class: button`", + }, +>>>>>>> 8277bd3a1 (Move hotel to 'tourism_accomodation', include hostels, fix #2070) ], constr( state: SpecialVisualizationState, tagSource: UIEventSource>, - args: string[] + args: string[], ): BaseUIElement { let [text, href, classnames, download, ariaLabel, icon] = args if (download === "") { @@ -1319,8 +1325,8 @@ export default class SpecialVisualizations { (tags) => Utils.SubstituteKeys(href, tags).replaceAll( / /g, - "%20" - ) /* Chromium based browsers eat the spaces */ + "%20", + ), /* Chromium based browsers eat the spaces */ ) return new SvelteUIElement(DynLink, { text: textStore, @@ -1329,7 +1335,7 @@ export default class SpecialVisualizations { download: tagSource.map((tags) => Utils.SubstituteKeys(download, tags)), ariaLabel: tagSource.map((tags) => Utils.SubstituteKeys(ariaLabel, tags)), newTab: new ImmutableStore(newTab), - icon: tagSource.map((tags) => Utils.SubstituteKeys(icon, tags)) + icon: tagSource.map((tags) => Utils.SubstituteKeys(icon, tags)), }).setSpan() }, }, @@ -1351,7 +1357,7 @@ export default class SpecialVisualizations { }, }, null, - " " + " ", ) + "\n```", args: [ @@ -1375,7 +1381,7 @@ export default class SpecialVisualizations { featureTags: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ) { const [key, tr, classesRaw] = args let classes = classesRaw ?? "" @@ -1393,7 +1399,7 @@ export default class SpecialVisualizations { "Could not create a special visualization for multi(", args.join(", ") + ")", "no properties found for object", - feature.properties.id + feature.properties.id, ) return undefined } @@ -1409,7 +1415,7 @@ export default class SpecialVisualizations { elements.push(subsTr) } return elements - }) + }), ) }, }, @@ -1429,7 +1435,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new VariableUiElement( tagSource.map((tags) => { @@ -1441,7 +1447,7 @@ export default class SpecialVisualizations { console.error("Cannot create a translation for", v, "due to", e) return JSON.stringify(v) } - }) + }), ) }, }, @@ -1461,7 +1467,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const key = argument[0] const validator = new FediverseValidator() @@ -1471,7 +1477,7 @@ export default class SpecialVisualizations { .map((fediAccount) => { fediAccount = validator.reformat(fediAccount) const [_, username, host] = fediAccount.match( - FediverseValidator.usernameAtServer + FediverseValidator.usernameAtServer, ) const normalLink = new SvelteUIElement(Link, { @@ -1483,10 +1489,10 @@ export default class SpecialVisualizations { const loggedInContributorMastodon = state.userRelatedState?.preferencesAsTags?.data?.[ "_mastodon_link" - ] + ] console.log( "LoggedinContributorMastodon", - loggedInContributorMastodon + loggedInContributorMastodon, ) if (!loggedInContributorMastodon) { return normalLink @@ -1502,7 +1508,7 @@ export default class SpecialVisualizations { newTab: true, }).SetClass("button"), ]) - }) + }), ) }, }, @@ -1522,7 +1528,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new FixedUiElement("{" + args[0] + "}") }, @@ -1543,7 +1549,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const key = argument[0] ?? "value" return new VariableUiElement( @@ -1561,12 +1567,12 @@ export default class SpecialVisualizations { } catch (e) { return new FixedUiElement( "Could not parse this tag: " + - JSON.stringify(value) + - " due to " + - e + JSON.stringify(value) + + " due to " + + e, ).SetClass("alert") } - }) + }), ) }, }, @@ -1587,7 +1593,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const giggityUrl = argument[0] return new SvelteUIElement(Giggity, { tags: tagSource, state, giggityUrl }) @@ -1603,12 +1609,12 @@ export default class SpecialVisualizations { _: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const tags = (( state )).geolocation.currentUserLocation.features.map( - (features) => features[0]?.properties + (features) => features[0]?.properties, ) return new Combine([ new SvelteUIElement(OrientationDebugPanel, {}), @@ -1630,7 +1636,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new SvelteUIElement(MarkAsFavourite, { tags: tagSource, @@ -1650,7 +1656,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new SvelteUIElement(MarkAsFavouriteMini, { tags: tagSource, @@ -1670,7 +1676,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new SvelteUIElement(DirectionIndicator, { state, feature }) }, @@ -1683,10 +1689,10 @@ export default class SpecialVisualizations { state: SpecialVisualizationState, tags: UIEventSource>, argument: string[], - feature: Feature + feature: Feature, ): SvelteUIElement { - return new SvelteUIElement(QrCode , {state, tags, feature} ) - } + return new SvelteUIElement(QrCode, { state, tags, feature }) + }, }, { funcName: "direction_absolute", @@ -1702,7 +1708,7 @@ export default class SpecialVisualizations { constr( state: SpecialVisualizationState, tagSource: UIEventSource>, - args: string[] + args: string[], ): BaseUIElement { const key = args[0] === "" ? "_direction:centerpoint" : args[0] return new VariableUiElement( @@ -1713,11 +1719,11 @@ export default class SpecialVisualizations { }) .mapD((value) => { const dir = GeoOperations.bearingToHuman( - GeoOperations.parseBearing(value) + GeoOperations.parseBearing(value), ) console.log("Human dir", dir) return Translations.t.general.visualFeedback.directionsAbsolute[dir] - }) + }), ) }, }, @@ -1747,7 +1753,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const url = args[0] const readonly = args[3] === "yes" @@ -1773,12 +1779,12 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, args: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { return new Toggle( undefined, new SvelteUIElement(LoginButton, { osmConnection: state.osmConnection }), - state.osmConnection.isLoggedIn + state.osmConnection.isLoggedIn, ) }, }, @@ -1816,7 +1822,7 @@ export default class SpecialVisualizations { tags: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const key = argument[0] ?? "website" const useProxy = argument[1] !== "no" @@ -1843,11 +1849,11 @@ export default class SpecialVisualizations { const features = await LinkedDataLoader.fetchVeloparkEntry( url, - loadAll + loadAll, ) const feature = features.find( - (f) => f.properties["ref:velopark"] === url + (f) => f.properties["ref:velopark"] === url, ) ?? features[0] const properties = feature.properties properties["ref:velopark"] = url @@ -1857,7 +1863,7 @@ export default class SpecialVisualizations { console.error(e) throw e } - })() + })(), ) } return Stores.FromPromiseWithErr( @@ -1866,27 +1872,27 @@ export default class SpecialVisualizations { return await LinkedDataLoader.fetchJsonLd( url, { country }, - useProxy ? "proxy" : "fetch-lod" + useProxy ? "proxy" : "fetch-lod", ) } catch (e) { console.log( "Could not get with proxy/download LOD, attempting to download directly. Error for ", url, "is", - e + e, ) return await LinkedDataLoader.fetchJsonLd( url, { country }, - "fetch-raw" + "fetch-raw", ) } - })() + })(), ) }) externalData.addCallbackAndRunD((lod) => - console.log("linked_data_from_website received the following data:", lod) + console.log("linked_data_from_website received the following data:", lod), ) return new Toggle( @@ -1901,7 +1907,7 @@ export default class SpecialVisualizations { collapsed: isClosed, }), undefined, - url.map((url) => !!url) + url.map((url) => !!url), ) }, }, @@ -1921,7 +1927,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const text = argument[0] const cssClasses = argument[1] @@ -1943,7 +1949,7 @@ export default class SpecialVisualizations { tagSource: UIEventSource>, argument: string[], feature: Feature, - layer: LayerConfig + layer: LayerConfig, ): BaseUIElement { const translation = tagSource.map((tags) => { const presets = state.layout.getMatchingLayer(tags)?.presets @@ -1977,25 +1983,51 @@ export default class SpecialVisualizations { } }, { - funcName:"pending_changes", + funcName: "preset_type_select", + docs: "An editable tag rendering which allows to change the type", + args: [], + constr(state: SpecialVisualizationState, tags: UIEventSource>, argument: string[], selectedElement: Feature, layer: LayerConfig): SvelteUIElement { + const t = Translations.t.preset_type + const question: QuestionableTagRenderingConfigJson = { + id: layer.id + "-type", + question: t.question.translations, + mappings: layer.presets.map(pr => { + return { + if: new And(pr.tags).asJson(), + then: (pr.description ? t.typeDescription : t.typeTitle).Subs({ + title: pr.title, + description: pr.description, + }).translations, + } + }), + } + const config = new TagRenderingConfig(question) + return new SvelteUIElement(TagRenderingEditable, { + config, + tags, selectedElement, state, layer, + }) + }, + }, + { + funcName: "pending_changes", docs: "A module showing the pending changes, with the option to clear the pending changes", - args:[], + args: [], constr(state: SpecialVisualizationState, tagSource: UIEventSource>, argument: string[], feature: Feature, layer: LayerConfig): BaseUIElement { - return new SvelteUIElement(PendingChangesIndicator, {state, compact: false}) - } + return new SvelteUIElement(PendingChangesIndicator, { state, compact: false }) + }, }, { funcName: "clear_caches", docs: "A button which clears the locally downloaded data and the service worker. Login status etc will be kept", - args:[ + args: [ { name: "text", required: true, - doc: "The text to show on the button" - } + doc: "The text to show on the button", + }, ], constr(state: SpecialVisualizationState, tagSource: UIEventSource>, argument: string[], feature: Feature, layer: LayerConfig): SvelteUIElement { - return new SvelteUIElement(ClearCaches, {msg: argument[0] ?? "Clear local caches"}) + return new SvelteUIElement(ClearCaches, { msg: argument[0] ?? "Clear local caches" }) }, }, { @@ -2004,21 +2036,21 @@ export default class SpecialVisualizations { args: [ { name: "header", - doc: "The _identifier_ of a single tagRendering. This will be used as header" + doc: "The _identifier_ of a single tagRendering. This will be used as header", }, { name: "labels", - doc: "A `;`-separated list of either identifiers or label names. All tagRenderings matching this value will be shown in the accordion" - } + doc: "A `;`-separated list of either identifiers or label names. All tagRenderings matching this value will be shown in the accordion", + }, ], constr(state: SpecialVisualizationState, tags: UIEventSource>, argument: string[], selectedElement: Feature, layer: LayerConfig): SvelteUIElement { const [header, labelsStr] = argument const labels = labelsStr.split(";").map(x => x.trim()) return new SvelteUIElement(GroupedView, { - state, tags, selectedElement, layer, header, labels + state, tags, selectedElement, layer, header, labels, }) - } - } + }, + }, ] specialVisualizations.push(new AutoApplyButton(specialVisualizations)) @@ -2030,7 +2062,7 @@ export default class SpecialVisualizations { throw ( "Invalid special visualisation found: funcName is undefined for " + invalid.map((sp) => sp.i).join(", ") + - '. Did you perhaps type \n funcName: "funcname" // type declaration uses COLON\ninstead of:\n funcName = "funcName" // value definition uses EQUAL' + ". Did you perhaps type \n funcName: \"funcname\" // type declaration uses COLON\ninstead of:\n funcName = \"funcName\" // value definition uses EQUAL" ) }