每种模式下的步行,自行车和公共交通路线以及所需时间,iPhone [英] Walking, bicycle and public transport directions with time required in each mode , iPhone

查看:61
本文介绍了每种模式下的步行,自行车和公共交通路线以及所需时间,iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

在此先感谢您的帮助.

推荐答案

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

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.

还有许多其他可用的参数,请阅读 Google地图参数文档,但当然不是全部其中的一些受Maps本机API支持(在每个iOS版本中都会更新).您可以根据官方Apple文档并非总是具有所有功能的最新信息.

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.

这篇关于每种模式下的步行,自行车和公共交通路线以及所需时间,iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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