从我的应用程序单击按钮时,是否可以更改旅行模式Google地图以请求android上的“骑行”标签?

android - 谷歌 map 旅行模式:要求乘车-LMLPHP

我用了 :

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

最佳答案

似乎(请求乘车->出租车)并且:

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);


得到这样的结果:

android - 谷歌 map 旅行模式:要求乘车-LMLPHP

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

10-07 22:09