Q:

iOS5: How to calculate shortest car route

I'm building an app that will calculate fuel consumption and I was wondering whats the best way to calculate the shortest car route between two locations. I only need the distance in km or miles, and don't need a map interface.
Thanks in advance

A:

The easiest way for this might be to integrate with the Google Maps API.
See here: https://developers.google.com/maps/documentation/directions/#DirectionsRequests
In summary, you will make a HTTP request to a URL containing your start/end locations, receive back either a JSON or XML which details the route. If all you are interested in is the distance, you can just grab the total distance or time from that easily enough.

