Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
unfiltered-syrup committed Nov 26, 2023
1 parent 8ad37c2 commit 786837b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions back-end/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ function findAllReachableStops(graph, origin, threshold=0.013) {
return reachableStops;

}

// return walking distance from point A to point B
async function getWalkingDistance(origin, destination) {
origin = origin.split(',').join('%2C');
destination = destination.split(',').join('%2C');
let res = await fetch(`https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=${origin}&destinations=${destination}&key=${process.env.EXPRESS_APP_MAP_API_KEY}`)
let data = await res.json();
res = data.rows[0].elements[0].duration.value;
let originName = data.origin_addresses[0];
let destinationName = data.destination_addresses[0];
return res;
}

Expand Down

0 comments on commit 786837b

Please sign in to comment.