google-maps - 如何使用意图打开谷歌地图导航并将折线作为参数而不是开始和结束位置
问题描述
我有需要通过已经定义的路线导航的用例,我有一条折线或一组路线的纬度,但是在 URI 中用于谷歌地图意图我找不到通过折线纬度进行导航的方法,请检查并更新是否有任何可能的解决方案或破解
String uri = "https://www.google.com/maps/dir/?api=1&destination=" + dest + "&source=" + source + "&travelmode=driving&dir_action=navigate";
List<LatLng> stopOvers = getAllStopOvers();
if(stopOvers.size() > 2){
StringBuilder wayPointsString = new StringBuilder("&waypoints=");
for (LatLng stopOver : stopOvers) {
wayPointsString.append(stopOver.latitude);
wayPointsString.append(",");
wayPointsString.append(stopOver.longitude);
wayPointsString.append("|");
}
uri = uri + wayPointsString.toString();
}
解决方案
推荐阅读
- c# - a* (astar) 寻路问题:我无法从其他脚本中引用变量以确定 aipath 目标
- java - 如何为 BST 节点创建构造函数?
- php - 如何替换 file_get_contents 中的变量以使用 PHP 生成 css 文件?
- python - 在 Pandas 中计算牛市/熊市
- postgresql - 如何从 PL/lpgSQL 函数内部获取记录(行)的 jsonb 数组的键和值
- php - Laravel 水平队列作业因 MaxAttemptsExceededException 而失败
- c# - 如何将 Bouncy Castle X509Crl C# 中的 CRL 编号解析为 BigInteger
- hl7-fhir - 如何在不同元素之间使用“或”运算符?
- javascript - 我正在发出抢劫命令,但我不知道如何让它在失败时激活超时或从人身上减去硬币
- matrix - 正交 procrustes 的奇怪行为