From: Tom Hughes Date: Sun, 13 Apr 2025 10:12:14 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/5925' X-Git-Tag: live~39 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/283e034b562ed4786d9f9fc6020e2c61fd1dca02?hp=02079fb88d6914daaf6f36d5dba4a8bfc9d0c9d6 Merge remote-tracking branch 'upstream/pull/5925' --- diff --git a/app/assets/javascripts/index/directions/fossgis_osrm.js b/app/assets/javascripts/index/directions/fossgis_osrm.js index 53043e06d..893e6cdc1 100644 --- a/app/assets/javascripts/index/directions/fossgis_osrm.js +++ b/app/assets/javascripts/index/directions/fossgis_osrm.js @@ -30,6 +30,7 @@ "rotary": "roundabout", "exit roundabout": "exit_roundabout", "exit rotary": "exit_roundabout", + "ferry": "continue", "depart": "start", "arrive": "destination" }; @@ -81,8 +82,10 @@ } function _processDirections(leg) { - function getManeuverId(maneuver) { + function getManeuverId({ maneuver, mode, intersections }) { // special case handling + if (mode === "ferry") return "ferry"; + if (intersections.some(i => i.classes?.includes("ferry"))) return "ferry"; switch (maneuver.type) { case "on ramp": case "off ramp": @@ -129,11 +132,12 @@ "rotary": "roundabout", "exit roundabout": "roundabout", "exit rotary": "roundabout", + "ferry": "ferry", "depart": "start", "arrive": "destination" }; - for (const step of leg.steps) step.maneuverId = getManeuverId(step.maneuver); + for (const step of leg.steps) step.maneuverId = getManeuverId(step); const steps = leg.steps.map(step => [ ICON_MAP[step.maneuverId], diff --git a/config/locales/en.yml b/config/locales/en.yml index ddcc672cc..35ba0650b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3349,6 +3349,7 @@ en: roundabout_with_exit: At the roundabout take the exit %{exit} onto %{name} roundabout_with_exit_ordinal: At the roundabout take the %{exit} exit onto %{name} exit_roundabout: Exit the roundabout onto %{name} + ferry_without_exit: Take the ferry %{name} unnamed: "unnamed road" courtesy: "Directions courtesy of %{link}" exit_counts: