1
我在我的注释中有一个按钮,其按如下所示调用Google地图。 我正在尝试将我的已知当前位置的路线映射到从注释记录传递的目标位置。将当前位置映射到googleMaps中的目标位置
当前位置无法在谷歌地图中被识别,而是建议一个随机的地方,如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上正常工作,但不是在iPad上。 – Jeremy