Try and show both the name of the road being turned on to and the
destination depending on what is available.
Closes #1740
Array.prototype.push.apply(line, step_geometry);
var instText = "<b>" + (idx + 1) + ".</b> ";
Array.prototype.push.apply(line, step_geometry);
var instText = "<b>" + (idx + 1) + ".</b> ";
+ var destinations = "<b>" + step.destinations + "</b>";
+ var namedRoad = true;
if (step.name && step.ref) {
name = "<b>" + step.name + " (" + step.ref + ")</b>";
} else if (step.name) {
if (step.name && step.ref) {
name = "<b>" + step.name + " (" + step.ref + ")</b>";
} else if (step.name) {
name = "<b>" + step.ref + "</b>";
} else {
name = I18n.t('javascripts.directions.instructions.unnamed');
name = "<b>" + step.ref + "</b>";
} else {
name = I18n.t('javascripts.directions.instructions.unnamed');
if (step.maneuver.type.match(/rotary|roundabout/)) {
instText += I18n.t(template + '_with_exit', { exit: step.maneuver.exit, name: name } );
if (step.maneuver.type.match(/rotary|roundabout/)) {
instText += I18n.t(template + '_with_exit', { exit: step.maneuver.exit, name: name } );
+ } else if (step.maneuver.type.match(/on ramp|off ramp/)) {
+ if (step.destinations) {
+ if (namedRoad) {
+ instText += I18n.t(template + '_with_name_and_directions', { name: name, directions: destinations } );
+ } else {
+ instText += I18n.t(template + '_with_directions', { directions: destinations } );
+ }
+ } else {
+ if (namedRoad) {
+ instText += I18n.t(template + '_without_exit', { name: name });
+ } else {
+ instText += I18n.t(template + '_without_directions');
+ }
+ }
} else {
instText += I18n.t(template + '_without_exit', { name: name });
}
} else {
instText += I18n.t(template + '_without_exit', { name: name });
}
continue_without_exit: Continue on %{name}
slight_right_without_exit: Slight right onto %{name}
offramp_right_without_exit: Take the ramp on the right onto %{name}
continue_without_exit: Continue on %{name}
slight_right_without_exit: Slight right onto %{name}
offramp_right_without_exit: Take the ramp on the right onto %{name}
+ offramp_right_with_directions: Take the ramp on the right towards %{directions}
+ offramp_right_with_name_and_directions: Take the ramp on the right onto %{name}, towards %{directions}
+ offramp_right_without_directions: Take the ramp on the right
onramp_right_without_exit: Turn right on the ramp onto %{name}
onramp_right_without_exit: Turn right on the ramp onto %{name}
+ onramp_right_with_directions: Turn right onto the ramp towards %{directions}
+ onramp_right_with_name_and_directions: Turn right on the ramp onto %{name}, towards %{directions}
+ onramp_right_without_directions: Turn right onto the ramp
endofroad_right_without_exit: At the end of the road turn right onto %{name}
merge_right_without_exit: Merge right onto %{name}
fork_right_without_exit: At the fork turn right onto %{name}
endofroad_right_without_exit: At the end of the road turn right onto %{name}
merge_right_without_exit: Merge right onto %{name}
fork_right_without_exit: At the fork turn right onto %{name}
sharp_left_without_exit: Sharp left onto %{name}
turn_left_without_exit: Turn left onto %{name}
offramp_left_without_exit: Take the ramp on the left onto %{name}
sharp_left_without_exit: Sharp left onto %{name}
turn_left_without_exit: Turn left onto %{name}
offramp_left_without_exit: Take the ramp on the left onto %{name}
+ offramp_left_with_directions: Take the ramp on the left towards %{directions}
+ offramp_left_with_name_and_directions: Take the ramp on the left onto %{name}, towards %{directions}
+ offramp_left_without_directions: Take the ramp on the left
onramp_left_without_exit: Turn left on the ramp onto %{name}
onramp_left_without_exit: Turn left on the ramp onto %{name}
+ onramp_left_with_directions: Turn left onto the ramp towards %{directions}
+ onramp_left_with_name_and_directions: Turn left on the ramp onto %{name}, towards %{directions}
+ onramp_left_without_directions: Turn left onto the ramp
endofroad_left_without_exit: At the end of the road turn left onto %{name}
merge_left_without_exit: Merge left onto %{name}
fork_left_without_exit: At the fork turn left onto %{name}
endofroad_left_without_exit: At the end of the road turn left onto %{name}
merge_left_without_exit: Merge left onto %{name}
fork_left_without_exit: At the fork turn left onto %{name}