- getRoute: function (points, callback) {
- var TURN_INSTRUCTIONS = [
- "",
- I18n.t('javascripts.directions.instructions.continue_on'), // 1
- I18n.t('javascripts.directions.instructions.slight_right'), // 2
- I18n.t('javascripts.directions.instructions.turn_right'), // 3
- I18n.t('javascripts.directions.instructions.sharp_right'), // 4
- I18n.t('javascripts.directions.instructions.uturn'), // 5
- I18n.t('javascripts.directions.instructions.sharp_left'), // 6
- I18n.t('javascripts.directions.instructions.turn_left'), // 7
- I18n.t('javascripts.directions.instructions.slight_left'), // 8
- I18n.t('javascripts.directions.instructions.via_point'), // 9
- I18n.t('javascripts.directions.instructions.follow'), // 10
- I18n.t('javascripts.directions.instructions.roundabout'), // 11
- I18n.t('javascripts.directions.instructions.leave_roundabout'), // 12
- I18n.t('javascripts.directions.instructions.stay_roundabout'), // 13
- I18n.t('javascripts.directions.instructions.start'), // 14
- I18n.t('javascripts.directions.instructions.destination'), // 15
- I18n.t('javascripts.directions.instructions.against_oneway'), // 16
- I18n.t('javascripts.directions.instructions.end_oneway') // 17
- ];
+ _transformSteps: function(input_steps, line) {
+ var INSTRUCTION_TEMPLATE = {
+ 'continue': 'javascripts.directions.instructions.continue',
+ 'merge right': 'javascripts.directions.instructions.merge_right',
+ 'merge left': 'javascripts.directions.instructions.merge_left',
+ 'off ramp right': 'javascripts.directions.instructions.offramp_right',
+ 'off ramp left': 'javascripts.directions.instructions.offramp_left',
+ 'on ramp right': 'javascripts.directions.instructions.onramp_right',
+ 'on ramp left': 'javascripts.directions.instructions.onramp_left',
+ 'fork right': 'javascripts.directions.instructions.fork_right',
+ 'fork left': 'javascripts.directions.instructions.fork_left',
+ 'end of road right': 'javascripts.directions.instructions.endofroad_right',
+ 'end of road left': 'javascripts.directions.instructions.endofroad_left',
+ 'turn straight': 'javascripts.directions.instructions.continue',
+ 'turn slight right': 'javascripts.directions.instructions.slight_right',
+ 'turn right': 'javascripts.directions.instructions.turn_right',
+ 'turn sharp right': 'javascripts.directions.instructions.sharp_right',
+ 'turn uturn': 'javascripts.directions.instructions.uturn',
+ 'turn sharp left': 'javascripts.directions.instructions.sharp_left',
+ 'turn left': 'javascripts.directions.instructions.turn_left',
+ 'turn slight left': 'javascripts.directions.instructions.slight_left',
+ 'roundabout': 'javascripts.directions.instructions.roundabout',
+ 'rotary': 'javascripts.directions.instructions.roundabout',
+ 'exit roundabout': 'javascripts.directions.instructions.exit_roundabout',
+ 'exit rotary': 'javascripts.directions.instructions.exit_roundabout',
+ 'depart': 'javascripts.directions.instructions.start',
+ 'arrive': 'javascripts.directions.instructions.destination',
+ };
+ var ICON_MAP = {
+ 'continue': 0,
+ 'merge right': 21,
+ 'merge left': 20,
+ 'off ramp right': 24,
+ 'off ramp left': 25,
+ 'on ramp right': 2,
+ 'on ramp left': 6,
+ 'fork right': 18,
+ 'fork left': 19,
+ 'end of road right': 22,
+ 'end of road left': 23,
+ 'turn straight': 0,
+ 'turn slight right': 1,
+ 'turn right': 2,
+ 'turn sharp right': 3,
+ 'turn uturn': 4,
+ 'turn slight left': 5,
+ 'turn left': 6,
+ 'turn sharp left': 7,
+ 'roundabout': 10,
+ 'rotary': 10,
+ 'exit roundabout': 10,
+ 'exit rotary': 10,
+ 'depart': 8,
+ 'arrive': 14
+ };
+ var numToWord = function(num) {
+ return ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth"][num-1];
+ };
+ var transformed_steps = input_steps.map(function(step, idx) {
+ var maneuver_id;