我目前正在使用 Routing v7 API 并希望迁移到 v8。对于我的用例,我需要一个按国家/地区分隔的分支列表,如路由 API 的 V7 中所示。
有没有一种方法可以像在 v7 中那样获得按国家/地区划分的查询摘要响应?
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey=xxx&jsonattributes=9&mode=balanced;truck;traffic:disabled&representation=overview&return=summary,&routeattributes=sc&truckType=truck&waypoint0=53.07537,8.80453&waypoint1=50.54226,9.75617
这将返回旅行时间、距离、交通时间、国家代码、收费公路距离等信息,按国家/地区划分
cut...
""summaryByCountry": [
{
"distance": 343077,
"trafficTime": 15125,
"baseTime": 14912,
"flags": [
"tollroad",
"tunnel",
"motorway",
"builtUpArea"
],
"text": "The trip takes <span class=\"length\">343 km</span> and <span class=\"time\">4:09 h</span>.",
"travelTime": 14912,
"country": "NLD",
"tollRoadDistance": 341716,
"_type": "RouteSummaryByCountryType"
},
{
"distance": 169622,
"trafficTime": 9080,
"baseTime": 9080,
"flags": [
"tollroad",
"motorway",
"builtUpArea"
],
"text": "The trip takes <span class=\"length\">170 km</span> and <span class=\"time\">2:31 h</span>.",
"travelTime": 9080,
"country": "BEL",
"tollRoadDistance": 152117,
"_type": "RouteSummaryByCountryType"
},
...cut
谢谢!