Android的google.navigation意图模式?意图、模式、Android、google

2023-09-06 11:31:33 作者:↘珂ル°

我目前正在开发,将推出一款导航目的的应用程序。我知道,这不是一个官方的API,但它完美的作品,我希望它的方式。

I'm currently developing an application that will launch a navigation intent. I know that this isn't an official API, but it works perfectly the way I want it to.

我允许用户选择驾车,步行,和公交导航到一个位置。直接启动到谷歌地图导航的目的是这样的:

I allow the user to select driving, walking, and bus navigation to a location. The intent to launch directly into Google Maps Navigation looks like this:

google.navigation:LL = +经度和纬度,然后+ &功放;模式= 那么你的模式运输。例如,要使用的步行方向在一定区域导航

google.navigation:ll= + a latitude and longitude, then + &mode= then your mode of transportation. For example, to navigate using walking directions to a certain area:

google.navigation:LL =胡说,胡说和放大器;模式= W

驾驶是默认,或&功放;模式= D ,和骑自行车是&功放;模式= B ,但我想不通巴士(公交)。

Driving is default, or &mode=d, and biking is &mode=b, but I can't figure out bus (public transit).

有没有人这样做过?

谢谢!

编辑:到目前为止,我发现模式=公共给自行车的方向,模式=中天给驾驶,无奈的是,模式=总线也返回自行车的方向。

So far, I've found that mode=public gives bike directions, mode=transit gives driving, frustratingly, mode=bus also returns bike directions.

更多:模式=火车也给驾驶......我们有了一个方法来做到这一点...

More: mode=train also gives driving... There's GOT to be a way to do this...

另一个编辑:我意识到刚才我是pretty的确保它不存在,因为有方面,我意识到,我应该将推出与谷歌地图的意图试验后公交搜索,但没有人知道如何做到这一点?

Another I realized just now that I'm pretty sure that it doesn't exist, because after experimenting with terms I realized that I should instead launch a Google Maps intent with a bus search, but does anyone know how to do this?

推荐答案

一堆猜测和狩猎左右后,我决定,这是不可能直接启动到公交车的导航,因为这将涉及选择公交车的人骑,这是没有意义的。

After a bunch of guessing and hunting around, I have decided that it is impossible to launch directly to bus navigation, because that would involve CHOOSING a bus for the person to ride, which wouldn't make sense.

相反,你可以将它们发射到谷歌地图搜索,像这样的目标,谢谢这个答案以一个类似的问题:

Instead, you can launch them to a Google Maps search to the destination like so, thank you to this answer to a similar question:

http://maps.google.com/maps?daddr=lat,long&dirflg=r

随着&放大器; dirflag 指定公共交通。 (为什么R我不知道......)

With the &dirflag specifying public transit. (Why the "r" I have no idea...)