android - 如何在步行模式下打开谷歌地图

标签 android google-maps android-intent android-activity

如何以步行模式启动 Google map 到达目的地?我知道如何在导航模式下打开。我还没有找到在普通步行模式下打开它的方法

最佳答案

您必须添加 mode 参数作为路线请求的一部分。 mode 是可选的请求参数之一,用于指定计算方向时使用的交通方式。如果未指定模式,Google Maps Embed API 将为指定路线显示一种或多种最相关的模式。

下面是一个方向请求示例,它返回从印第安纳波利斯到芝加哥的步行方向。如果参数 &mode=walking 被移除,请求将返回与最相关模式相关的方向。

https://www.google.com/maps/embed/v1/directions?key=[YOUR API KEY]&origin=indianapolis&destination=chicago&avoid=tolls|highways&mode=walking

引用: https://developers.google.com/maps/documentation/embed/guide

关于android - 如何在步行模式下打开谷歌地图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34344312/

相关文章:

java - 无法解析 makeToast

android - 为 GridView 飞入动画

android - 为什么 Intent 总是使用 FLAG_ACTIVITY_FORWARD_RESULT 和 FLAG_ACTIVITY_PREVIOUS_IS_TOP?

android - 如何在 Linux mint 中更新 Android Studio?错误: Studio does not have write access to/app/extra. 请以特权用户运行更新

android - 我可以以编程方式重命名可移动 SD 卡上的文件吗

java - 在 SupportMapFragment Java Android Studio 中使用 getMap() 的替代方法

javascript - 从 map 中的点坐标查找具有名称的谷歌地图地点

google-maps - Grails-从lat,lang找到位置

android - 管理 Android 中的 Activity 并防止大型 Activity 堆栈

javascript - 对第 3 方 SDK Intent 调用 startActivityForResult 时出错