I have worked with Google maps before, but when I implemented it, I never found documentation on how to get the exact distance between two given locations via Javascript or PHP.
1) It should be the same distance shown on the maps, and not the formula that gives you the straight line distance from one geo-section to another.
2) It must be either PHP or Javascript
3) It should be Google maps, and not virtual land or something like that.
The best I came up with is to send an HTTP_GET request to Google maps using a long URL with variables, which then returns 200 and HTML code for the website. The distance is somewhere there, just need to filter.
But these resources are intense and heavy.
Does anyone know a better way?
EDIT: this is the function I'm talking about. The DLL is not included in the regular zip file for Windows, I found it as part of the WAMPserver software.
source
share