"rotary": "roundabout",
"exit roundabout": "exit_roundabout",
"exit rotary": "exit_roundabout",
+ "ferry": "ferry",
"depart": "start",
"arrive": "destination"
};
}
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":
"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],
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: