2011-07-18 35 views
0

在我的应用程序,按钮单击我打开默认的iPhone地图应用如下: -iPhone默认的地图应用程序与当前用户位置开放

NSString *mystr=[[NSString alloc] initWithFormat:@"http://maps.google.com/maps?saddr=%@&daddr=%@",userlocation,desti_latlong]; 
NSURL *myurl=[[NSURL alloc] initWithString:mystr]; 
[[UIApplication sharedApplication] openURL:myurl]; 

在这种desti_latlong为目标经纬度的字符串和用户位置是用户的经纬度由corelocation(位置管理器)找到的字符串。

但我想在此API上添加源位置作为“当前位置”字符串。 如果我们直接使用Iphone defualt地图应用程序,我们可以给出当前位置,它将以蓝色字符串弹出我可以从我的应用程序中这样做,以便如果用户移动地图上更新的位置。

thanx任何帮助!

回答

1

喔是的,我正在写直接当前的位置,但我需要写电流+ Location.solved是

NSString *mystr=[[NSString alloc] initWithFormat:@"http://maps.google.com/maps?saddr=Current+Location&daddr=Destination"]; 
NSURL *myurl=[[NSURL alloc] initWithString:mystr]; 
[[UIApplication sharedApplication] openURL:myurl]; 
相关问题