diff --git a/lib/scenario-editor/utils/valhalla.js b/lib/scenario-editor/utils/valhalla.js index 9f66b9c7c..4fbb6fe91 100644 --- a/lib/scenario-editor/utils/valhalla.js +++ b/lib/scenario-editor/utils/valhalla.js @@ -208,7 +208,7 @@ export async function getSegment ( /** * Call GraphHopper routing service with lat/lng coordinates. * - * Example URL: https://graphhopper.com/api/1/route?point=49.932707,11.588051&point=50.3404,11.64705&vehicle=car&debug=true&&type=json + * Example URL: https://graphhopper.com/api/1/route?point=49.932707,11.588051&point=50.3404,11.64705&profile=car&debug=true&&type=json */ export function routeWithGraphHopper (points: Array, avoidMotorways?: boolean, followRail?: boolean = false): ?Promise { if (points.length < 2) { @@ -256,13 +256,11 @@ export function routeWithGraphHopper (points: Array, avoidMotorways?: bo const params = { key: graphHopperKey, - vehicle: 'car', + profile: 'car', debug: true, - type: 'json', - profile: '' + type: 'json' } if (followRail) { - delete params.vehicle // vehicle is not supported in current open rail router version params.profile = 'all_tracks' // this can be changed to return better results if needed } const locations = points.map(p => (`point=${p.lat},${p.lng}`)).join('&') @@ -281,7 +279,7 @@ export function routeWithGraphHopper (points: Array, avoidMotorways?: bo }, debug: params.debug, points: points.map(p => [p.lng, p.lat]), - profile: params.vehicle + profile: params.profile }), headers: { 'Content-Type': 'application/json'