forked from MapComplete/MapComplete
Fix: await 'country' to be loaded
This commit is contained in:
parent
e3a73d551a
commit
3c5bde1ae3
6 changed files with 102 additions and 35 deletions
|
@ -128,7 +128,7 @@
|
|||
{
|
||||
"id": "charge",
|
||||
"question": {
|
||||
"en": "How much does it cost to press a coin?"
|
||||
"en": "How much does it cost to press a penny?"
|
||||
},
|
||||
"freeform": {
|
||||
"key": "charge",
|
||||
|
@ -140,20 +140,20 @@
|
|||
{
|
||||
"if": "charge=1 EUR",
|
||||
"then": {
|
||||
"en": "It costs 1 euro to press a coin."
|
||||
"en": "It costs 1 euro to press a penny."
|
||||
},
|
||||
"hideInAnswer": "_currency!~.*EUR.*"
|
||||
},
|
||||
{
|
||||
"if": "charge=2 EUR",
|
||||
"then": {
|
||||
"en": "It costs 2 euros to press a coin."
|
||||
"en": "It costs 2 euros to press a penny."
|
||||
},
|
||||
"hideInAnswer": "_currency!~.*EUR.*"
|
||||
}
|
||||
],
|
||||
"render": {
|
||||
"en": "It costs {charge} to press a coin."
|
||||
"en": "It costs {charge} to press a penny."
|
||||
}
|
||||
},
|
||||
"denominations-coins",
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
"startLon": 0,
|
||||
"startZoom": 1,
|
||||
"widenFactor": 2,
|
||||
|
||||
"clustering": {
|
||||
"maxZoom": 14,
|
||||
"minNeededElements": 250
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
{
|
||||
"id": "mapcomplete-changes",
|
||||
"title": {
|
||||
"en": "Changes made with MapComplete"
|
||||
"en": "Changes made with MapComplete",
|
||||
"de": "Mit MapComplete erstellte Änderungen",
|
||||
"nl": "Wijzigingen gemaakt met MapComplete"
|
||||
},
|
||||
"shortDescription": {
|
||||
"en": "Shows changes made by MapComplete"
|
||||
"en": "Show changes made with MapComplete",
|
||||
"de": "Mit MapComplete erstellte Änderungen anzeigen",
|
||||
"nl": "Toon wijzigingen gemaakt met MapComplete"
|
||||
},
|
||||
"description": {
|
||||
"en": "This maps shows all the changes made with MapComplete"
|
||||
"en": "This maps shows all the changes made with MapComplete",
|
||||
"de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen",
|
||||
"nl": "Deze kaart toont alle wijzigingen die met MapComplete gemaakt werden"
|
||||
},
|
||||
"icon": "./assets/svg/logo.svg",
|
||||
"hideFromOverview": true,
|
||||
|
@ -20,7 +26,9 @@
|
|||
{
|
||||
"id": "mapcomplete-changes",
|
||||
"name": {
|
||||
"en": "Changeset centers"
|
||||
"en": "Changeset centers",
|
||||
"de": "Zentrum der Änderungssätze",
|
||||
"nl": "Centerpunt van changeset"
|
||||
},
|
||||
"minzoom": 0,
|
||||
"source": {
|
||||
|
@ -31,41 +39,51 @@
|
|||
},
|
||||
"title": {
|
||||
"render": {
|
||||
"en": "Changeset for {theme}"
|
||||
"en": "Changeset for {theme}",
|
||||
"de": "Änderungssatz für {theme}"
|
||||
}
|
||||
},
|
||||
"description": {
|
||||
"en": "Shows all MapComplete changes"
|
||||
"en": "Show all MapComplete changes",
|
||||
"de": "Alle MapComplete-Änderungen anzeigen",
|
||||
"nl": "Toon alle MapComplete wijzigingen"
|
||||
},
|
||||
"tagRenderings": [
|
||||
{
|
||||
"id": "show_changeset_id",
|
||||
"render": {
|
||||
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
|
||||
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
|
||||
"de": "Änderungssatz <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "contributor",
|
||||
"question": {
|
||||
"en": "What contributor did make this change?"
|
||||
"en": "Which contributor made this change?",
|
||||
"de": "Welcher Mitwirkende hat diese Änderung vorgenommen?",
|
||||
"nl": "Welke bijdrager maakte deze wijziging?"
|
||||
},
|
||||
"freeform": {
|
||||
"key": "user"
|
||||
},
|
||||
"render": {
|
||||
"en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
|
||||
"en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
|
||||
"de": "Änderung gemacht von <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>",
|
||||
"nl": "Wijziging gemaakt door <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "theme-id",
|
||||
"question": {
|
||||
"en": "What theme was used to make this change?"
|
||||
"en": "What theme was used to make this change?",
|
||||
"de": "Welches Thema wurde für diese Änderung verwendet?\""
|
||||
},
|
||||
"freeform": {
|
||||
"key": "theme"
|
||||
},
|
||||
"render": {
|
||||
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
|
||||
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>",
|
||||
"de": "Geändert mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -74,19 +92,27 @@
|
|||
"key": "locale"
|
||||
},
|
||||
"question": {
|
||||
"en": "What locale (language) was this change made in?"
|
||||
"en": "What locale (language) was this change made in?",
|
||||
"de": "In welcher Sprache wurde diese Änderung vorgenommen?",
|
||||
"nl": "In welke locale (taal) werd deze wijziging gemaakt?"
|
||||
},
|
||||
"render": {
|
||||
"en": "User locale is {locale}"
|
||||
"en": "User locale is {locale}",
|
||||
"de": "Usersprache ist {locale}",
|
||||
"nl": "De gebruikerstaal is {locale}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "host",
|
||||
"render": {
|
||||
"en": "Change with with <a href='{host}'>{host}</a>"
|
||||
"en": "Change made with <a href='{host}'>{host}</a>",
|
||||
"de": "Änderung vorgenommen mit <a href='{host}'>{host}</a>",
|
||||
"nl": "Wijziging gemaakt met <a href='{host}'>{host}</a>"
|
||||
},
|
||||
"question": {
|
||||
"en": "What host (website) was this change made with?"
|
||||
"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?"
|
||||
},
|
||||
"freeform": {
|
||||
"key": "host"
|
||||
|
@ -107,10 +133,12 @@
|
|||
{
|
||||
"id": "version",
|
||||
"question": {
|
||||
"en": "What version of MapComplete was used to make this change?"
|
||||
"en": "What version of MapComplete was used to make this change?",
|
||||
"de": "Mit welcher Version von MapComplete wurde diese Änderung gemacht?"
|
||||
},
|
||||
"render": {
|
||||
"en": "Made with {editor}"
|
||||
"en": "Made with {editor}",
|
||||
"de": "Erstellt mit {editor}"
|
||||
},
|
||||
"freeform": {
|
||||
"key": "editor"
|
||||
|
@ -452,7 +480,9 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "Themename contains {search}"
|
||||
"en": "Theme name contains {search}",
|
||||
"de": "Themenname enthält {search}",
|
||||
"nl": "Themenaam bevat {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -468,7 +498,9 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "Made by contributor {search}"
|
||||
"en": "Made by contributor {search}",
|
||||
"de": "Erstellt von {search}",
|
||||
"nl": "Gemaakt door bijdrager {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -484,7 +516,9 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "<b>Not</b> made by contributor {search}"
|
||||
"en": "<b>Not</b> made by contributor {search}",
|
||||
"de": "<b>Nicht</b> erstellt von {search}",
|
||||
"nl": "<b>Niet</b> gemaakt door bijdrager {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -501,7 +535,9 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "Made before {search}"
|
||||
"en": "Made before {search}",
|
||||
"de": "Erstellt vor {search}",
|
||||
"nl": "Gemaakt voor {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -518,7 +554,9 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "Made after {search}"
|
||||
"en": "Made after {search}",
|
||||
"de": "Erstellt nach {search}",
|
||||
"nl": "Gemaakt na {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -534,7 +572,9 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "User language (iso-code) {search}"
|
||||
"en": "User language (iso-code) {search}",
|
||||
"de": "Benutzersprache (ISO-Code) {search}",
|
||||
"nl": "De taal van de bijdrager is {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -550,7 +590,9 @@
|
|||
}
|
||||
],
|
||||
"question": {
|
||||
"en": "Made with host {search}"
|
||||
"en": "Made with host {search}",
|
||||
"de": "Erstellt mit Host {search}",
|
||||
"nl": "Gemaakt met host {search}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -561,7 +603,9 @@
|
|||
{
|
||||
"osmTags": "add-image>0",
|
||||
"question": {
|
||||
"en": "Changeset added at least one image"
|
||||
"en": "Changeset added at least one image",
|
||||
"de": "Changeset fügte mindestens ein Bild hinzu",
|
||||
"nl": "Changeset bevat minstens één afbeelding"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -576,7 +620,8 @@
|
|||
{
|
||||
"id": "link_to_more",
|
||||
"render": {
|
||||
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
|
||||
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>",
|
||||
"de": "Mehr Statistiken gibt es <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9400,6 +9400,17 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"fixate-north": {
|
||||
"mappings": {
|
||||
"0": {
|
||||
"then": "Allow to rotate the map"
|
||||
},
|
||||
"1": {
|
||||
"then": "Always keep north pointing up"
|
||||
}
|
||||
},
|
||||
"question": "Should north always be up?"
|
||||
},
|
||||
"inbox": {
|
||||
"mappings": {
|
||||
"0": {
|
||||
|
|
|
@ -635,6 +635,9 @@
|
|||
"render": "It costs {charge} to press a penny."
|
||||
},
|
||||
"coin": {
|
||||
"freeform": {
|
||||
"placeholder": "Coin type (e.g. 10cent)"
|
||||
},
|
||||
"mappings": {
|
||||
"0": {
|
||||
"then": "This penny press uses a 2 cent coin for pressing."
|
||||
|
@ -644,9 +647,16 @@
|
|||
},
|
||||
"2": {
|
||||
"then": "This penny press uses a 10 cent coin for pressing."
|
||||
},
|
||||
"3": {
|
||||
"then": "This penny press uses a 25 cent coin for pressing."
|
||||
},
|
||||
"4": {
|
||||
"then": "This penny press uses a 50 cent coin for pressing."
|
||||
}
|
||||
},
|
||||
"question": "What coin is used for pressing?"
|
||||
"question": "What coin is used for pressing?",
|
||||
"render": "This penny press uses a {coin:type} coin for pressing."
|
||||
},
|
||||
"designs": {
|
||||
"freeform": {
|
||||
|
|
|
@ -590,11 +590,13 @@ export default class SimpleMetaTaggers {
|
|||
doc: "Adds the currency valid for the object, based on country or explicit tagging. Can be a single currency or a semicolon-separated list of currencies. Empty if no currency is found.",
|
||||
isLazy: true,
|
||||
},
|
||||
(feature) => {
|
||||
Utils.AddLazyProperty(feature.properties, "_currency", () => {
|
||||
(feature: Feature, layer: LayerConfig, tagsStore: UIEventSource<OsmTags>) => {
|
||||
Utils.AddLazyPropertyAsync(feature.properties, "_currency", async () => {
|
||||
// Wait until _country is actually set
|
||||
await tagsStore.AsPromise((tags) => !!tags._country)
|
||||
|
||||
// Initialize a list of currencies
|
||||
const currencies = {}
|
||||
|
||||
// Check if there are any currency:XXX tags, add them to the map
|
||||
for (const key in feature.properties) {
|
||||
if (key.startsWith("currency:")) {
|
||||
|
|
Loading…
Reference in a new issue