Expose pronunciation in RouteStep

Uses name:pronunciation by default for cars.
This commit is contained in:
Patrick Niklaus
2016-05-26 03:35:38 +02:00
parent 9cdc9008aa
commit 0a53775fb3
17 changed files with 76 additions and 9 deletions
+6 -2
View File
@@ -349,6 +349,7 @@ function way_function (way, result)
-- parse the remaining tags
local name = way:get_value_by_key("name")
local pronunciation = way:get_value_by_key("name:pronunciation")
local ref = way:get_value_by_key("ref")
local junction = way:get_value_by_key("junction")
-- local barrier = way:get_value_by_key("barrier", "")
@@ -358,6 +359,7 @@ function way_function (way, result)
-- Set the name that will be used for instructions
local has_ref = ref and "" ~= ref
local has_name = name and "" ~= name
local has_pronunciation = pronunciation and "" ~= pronunciation
if has_name and has_ref then
result.name = name .. " (" .. ref .. ")"
@@ -365,8 +367,10 @@ function way_function (way, result)
result.name = ref
elseif has_name then
result.name = name
-- else
-- result.name = highway -- if no name exists, use way type
end
if has_pronunciation then
result.pronunciation = pronunciation
end
if junction and ("roundabout" == junction or "mini_roundabout" == highway) then