使用谷歌地图中的参数逐个开始

时间:2012-01-04 10:34:53

标签: iphone objective-c ios cocoa-touch ios5

我正在使用以下代码打开谷歌地图

UIApplication *app = [UIApplication sharedApplication];
NSString *url = [NSString stringWithFormat:@"http://maps.google.com/maps?ll=%@,%@",Latitude,Longitude];
[app openURL:[NSURL URLWithString:url]]; 

无论如何都要发送一些参数来启动转发imediatly?

1 个答案:

答案 0 :(得分:1)

试试这个......

UIApplication *app = [UIApplication sharedApplication];
NSString *url = [NSString stringWithFormat:@"http://maps.google.co.in/maps?saddr=%f,%f&daddr=%@",userLocation.latitude,userLocation.longitude,address];
[app openURL:[NSURL URLWithString:url]];

此处address可以是任何逻辑地址..例如.. Mumbai,India