Very simple question. I'm trying to pass to the directions API to give preference to the nearest destination to the origin. E.G. : Origin : Heleman Halls (In utah) Dest : Chic fil a
When I try this specific example Maps API it selects a chic fil a that is out of state and is 17 hours away.
My SDK is node.
I've checked the documentation and haven't found anything referencing to setting the default destination to be the nearest to the origin. I know I can be more specific in my API requests (like specifying which city the dest is) but it completely defeats the purpose of my implementation.
function getMapsData(userOrigin, userDest) {
googleMapsClient.directions(
{
origin: userOrigin,
destination: userDest
},
function(err, response) {
if (!err) {
// return response;
console.log("Got the maps data");
formatMapsData(response.json.routes[0].legs[0]);
}
}
);
}
I expect it to return just a few steps as there's a chic fil a just down the road, but instead it returns a chic fil a thats 17 hours away.