- if (namedRoad) {
- instText += I18n.t(template + '_without_exit', { name: name });
- } else {
- instText += I18n.t(template + '_without_directions');
- }
+ instText += I18n.t(template + '_without_exit', { name: name } );
+ }
+ } else if (step.maneuver.type.match(/on ramp|off ramp/)) {
+ var params = {};
+ if (step.exits && step.maneuver.type.match(/off ramp/)) params.exit = step.exits;
+ if (step.destinations) params.directions = destinations;
+ if (namedRoad) params.directions = name;
+ if (Object.keys(params).length > 0) {
+ template = template + "_with_" + Object.keys(params).join("_");