博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

在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

posted on 2013-01-04 10:23  Likwo  阅读(805)  评论(0编辑  收藏  举报