我使用这个代码打开地图应用程序
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];