Themes(zhv): move tagapply

This commit is contained in:
Robin van der Linde 2025-07-24 22:07:41 +02:00
parent 21d0cf675c
commit 01870396c2

View file

@ -12,11 +12,11 @@
{ {
"id": "zhv", "id": "zhv",
"name": { "name": {
"en": "Bus stops in ZHV" "en": "Public transport stops in ZHV"
}, },
"title": { "title": {
"render": { "render": {
"en": "Bus stop in ZHV" "en": "Public transport stop in ZHV"
} }
}, },
"minzoom": 15, "minzoom": 15,
@ -87,29 +87,9 @@
] ]
} }
}, },
{
"id": "tag-apply",
"condition": {
"or": [
"_has_closeby_feature=yes",
"_has_closeby_feature=maybe"
]
},
"render": {
"special": {
"type": "tag_apply",
"tags_to_apply": "ref:IFOPT=$_ifopt",
"id_of_object_to_apply_this_one": "_closest_osm_stop_id",
"message": {
"en": "Add IFOPT to the existing stop"
},
"image": "./assets/svg/addSmall.svg"
}
}
},
{ {
"id": "minimap_with_poi", "id": "minimap_with_poi",
"render": "{minimap(18, id, _closest_osm_stop_id)}" "render": "{minimap(18, id, _closest_osm_stop_id):height:10rem}"
} }
], ],
"pointRendering": [ "pointRendering": [
@ -140,20 +120,20 @@
} }
], ],
"calculatedTags": [ "calculatedTags": [
"_closest_osm_stop=closest(feat)('transit_stops')?.properties", "_closest_osm_stop_id=closest(feat)('transit_stops')?.properties?.id",
"_closest_osm_stop_id=feat.properties._closest_osm_stop?.id",
"_closest_osm_stop_distance=distanceTo(feat)(feat.properties._closest_osm_stop_id)", "_closest_osm_stop_distance=distanceTo(feat)(feat.properties._closest_osm_stop_id)",
"_closest_osm_stop_name=feat.properties._closest_osm_stop?.name", "_closest_osm_stop_name=closest(feat)('transit_stops')?.properties?.name",
"_has_closeby_feature=feat.properties._closest_osm_stop_distance < 15 ? 'yes' : (feat.properties._closest_osm_stop_distance > 25 ? 'no' : 'maybe')", "_closest_osm_stop_ifopt=closest(feat)('transit_stops')?.properties?.['ref:IFOPT']",
"_has_closeby_feature=(feat.properties._closest_osm_stop_ifopt === feat.properties._ifopt) ? 'yes' : (feat.properties._closest_osm_stop_distance < 15 ? 'yes' : (feat.properties._closest_osm_stop_distance > 25 ? 'no' : 'maybe'))",
"_ifopt=feat.properties.DHID", "_ifopt=feat.properties.DHID",
"_tags='highway=bus_stop;public_transport=platform;ref:IFOPT='+feat.properties._ifopt+';name='+feat.properties.Name" "_tags='public_transport=platform;ref:IFOPT='+feat.properties._ifopt+';name='+feat.properties.Name"
] ]
}, },
{ {
"builtin": "transit_stops", "builtin": "transit_stops",
"override": { "override": {
"name": { "name": {
"en": "Bus stops in OSM" "en": "Public transport stops in OSM"
}, },
"tagRenderings+": [ "tagRenderings+": [
{ {
@ -171,7 +151,46 @@
"en": "e.g. NL:Q:15003950 or de:03457:15801::2" "en": "e.g. NL:Q:15003950 or de:03457:15801::2"
} }
} }
},
{
"id": "zhv_stop",
"condition": "_has_closeby_feature=yes",
"render": {
"en": "There is a ZHV stop nearby: <a href=#{_closest_zhv_stop_id}>{_closest_zhv_stop_name}</a>."
}
},
{
"id": "zhv_apply",
"condition": {
"and": [
"_has_closeby_feature=yes",
"ref:IFOPT!~*"
]
},
"render": {
"special": {
"type": "tag_apply",
"tags_to_apply": "ref:IFOPT=$_ifopt",
"id_of_object_to_apply_this_one": "_closest_osm_stop_id",
"message": {
"en": "Add IFOPT to this stop"
},
"image": "./assets/svg/addSmall.svg"
}
}
},
{
"id": "minimap_with_poi",
"condition": "_has_closeby_feature=yes",
"render": "{minimap(18, id, _closest_zhv_stop_id):height:10rem}"
} }
],
"calculatedTags": [
"_closest_zhv_stop_id=closest(feat)('zhv')?.properties?.id",
"_closest_zhv_stop_distance=distanceTo(feat)(feat.properties._closest_zhv_stop_id)",
"_closest_zhv_stop_name=closest(feat)('zhv')?.properties?.Name",
"_has_closeby_feature=feat.properties._closest_zhv_stop_distance < 25",
"_ifopt=closest(feat)('zhv')?.properties?.DHID"
] ]
} }
} }