简体   繁体   English

如何获取谷歌地图中两个位置之间的总旅行时间?

[英]How to get total travel time between two location in google map?

I implement to get distance between two location in google map in android but i have not idea how to get travel time for this two location ? 我实现了要在android中的Google地图中获取两个位置之间的距离,但是我不知道如何获取这两个位置的旅行时间? I refer many example but i can not understand. 我提到很多例子,但我听不懂。 Give me example 给我举个例子

You can get travel time from [Google Direction API] - 您可以从[Google Direction API]中获取旅行时间-

Link: https://developers.google.com/maps/documentation/directions/start#sample-request 链接: https//developers.google.com/maps/documentation/directions/start#sample-request

Provide your origin & destination in the URL and you'll get a JSON Response. 在URL中提供您的出发地和目的地,您将获得JSON响应。

You can then find travel time in the response as: 然后,您可以在响应中找到旅行时间,如下所示:

routes(JSONArray) -> legs(JSONArray) -> duration(JSONObject) 路线(JSONArray)->腿(JSONArray)->持续时间(JSONObject)

Reference Link: https://developers.google.com/maps/documentation/directions/intro#DirectionsRequests 参考链接: https : //developers.google.com/maps/documentation/directions/intro#DirectionsRequests

暂无
暂无

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

相关问题 如何获取Android上Google地图上两个位置之间的旅行时间? - How can I get travel time between two location on google map in android? 如何获得两个位置之间的总距离和持续时间以及谷歌地图中的航点 - how to get total distance and duration between two location along with waypoint in google map Google Map Android API V2中两个位置之间的行驶距离和行驶时间 - Driving distance and travel time duration between two locations in Google Map Android API V2 Google Map Android API V2中两个位置之间的旅行时间 - travel time between two locations in Google Map Android API V2 使用android studio获取两点之间的旅行时间的问题 - Issues using android studio to get time of travel between two points 如何在Android应用程序中找到在两个地方之间旅行所需的时间 - How to find the time it will take to travel between two places in an android app 如何在另一个活动中获取Google Map实时位置 - How to get google map real time location in another activity 如何在Android的Google地图上获取两点之间的方向? - How get direction between two point on google map in android? 我如何找到我在两个地点之间旅行所需的距离和时间? - How can i find distance and time taken by me to travel between two locations? Android地图:如何处理获取当前位置之间的顺序并计算两个位置之间的距离 - Android map: How to process the order between get current location and calculate the distance between two locations
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM