views:

1435

answers:

1

is there a way to use core location or google or some other api to provide two points on the map and get the resulting set of latitude/longitude pairs for the route?

i have seen in this tutorial Drawing polyines or routes on a MKMapView that how to draw driving direction using core graphics...but in the sample code it has route.csv which has predefined set of longitudes and latitudes.....how do i make pair of longitudes and latitudes so that i can draw driving directions.

A: 

Companies invest millions of dollars into developing routing algorithms, so I very much doubt that you'll be able to get it for free anywhere (I'm happy to be wrong, though). For example, the Google Maps JavaScript API supports routing, so I guess you could hack that up. The results wouldn't be fast or pretty, mind you.

iKenndac
have you seen the above link?i want to do it through objective-c
Rahul Vyas
Yes, I saw the link. Like I said, you need to find a service that'll allow you to do this and I'm not aware of any that are free. Microsoft Virtual Earth (aka Bing Maps) has a web service, but as far as I can tell it isn't free (see http://www.microsoft.com/maps/platform/default.aspx). I believe this is a JSON service, so you'll have to create something to communicate with it - which is beyond the scope of this question.
iKenndac