From: Richard Fairhurst Date: Wed, 22 Jan 2014 18:53:30 +0000 (+0000) Subject: Parse CloudMade directions X-Git-Tag: live~4237^2~53 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/81ebdee1852bae569d0ee82233578155f10d1bfb?ds=inline Parse CloudMade directions --- diff --git a/app/assets/javascripts/routing_engines/cloudmade_foot.js b/app/assets/javascripts/routing_engines/cloudmade_foot.js index 149ceb31a..a2b7bbc9a 100644 --- a/app/assets/javascripts/routing_engines/cloudmade_foot.js +++ b/app/assets/javascripts/routing_engines/cloudmade_foot.js @@ -6,6 +6,16 @@ OSM.RoutingEngines.list.push({ name: 'Foot (CloudMade)', draggable: true, + CM_SPRITE_MAP: { + "C": 1, + "TL": 7, + "TSLL": 8, + "TSHL": 6, + "TR": 3, + "TSLR": 2, + "TSHR": 4, + "TU": 5 + }, // was half expecting to see TLDR in there getRoute: function(final,points) { var url="http://routes.cloudmade.com/8ee2a50541944fb9bcedded5165f09d9/api/0.3/"; var p=[]; @@ -18,10 +28,14 @@ OSM.RoutingEngines.list.push({ this.requestJSONP(url+"?callback="); }, gotRoute: function(router,data) { - 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