- turn_costs: vehicleType === "car",
- point: points.map(p => p.lat + "," + p.lng)
- };
- return $.ajax({
- url: OSM.GRAPHHOPPER_URL,
- data,
- traditional: true,
- dataType: "json",
- success: function ({ paths }) {
- if (!paths || paths.length === 0) {
- return callback(true);
- }
- callback(false, _processDirections(paths[0]));
- },
- error: function () {
- callback(true);
- }