gpt4 book ai didi

android - 是否可以使用谷歌地图或其他应用程序绘制坐标路径并在它们之间导航?

转载 作者:行者123 更新时间:2023-11-29 16:46:48 24 4
gpt4 key购买 nike

这是一个简单的问题。

我知道可以请求导航到特定位置,如图所示 here .

我知道 Google map 还有其他一些 API(herehere),但我没有看到发送多个坐标、查看它们之间的路径以及在它们之间导航的选项。

对于 Web 版本,有航路点的功能(例如 herehere ),但不适用于 Android。

是否可以通过 Google map 或其他应用来实现?

或者甚至在 Google Maps API 中(在当前应用程序中)?

最佳答案

自 V3 Google Maps Directions API最多支持 23 waypoints (不包括起点和终点)计算路线时:

https://maps.googleapis.com/maps/api/directions/json?origin=sydney,au&destination=perth,au&waypoints=via:-37.81223%2C144.96254%7Cvia:-34.92788%2C138.60008&key=YOUR_API_KEY

因此,您最多可以绘制 23 个点的多段线,并根据请求发送它们的坐标。

更新:请看this教程。

更新 2:

通过 Kiryat Malakhi、Beit+Guvrin 和 geopoint (31.696342, 35.011337) 通过 Intent 打开特拉维夫到耶路撒冷路线的 Google map 应用程序导航模式示例:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("https://www.google.com/maps/dir/?api=1&" +
"origin=3780+St+1,+Tel-Aviv+Yafo,+Israel&destination=Jerusalem,+Israel&travelmode=driving" +
"&waypoints=Kiryat+Malakhi,+Israel%7CBeit+Guvrin,+Israel%7C31.696342, 35.011337"));
startActivity(intent);

结果:

Waypoints for Google Maps App example

参数详情here .

关于android - 是否可以使用谷歌地图或其他应用程序绘制坐标路径并在它们之间导航?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47690024/

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