Xcode谷歌地图导航 [英] Xcode google map navigation

查看:53
本文介绍了Xcode谷歌地图导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个应用程序,可以将图钉固定在地图上的各个兴趣点上,这些都可以通过iPhone编程完成.

I currently have an application which will drop pins onto various points of interest on a map, all done programmatically on the iPhone.

我现在要完成的目标是允许用户通过调用iPhone上的内置导航工具来导航到该位置并获得转弯指示.

What I am aiming to get done now is to allow a user to navigate to that location and get turn by turn directions by calling up the built in navigation tools on the iPhone.

无论如何,我可以做到这一点吗?我已经在开发人员中心进行了搜索,并且在google和此处都进行了搜索,因此找不到任何相关信息.

Is there anyway that I can do this? I've scoured the developer center and searched both google and here and couldn't find anything about this.

推荐答案

您不得在您的应用中使用 google 路线.唯一的方法是按照以下步骤将它们发送到google maps应用程序:

You're not allowed to use google directions within your app. The only way you can do this is to send them to the google maps application as per:

- (void)getDirections {
    CLLocationCoordinate2D start = { (startLatitude), (startLongitude) };
    CLLocationCoordinate2D end = { (endLatitude), (endLongitude) };

    NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f", start.latitude, start.longitude, end.latitude, end.longitude];

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];

}

这篇关于Xcode谷歌地图导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆