调用默认的google地图应用显示公交路线

在stackoverflow找到了解决方法:http://stackoverflow.com/questions/1563880/launch-google-maps-app-from-iphone-application
CLLocationCoordinate2D stationLocation = ...

NSString *urlString = [[NSString alloc]
     initWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f&dirfl=d",
        curLocation.latitude,
        curLocation.longitude,
        stationLocation.latitude,
        stationLocation.longitude];

NSURL *aURL = [NSURL URLWithString:urlString];
[urlString release];
[[UIApplication sharedApplication] openURL:aURL];

google map的参数说明文档:Google Map Parameters

http://www.cocoachina.com/bbs/read.php?tid=80680

原文地址:https://www.cnblogs.com/likwo/p/2843745.html