- console.log(data);
- // *** todo
- // *** will require some degree of refactoring because instruction text is pre-assembled
- // *** otherwise largely like OSRM (funny that)
+ router.setPolyline(data.route_geometry);
+ // Assemble instructions
+ var steps=[];
+ for (i=0; i<data.route_instructions.length; i++) {
+ var s=data.route_instructions[i];
+ steps.push([data.route_geometry[s[2]], this.CM_SPRITE_MAP[s[7]], s[0], s[1]]);
+ }
+ router.setItinerary({ steps: steps });