[英]duration_in_traffic is not returned in Google Maps
I m trying to execute url query but have no results about duration in traffic . 我正在尝试执行url查询,但没有有关流量持续时间的结果 。
https://maps.googleapis.com/maps/api/distancematrix/json?origins=garching&destinations=hamburg&departure_time=now&api_key=my_api_key https://maps.googleapis.com/maps/api/distancematrix/json?origins=garching&destinations=hamburg&departure_time=now&api_key=my_api_key
The results of query listed below: 查询结果如下:
{
"destination_addresses" : [ "Гамбург, Германия" ],
"origin_addresses" : [ "85748 Гархинг, Германия" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "761 км",
"value" : 761011
},
"duration" : {
"text" : "7 ч. 17 мин.",
"value" : 26216
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
The result does not contain duration_in_traffic
. 结果不包含
duration_in_traffic
。 Why? 为什么?
The duration_in_traffic
result is only returned where traffic data is available, when a departure_time
is specified. 仅当指定了
departure_time
duration_in_traffic
,才返回duration_in_traffic
结果。
https://developers.google.com/maps/documentation/javascript/distancematrix
https://developers.google.com/maps/documentation/javascript/distancematrix
It seems no traffic data is available for that destination/origin. 似乎该目的地/原点没有流量数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.