简体   繁体   English

适用于Android的带有旅行时间的Directions API

[英]Directions API for Android with traveling time

On our website we we plot two points on a map, and the google direction api neatly gives us the traveling time. 在我们的网站上,我们在地图上绘制了两个点,而Google Directions api巧妙地为我们提供了旅行时间。 If we change the from or to address some new calculation are performed, and the new traveling time is displayed on the site. 如果我们更改从或到的地址,则会执行一些新的计算,并且新的旅行时间将显示在站点上。

We are trying to create the same kind of setup in Android, but I see that there is no support for the directions API. 我们正在尝试在Android中创建相同类型的设置,但我发现不支持Directions API。 I have looked at some old examples like this one Drawing a line/path on Google Maps but here there is just a simple line between two points. 我看过一些像这样的旧示例,但在Google Maps上绘制了一条线/路径,但是在两点之间只有一条简单的线。 I do not see anything about the traveling times. 我看不到任何旅行时间。

Another question I stumbled uppon was the following Directions API on Android but I do not see how the connection is made between the Android Maps API and the Google maps direction API. 我偶然遇到的另一个问题是Android上的以下Directions API,但我看不到如何在Android Maps API和Google Maps Direction API之间建立连接。

To draw path you can use this library 要绘制路径,您可以使用

Through this library you can get travel duration between two point. 通过该库,您可以获得两点之间的旅行时间。 now when you move to your destination location you have to calculate your speed and remaining destination distance. 现在,当您移至目标位置时,您必须计算速度和剩余目标距离。 from your speed you can assume you destination reach time. 从您的速度,您可以假设您的目标到达时间。

To calculate your moving speed this link will help you 要计算您的移动速度,此链接将帮助您

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM