I will try to be as precise as possible in the description of my problem.
I have a Google Maps API V3 script that correctly calculates the distance between two locations