【问题标题】:Google Distance Matrix API Specific Departure TimesGoogle 距离矩阵 API 特定出发时间
【发布时间】:2016-11-30 18:27:42
【问题描述】:

我正在使用 Google 距离矩阵 API。如果有人可以提供帮助,我想知道如何在 JSON 格式的链接中指定出发时间。例如:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=32.547235,-116.992427&destinations=33.7589%2C-118.2385%7C&mode=driving&departure_time=now&traffic_model=optimistic&key={API_KEY}

说,我想从上面链接中的两个坐标得到距离和持续时间@1pm 2pm 3pm 11pm 2016 年 7 月 26 日,出发时间我应该写什么?

非常感谢您,

【问题讨论】:

    标签: javascript google-distancematrix-api


    【解决方案1】:

    在可用的 Google Geo API 下有一个标为“departure_time”的可选参数。您应该尝试一下……它采用 UTC,因此“您可以将时间指定为自 1970 年 1 月 1 日午夜 UTC 以来的整数秒。”

    源代码:https://developers.google.com/maps/documentation/distance-matrix/intro#DistanceMatrixRequests

    编码愉快! :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-27
      相关资源
      最近更新 更多