I want to draw a route using google api please suggest me i开发者_如何学Cs there any google api is available for drawing route between 2 latitude and Longitude.
NSString * urlString = nil;
urlString = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",12.58, 77.35, [NSString stringWithFormat:@"%@,%@,%@",[detailInfoDict valueForKey:@"address"],[detailInfoDict valueForKey:@"city"],[detailInfoDict valueForKey:@"state"]]];
urlString = [urlString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]]
You can do using this way as well. Step 1: Add this Frameworks
Step 2: Imports these files into your View Controllers .h file
Step 3: Provide 2 Location's latitude and longitude in ViewControllers' .m file
OutPut:You will get output like this
精彩评论