Hi, I am looking for some customisation work on a plugin. Currently the plugin uses Google directions API and converts for some reason the distance from google maps doesn't match the distance in the maps on the website.
I checked with google support, the following is the response. I am looking for someone who is capable of fixing this code in PHP
After chekcing the requests made, we have identified why you get the undesired results for the mentioned Distance Matrix requests.
I'll explain. When you select a prediction result, your site makes a Place Details request to get the data for the place entered in Destination and Origins. This works OK. The issue happens when from that point your site makes a Distance Matrix request. What is happening is that your site takes the results from the place/address and uses origins/destinations based on the coordinates of the Places Details request (origin=-33.8442616,150.9928077&destination=-33.8567844,151.2152967).
The correct way is to use the Place IDs or the address instead of coordinates for the Distance Matrix requests, as these are not 100% accurate and are sending you to an invalid destination