繁体   English   中英

iPhone 默认 map 应用程序以当前用户位置打开

[英]iPhone default map app open with current userlocation

在我的应用程序中,单击按钮时,我将打开默认的 iphone map 应用程序,如下所示:-

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 是目标纬度经度字符串,userlocation 是corelocation(位置管理器)找到的用户纬度经度字符串。

但我想在这个 API 上添加源位置作为“当前位置”字符串。 如果我们直接使用 Iphone 默认 map 应用程序,我们可以提供当前位置,它将以蓝色字符串弹出我可以从我的应用程序中进行此操作,以便如果用户移动在 map 上更新的位置。

感谢任何帮助!

哦,是的,我直接写 Current Location 但我需要写 Current+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];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM