Shortest route between multiple points in mapkit for iphone app
In my application suppose user selects 4 cities to vist with S as starting city and D as destination city then is there any API or webservice for this .
Here the users visits the city开发者_如何学JAVA one time only and the output should be the shortest path between A and D by covering all the cities. If somebody has any other idea it is also welcomed.
Thanks and Regards Mrugen
Mapquest has recently really taken the lead in terms of navigation and geocoding APIs. FAR better than Google's offering, IMO. They're hosting OpenStreetMap data and an excellent (and wide open) interface to it. No access keys, no restrictions, just bang, DATA.
Here's the URL to their directions API. Short version is, provide two lat/lng points (which they also have an interface to look up from a street address or other landmark) and it'll give turn by turn directions.
http://open.mapquestapi.com/directions/
firstly u should konw city"s latitude and longtitude and u use code
CLLocationCoordinate2D start = {43.759063, -79.236128};
NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=%@,%@&saddr=%f,%f",mi.memberyLat,mi.memberLong,start.latitude ,start.longitude];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: urlString]];
in this code mi.memberyLat means u pass city latitude mi.memberLong means u pass city long.
精彩评论