Question: I'm looking to develop/obtain a simple GMaps app for my site that lets the user plot two points and get the distance between the two.

Here is an app that would be perfect for me.
<http://www.daftlogic.com/projects-google-maps-distance-calculator.htm>

I suppose "as the crow flies" could suffice but "suggested route" measurements would be great if possible and too time consuming.

Does anybody know if there is something like this available for download? Also, would it be difficult/time consuming to dev this from scratch?

unfortunately it's only a small piece of a much larger projecet so I won't be able to spend too much time on it.

Any advice greatly appreciated.

Thanks,
Conor

Answer: 
Since Google Maps uses latitude and longitude, you have to do a conversion to your preferred measure system to get the distance as the crow flies.

[Here's one that uses kilometers](http://www.movable-type.co.uk/scripts/latlong.html);

```
var R = 6371; // km
var dLat = (lat2-lat1).toRad();
var dLon = (lon2-lon1).toRad(); 
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
        Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) * 
        Math.sin(dLon/2) * Math.sin(dLon/2); 
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); 
var d = R * c;

```

However, from the Google Maps v2 API you can get directional data from routes. Look into [GDirections](http://code.google.com/intl/sv-SE/apis/maps/documentation/reference.html#GDirections) for the API reference. I've used it in one project, and it works fine.
You could as well this MeasureTool for Google Maps 

<https://github.com/zhenyanghua/MeasureTool-GoogleMaps-V3>

For example, reference the `geometry` library and then `var measureTool = new MeasureTool(map);`.

Here is a live [demo](http://zhenyanghua.github.io/google-maps/measure-tool/)