2 // http://developer.mapquest.com/web/products/open/directions-service
3 // http://open.mapquestapi.com/directions/
4 // https://github.com/apmon/openstreetmap-website/blob/21edc353a4558006f0ce23f5ec3930be6a7d4c8b/app/controllers/routing_controller.rb#L153
6 // *** needs to give credit
8 OSM.RoutingEngines.list.push({
9 name: 'Bicycle (MapQuest Open)',
12 getRoute: function(final,points) {
13 var url="http://open.mapquestapi.com/directions/v2/route?key=Fmjtd%7Cluur290anu%2Crl%3Do5-908a0y";
14 var from=points[0]; var to=points[points.length-1];
15 url+="&from="+from.join(',');
16 url+="&to="+to.join(',');
17 url+="&routeType=bicycle";
18 url+="&manMaps=false";
19 url+="&shapeFormat=raw&generalize=0";
20 this.requestJSONP(url+"&callback=");
22 gotRoute: function(router,data) {
24 var shape=data.route.shape.shapePoints;
25 for (var i=0; i<shape.length; i+=2) {
26 poly.push(L.latLng(shape[i],shape[i+1]));
28 router.setPolyline(poly);
30 // data.shape.maneuverIndexes links turns to polyline positions
31 // data.legs[0].maneuvers is list of turns
33 // router.setItinerary(data.route_instructions);