Reputation: 7345
I'm looking for an easy way to find out the distances in miles (as the crow flies) between multiple cities.
Example (New York):
New York, NY - Tampa, FL New York, NY - Las Vegas, NV New York, NY - Moscow, Russia etc
I have over 20 cities that I need to determine the distance between... That's a lot of looking up to do manually (not just between the main city and other cities but between every city and every city)...
Any ideas?
Upvotes: 0
Views: 1891
Reputation: 8819
Once you get the latitude/longitude from the Google Maps API geocoder, you can use the Geometry library to calculate the distances between them.
http://code.google.com/apis/maps/documentation/javascript/geocoding.html http://code.google.com/apis/maps/documentation/javascript/geometry.html#Distance
Upvotes: 1
Reputation: 8575
The Google Maps API might help you get the Latitude and Longitude of each, then you could use an algorithm (like http://www.movable-type.co.uk/scripts/latlong.html) to calculate the distances.
Upvotes: 0