## Google Maps API Tutorial© 2006, 2007, 2009 Mike Williams |

Translate this page: |

## DistancesThe API provides a function that calculates the straight line distance between two points.
To use it to calculate the distance in metres between two GLatLng objects, we write That returns a number with the maximum number of decimal places that your Javascript interpreter supports, which is somewhat excessive so you might want to use the .toFixed(N) method to round the result to N decimal places.
Here's an
For the |