diff --git a/Logic/SimpleMetaTagger.ts b/Logic/SimpleMetaTagger.ts index 8e20b784c5..5a978f7bd6 100644 --- a/Logic/SimpleMetaTagger.ts +++ b/Logic/SimpleMetaTagger.ts @@ -10,6 +10,7 @@ import { CountryCoder } from "latlon2country" import Constants from "../Models/Constants" import { TagUtils } from "./Tags/TagUtils" import { Feature, LineString } from "geojson" +import { OsmObject } from "./Osm/OsmObject" export class SimpleMetaTagger { public readonly keys: string[] @@ -484,6 +485,33 @@ export default class SimpleMetaTaggers { return true } ) + + public static referencingWays = new SimpleMetaTagger( + { + keys: ["_referencing_ways"], + isLazy: true, + doc: "_referencing_ways contains - for a node - which ways use this this node as point in their geometry.", + }, + (feature, _, __, state) => { + const id = feature.properties.id + if (!id.startsWith("node/")) { + return false + } + OsmObject.DownloadReferencingWays(id).then((referencingWays) => { + const currentTagsSource = state.allElements.getEventSourceById(id) + const wayIds = referencingWays.map((w) => "way/" + w.id) + wayIds.sort() + const wayIdsStr = wayIds.join(";") + if (wayIdsStr !== "" && currentTagsSource.data["_referencing_ways"] !== wayIdsStr) { + currentTagsSource.data["_referencing_ways"] = wayIdsStr + currentTagsSource.ping() + } + }) + + return true + } + ) + public static metatags: SimpleMetaTagger[] = [ SimpleMetaTaggers.latlon, SimpleMetaTaggers.layerInfo, @@ -499,6 +527,7 @@ export default class SimpleMetaTaggers { SimpleMetaTaggers.noBothButLeftRight, SimpleMetaTaggers.geometryType, SimpleMetaTaggers.levels, + SimpleMetaTaggers.referencingWays, ] public static readonly lazyTags: string[] = [].concat( ...SimpleMetaTaggers.metatags.filter((tagger) => tagger.isLazy).map((tagger) => tagger.keys) diff --git a/Utils.ts b/Utils.ts index 7371308c3b..ef100d77e0 100644 --- a/Utils.ts +++ b/Utils.ts @@ -466,6 +466,9 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be /** * Copies all key-value pairs of the source into the target. This will change the target * If the key starts with a '+', the values of the list will be appended to the target instead of overwritten + * If the key starts with `=`, the property will be overwritten. + * + * 'Source' will not be modified, but 'Target' will be * * const obj = {someValue: 42}; * const override = {someValue: null}; @@ -501,7 +504,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be * result.list2.length // => 1 * result.list2[0] // => "should-be-untouched" */ - static Merge(source: S, target: T): T & S { + static Merge(source: Readonly, target: T): T & S { if (target === null) { return source } diff --git a/assets/layers/fitness_station/fitness_station.json b/assets/layers/fitness_station/fitness_station.json index 13cc80a5f7..d3ea279ac8 100644 --- a/assets/layers/fitness_station/fitness_station.json +++ b/assets/layers/fitness_station/fitness_station.json @@ -28,6 +28,7 @@ ] }, "tagRenderings": [ + "images", { "id": "name", "question": { @@ -399,4 +400,4 @@ "filter": [ "open_now" ] -} \ No newline at end of file +} diff --git a/assets/themes/ghostbikes/botlogo.png b/assets/themes/ghostbikes/botlogo.png new file mode 100644 index 0000000000..5dba397fe7 Binary files /dev/null and b/assets/themes/ghostbikes/botlogo.png differ diff --git a/assets/themes/ghostbikes/botlogo.svg b/assets/themes/ghostbikes/botlogo.svg new file mode 100644 index 0000000000..8365c8d0a6 --- /dev/null +++ b/assets/themes/ghostbikes/botlogo.svg @@ -0,0 +1,102 @@ + + + + + + + Keep this area free for the 'bot' icon in Tusky + + + + + + + + + + + diff --git a/assets/themes/ghostbikes/ghostbikes.json b/assets/themes/ghostbikes/ghostbikes.json index 13fafd915e..e9c9f8b94c 100644 --- a/assets/themes/ghostbikes/ghostbikes.json +++ b/assets/themes/ghostbikes/ghostbikes.json @@ -22,8 +22,8 @@ "ca": "Bicicletes fantasmes" }, "description": { - "en": "A ghost bike is a memorial for a cyclist who died in a traffic accident, in the form of a white bicycle placed permanently near the accident location.

On this map, one can see all the ghost bikes which are known by OpenStreetMap. Is a ghost bike missing? Everyone can add or update information here - you only need to have a (free) OpenStreetMap account.", - "nl": "Een Witte Fiets of Spookfiets is een aandenken aan een fietser die bij een verkeersongeval om het leven kwam. Het gaat om een fiets die volledig wit is geschilderd en in de buurt van het ongeval werd geinstalleerd.

Op deze kaart zie je alle witte fietsen die door OpenStreetMap gekend zijn. Ontbreekt er een Witte Fiets of wens je informatie aan te passen? Meld je dan aan met een (gratis) OpenStreetMap account.", + "en": "A ghost bike is a memorial for a cyclist who died in a traffic accident, in the form of a white bicycle placed permanently near the accident location.

On this map, one can see all the ghost bikes which are known by OpenStreetMap. Is a ghost bike missing? Everyone can add or update information here - you only need to have a (free) OpenStreetMap account.

There exists an automated account on Mastodon which posts a monthly overview of ghost bikes worldwide

", + "nl": "Een Witte Fiets of Spookfiets is een aandenken aan een fietser die bij een verkeersongeval om het leven kwam. Het gaat om een fiets die volledig wit is geschilderd en in de buurt van het ongeval werd geinstalleerd.

Op deze kaart zie je alle witte fietsen die door OpenStreetMap gekend zijn. Ontbreekt er een Witte Fiets of wens je informatie aan te passen? Meld je dan aan met een (gratis) OpenStreetMap account.

Bekijk ook de geautomatiseerde account die maandelijks statistieken over Witte Fietsen post op Mastodon

", "de": "Geisterräder sind weiße Fahrräder, die zum Gedenken tödlich verunglückter Radfahrer vor Ort aufgestellt wurden.

Auf dieser Karte sehen Sie alle Geisterräder, die in OpenStreetMap eingetragen sind. Fehlt ein Geisterrad? Jeder kann hier Informationen hinzufügen oder aktualisieren - Sie benötigen nur ein (kostenloses) OpenStreetMap-Konto.", "ja": "ゴーストバイクは、交通事故で死亡したサイクリストを記念するもので、事故現場の近くに恒久的に置かれた白い自転車の形をしています。

このマップには、OpenStreetMapで知られているゴーストバイクがすべて表示されます。ゴーストバイクは行方不明ですか?誰でもここで情報の追加や更新ができます。必要なのは(無料の)OpenStreetMapアカウントだけです。", "zh_Hant": "幽靈單車是用來紀念死於交通事故的單車騎士,在事發地點附近放置白色單車。

在這份地圖上面,你可以看到所有在開放街圖已知的幽靈單車。有缺漏的幽靈單車嗎?所有人都可以在這邊新增或是更新資訊-只有你有(免費)開放街圖帳號。", @@ -44,4 +44,4 @@ "clustering": { "maxZoom": 0 } -} \ No newline at end of file +}