- name: 'Bicycle (GraphHopper)',
+ name: "javascripts.directions.engines.graphhopper_bike",
+ creditline: 'Directions courtesy of <a href="http://graphhopper.com/routing/" target="_blank">Graphhopper</a>',
- getRoute: function(final, points) {
- var url = "http://graphhopper.com/routing/api/route?vehicle=bike&locale=en";
+ getRoute: function(isFinal, points) {
+ var url = "http://graphhopper.com/routing/api/route?vehicle=bike&locale=" + I18n.currentLocale();
for (var i = 0; i < points.length; i++) {
var pair = points[i].join(',');
url += "&point=" + pair;
}
for (var i = 0; i < points.length; i++) {
var pair = points[i].join(',');
url += "&point=" + pair;
}
url += "&instructions=true";
this.requestJSONP(url + "&type=jsonp&callback=");
},
gotRoute: function(router, data) {
if (!data.info.routeFound) {
url += "&instructions=true";
this.requestJSONP(url + "&type=jsonp&callback=");
},
gotRoute: function(router, data) {
if (!data.info.routeFound) {
steps.push([{lat: latlng[0], lng: latlng[1]}, instrCode, instrText, distInMeter]);
}
router.setItinerary({steps: steps});
steps.push([{lat: latlng[0], lng: latlng[1]}, instrCode, instrText, distInMeter]);
}
router.setItinerary({steps: steps});