AnikeshSingh Not planned that for future updates.
But the logic is pretty straightforward if you always track the delivery guys location. (Not possible on webapp - possible if you build your own native android delivery app to get the delivery guy live location - as webapp will not share GPS data when phone is locked or browser is minimised)
So, you will need to get the location of each delivery guy and the restaurant from which the order was placed and pass the latitude and longitude to the distance calculation function (already available on Foodomaa code)
This will give you distance in km/miles/meters as you wish for and then sort the nearest one from the array.
After that you also might want to check if the delivery guy that is nearest is currently on the route of completing the order or going to pickup from a restaurant or a different restaurant. (As per your business operation optimization techniques)
And then select the best candidate/delivery guy and assign the order to them.
Note: the Distance Calculation function that I referred earlier calculates the distance from one point to another on earth surface and doesn't takes the accurate driving distance like what Google API Provides.
Example: if there is a river between the delivery guy and the restaurant, the Foodomaa formula might give you 0.2km, but Google APIs would give you 4km (because you need to follow the road to cross the river)
Now if you use Google APIs for calculating the exact match for the delivery guys, and if you have 10 delivery guys, then you will be making 10API calls for each order to assign to the delivery guy.
P.S if you have exhausted the $200/m free quota for Google APIs then Google Distance Matrix API will cost you $5/1000 api calls.
So for 200 orders per day if you have 10 delivery guys, your cost for API just to assign delivery guys is $10/day (which seems ok. I thought it would be much larger number)
This is for general scenario without any caching, with some kind of advanced caching and optimizations the cost can be reduced.