gpt4 book ai didi

android - 谷歌地图 旅行模式 : request a ride

转载 作者:行者123 更新时间:2023-11-30 00:00:55 25 4
gpt4 key购买 nike

当从我的应用程序点击按钮时,是否可以更改旅行模式谷歌地图以在 Android 上请求乘车选项卡?

enter image description here

我用过:

Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?daddr="+ mLocation.latitude + ","+ mLocation.longitude +"&f=d&dirflg=r"));
startActivity(intent);

但参数 dirflg 仅限于:

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.
dirflg=w - Switches to walking directions - still in beta.
dirflg=d - Switches to driving directions

最佳答案

似乎(叫车 -> taXi)并且:

dirflg=x - Switches on "request a ride tab" - only works in some areas.

并且您可以像这样对请求使用 Intent :

Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=-7.328306+112.715478&daddr=Jl.+Frontage+Ahmad+Yani+Siwalankerto&dirflg=x"));
startActivity(intent);

得到这样的结果:

Request a ride (taXi) tab

(将 -7.328306+112.71547 替换为 mLocation.latitude + "+"+ mLocation.longitude 请求中的 LatLng)

关于android - 谷歌地图 旅行模式 : request a ride,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49945036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com