1 // CloudMade foot engine
2 // *** again, this should be shared from a Cloudmade library somewhere
3 // *** this API key is taken from some example code, not for real live use!
4 // http://cloudmade.com/documentation/routing
6 OSM.RoutingEngines.list.push({
7 name: 'Foot (CloudMade)',
18 }, // was half expecting to see TLDR in there
19 getRoute: function(final,points) {
20 var url="http://routes.cloudmade.com/8ee2a50541944fb9bcedded5165f09d9/api/0.3/";
22 for (var i=0; i<points.length; i++) {
28 this.requestJSONP(url+"?callback=");
30 gotRoute: function(router,data) {
31 router.setPolyline(data.route_geometry);
32 // Assemble instructions
34 for (i=0; i<data.route_instructions.length; i++) {
35 var s=data.route_instructions[i];
36 steps.push([data.route_geometry[s[2]], this.CM_SPRITE_MAP[s[7]], s[0], s[1]]);
38 router.setItinerary({ steps: steps });