Nsstring* versionNum = [[UIDevice currentDevice] systemVersion]; Nsstring *nativeMapScheme = @"maps.apple.com"; if ([versionNum compare:@"6.0" options:NSNumericSearch] == NSOrderedAscending){ nativeMapScheme = @"maps.Google.com"; } Nsstring* url = [Nsstring stringWithFormat:@"http://%@/maps?ll=%f,%f",nativeMapScheme,40.739490,-73.991154]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
看来它的效果很好,但是这个位置上没有引脚.如何添加引脚,我想在请求中有其他参数?
解决方法 如果您希望将引脚放置在Apple的Google Maps应用程序上,请在URL中使用“q”而不是“ll”.你可以这样使用
Nsstring* url = [Nsstring stringWithFormat:@"http://%@/maps?q=%f,-73.991154];总结
以上是内存溢出为你收集整理的使用纬度和经度打开iOS地图全部内容,希望文章能够帮你解决使用纬度和经度打开iOS地图所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)