Themes(rolling_stock): add snap to 'railway' function

This commit is contained in:
Pieter Vander Vennet 2025-08-17 02:06:42 +02:00
parent c70f249ca4
commit 06da7a0cf4
4 changed files with 84 additions and 5 deletions

View file

@ -131,7 +131,8 @@
},
"tags": [
"historic=locomotive"
]
],
"snapToLayer": ["railway"]
},
{
"title": {
@ -144,7 +145,9 @@
},
"tags": [
"historic=railway_car"
]
],
"snapToLayer": ["railway"]
},
{
"title": {
@ -157,7 +160,9 @@
},
"tags": [
"historic=minecart"
]
],
"snapToLayer": ["railway"]
}
],
"tagRenderings": [

View file

@ -0,0 +1,66 @@
{
"id": "railway",
"name": {
"en": "Railway"
},
"description": {
"en": "Railways and disused railways"
},
"source": {
"osmTags": {
"or": [
"railway=rail",
"railway=tram",
"railway=subway",
"railway=light_rail",
"railway=disused",
"disused:railway=rail",
"disused:railway=tram",
"disused:railway=subway",
"disused:railway=light_rail",
"abandoned:railway=rail",
"abandoned:railway=tram",
"abandoned:railway=subway",
"abandoned:railway=light_rail"
]
}
},
"minzoom": 14,
"title": {
"render": {
"en": "Railway"
},
"icon": "./assets/svg/train.svg"
},
"pointRendering": [
{
"location": [
"point"
],
"marker": [
{
"icon": "circle"
}
]
}
],
"lineRendering": [
{
"width": 1,
"color": "black"
}
],
"tagRenderings": [
"images"
],
"allowMove": false,
"#": "In first instance to snap historic rolling stock",
"snapName": {
"en": "railway track"
},
"credits": "mnalis ALTernative",
"credits:uid": 172435
}

View file

@ -18,6 +18,14 @@
},
"icon": "./assets/layers/historic_rolling_stock/steam_locomotive.svg",
"layers": [
"historic_rolling_stock"
"historic_rolling_stock",
{
"builtin": "railway",
"override": {
"name": null,
"presets": null,
"shownByDefault": false
}
}
]
}

View file

@ -299,7 +299,7 @@ export interface LayerConfigJson {
/**
* Advanced option - might be set by the theme compiler
*
* If true, this data will _always_ be loaded, even if the theme is disabled by a filter or hidden.
* If true, this data will _always_ be loaded, even if the layer is disabled by a filter or hidden.
* The opposite of `doNotDownload`
*
* question: Should this layer be forcibly loaded?