X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/423b13d5cefed2efd986ff468cf6375ef899c62a..3ddda7319c5e9f146a03ab86f1de8e32d9bae3ef:/app/assets/javascripts/routing_engines/graphhopper_bicycle.js diff --git a/app/assets/javascripts/routing_engines/graphhopper_bicycle.js b/app/assets/javascripts/routing_engines/graphhopper_bicycle.js index 39c7bca59..acf089278 100644 --- a/app/assets/javascripts/routing_engines/graphhopper_bicycle.js +++ b/app/assets/javascripts/routing_engines/graphhopper_bicycle.js @@ -1,22 +1,22 @@ // GraphHopper bicycle engine OSM.RoutingEngines.list.push({ - name: 'Bicycle (GraphHopper)', + name: "javascripts.directions.engines.graphhopper_bike", + creditline: 'Directions courtesy of Graphhopper', draggable: true, _hints: {}, - 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; } - if (final) + if (isFinal) url += "&instructions=true"; this.requestJSONP(url + "&type=jsonp&callback="); }, gotRoute: function(router, data) { if (!data.info.routeFound) { - alert("Couldn't find route between those two places"); return false; } // Draw polyline @@ -35,6 +35,7 @@ OSM.RoutingEngines.list.push({ steps.push([{lat: latlng[0], lng: latlng[1]}, instrCode, instrText, distInMeter]); } router.setItinerary({steps: steps}); + return true; }, GH_INSTR_MAP: { "-3": 6, // sharp left