From 4e57e10ba8bcef38affac5300feae9f06cfcbd72 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Sat, 30 May 2015 19:00:30 +0200 Subject: [PATCH] Use 'name (ref)' if both are present --- profiles/car.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/profiles/car.lua b/profiles/car.lua index 3e22afe04..912d98cac 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -345,9 +345,14 @@ function way_function (way, result) local service = way:get_value_by_key("service") -- Set the name that will be used for instructions - if ref and "" ~= ref then + local has_ref = ref and "" ~= ref + local has_name = name and "" ~= name + + if has_name and has_ref then + result.name = name .. " (" .. ref .. ")" + elseif has_ref then result.name = ref - elseif name and "" ~= name then + elseif has_name then result.name = name -- else -- result.name = highway -- if no name exists, use way type