【发布时间】:2011-07-09 18:18:29
【问题描述】:
我的注释上有一个按钮,如下所示调用谷歌地图。 我正在尝试将一条路线从我已知的当前位置映射到从注释记录传递的目标位置。
当前位置无法在谷歌地图中被识别,而是建议一个随机的地方,例如 Current, Dent, Missouri。
- (IBAction)GoogleMap
{
NSString *mapAddress = [NSString stringWithFormat:@"%@, %@, %@, %@",location.address, location.city, location.state, location.zipcode];
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=Current+Location&daddr=%@",
// 40.7406578, -74.0020894, test coordinates
[mapAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
知道我在哪里出错了吗?这不应该吗?谢谢。
【问题讨论】:
标签: iphone ios4 google-maps nsurl