步行、自行车和公共交通路线以及每种方式所需的时间,iPhone

发布于 2024-12-07 21:29:02 字数 272 浏览 0 评论 0原文

我正在使用以下网址来获取两个位置之间的行车路线。

 NSString* apiUrlStr = [NSString stringWithFormat:@"http://maps.google.com/maps?output=dragdir&saddr=%@&daddr=%@", saddr, daddr];

需要对上述查询进行哪些更改才能获取自行车、步行或公共交通的路线以及两地之间相应的距离和所需时间?

预先感谢您的任何帮助。

I am using following url to get driving directions between two locations.

 NSString* apiUrlStr = [NSString stringWithFormat:@"http://maps.google.com/maps?output=dragdir&saddr=%@&daddr=%@", saddr, daddr];

What changes need to be done in above query to get directions for bicycle, walking or public transport and corresponding distance, time required between two places?

Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伴我心暖 2024-12-14 21:29:02

您必须使用“dirflg=?”参数,其中“?”可以是:

dirflg Route type.
dirflg=h Switches on "Avoid Highways" route finding mode.
dirflg=t Switches on "Avoid Tolls" route finding mode.
dirflg=r Switches on "Public Transit" - only works in some areas. Can also set date and time info described below.
dirflg=w Switches to walking directions - still in beta.
dirflg=b Switches to biking directions - only works in some areas and still in beta.

还有许多其他可用参数,请阅读 Google 地图参数 文档,但当然不是全部其中的地图原生 API 支持(在每个 iOS 版本中都会更新)。您可以按照 官方 Apple 文档< /a> 并不总是具有最新的所有功能。

You must use the "dirflg=?" parameter, where "?" can be:

dirflg Route type.
dirflg=h Switches on "Avoid Highways" route finding mode.
dirflg=t Switches on "Avoid Tolls" route finding mode.
dirflg=r Switches on "Public Transit" - only works in some areas. Can also set date and time info described below.
dirflg=w Switches to walking directions - still in beta.
dirflg=b Switches to biking directions - only works in some areas and still in beta.

There are many other params available, read the Google Maps Parameters doc, but of course not all of them are supported by the Maps native API (which is updated at every iOS release). Is up to you to test them as the official Apple doc is not always up to date with all features.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文