HERE Routing API V8:如何通过多次通过航点获取路线 [英] HERE Routing API V8: How to get route with multiple pass through waypoints

查看:120
本文介绍了HERE Routing API V8:如何通过多次通过航点获取路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在v7中,这是获取具有多个直通航路点的路线的方法:

In v7, this is the way of getting route with multiple passthrough waypoints:

在v8 api参考中,似乎有一个"via"被用于在航路点上停留.

In v8 api reference, there's "via" which seems to be used for stop over waypoints.

我尝试了它会在路线中生成2条航段(在v8定义中为"section").我希望有一条腿.

It's generating 2 legs ("section" in v8 definition) in the route. I'm expecting 1 leg.

v8开发人员指南页提到了passThrough :

This v8 developer guide page mentioned passThrough:

航路点可能代表中途停留点(即,在重走路线之前将花费一些时间的点),或者仅影响路线形状但未进行实际停靠的直通点.

Waypoints may represent stopover points (that is, points where some time will be spent before retaking the route), or passthrough points that only influence the route's shape, but where no actual stop is carried out.

但是我无法弄清楚如何在v8中查询具有多个通过点的路线.

But I wasn't able to figure out how to query a route with multiple pass through points in v8.

有什么建议吗?

谢谢!

推荐答案

解决此类问题的替代选项,您可以发送两个请求.

Alternative option to solve this type of problem you can sent the two request.

例如:A-> B B-> C 您像这样传递请求

For example : A-->B B-->C You pass the request like this

第一个请求A-> B

First request A-->B

https://router.hereapi.com/v8/routes?transportMode=pedestrian&return=summary,polyline,actions,instructions&origin=42.353514,-71.126775;42.365181,-71.102086&destination=42.365181,-71.102086

第二个请求B-> C

Second request B-->C

https://router.hereapi.com/v8/routes?transportMode=pedestrian&return=summary,polyline,actions,instructions&origin=42.365181,-71.102086&destination=42.360273,-71.091979
enter code here

现在将两者的结果相加,您将获得所需的距离和时间.

Now add the result of both, you will get the desired distance and time.

这篇关于HERE Routing API V8:如何通过多次通过航点获取路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆