diff --git a/UI/Popup/TagApplyButton.ts b/UI/Popup/TagApplyButton.ts index 0a654895b..7ccca7ca0 100644 --- a/UI/Popup/TagApplyButton.ts +++ b/UI/Popup/TagApplyButton.ts @@ -42,6 +42,13 @@ export default class TagApplyButton implements AutoAction { public static generateTagsToApply(spec: string, tagSource: Store): Store { + // Check whether we need to look up a single value + + if (!spec.includes(";") && !spec.includes("=") && spec.includes("$")){ + // We seem to be dealing with a single value, fetch it + spec = tagSource.data[spec.replace("$","")] + } + const tgsSpec = spec.split(";").map(spec => { const kv = spec.split("=").map(s => s.trim()); if (kv.length != 2) { diff --git a/assets/themes/onwheels/onwheels.json b/assets/themes/onwheels/onwheels.json index 703cf1924..3617652ce 100644 --- a/assets/themes/onwheels/onwheels.json +++ b/assets/themes/onwheels/onwheels.json @@ -39,6 +39,18 @@ "_closest_osm_hotel=feat.closest('hotel')?.properties?.id", "_closest_osm_hotel_distance=feat.distanceTo(feat.properties._closest_osm_hotel)", "_has_closeby_feature=Number(feat.properties._closest_osm_hotel_distance) < 50 ? 'yes' : 'no'" + ], + "+tagRenderings": [ + { + "id": "import-button", + "condition": "_has_closeby_feature=no", + "render": "{import_button(hotel,tags,Import,./assets/svg/addSmall.svg,,,,photo,mr_taskId)}" + }, + { + "id": "tag-apply-button", + "condition": "_has_closeby_feature=yes", + "render": "{tag_apply($tags, Add all the suggested tags, apply_icon.svg, _closest_osm_hotel)}" + } ] } }