samedi 25 juillet 2020

Showing Restaurants on the basis of driving distance [closed]

I am making a website for restaurants where customers will place order to Restaurants on the basis of restaurants shown to them. When any Restaurant will get registered on my website, it will need to enter its location using google maps autofill api. Restaurant will also specify the distance in KM's within which it can provide Home delivery services to customers.Now when the customer will visit my website and search for restaurants, first of all he will need to enter his location using google autofill api, then only that Restaurants will be shown to customer which can deliver to his location. In other words, if the driving distance (i.e. road distance) between restaurant and customer location is less than or equal to distance specified by the customer (at the time of registration) then only such restaurants will be shown to customer. I have used HAVERSINE formula but it proved wrong as it calculated straight line distance between restaurant and customer location but i want actual road distance between restaurant and customer location. Can anyone help me in this regard. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire