在这里,可以使用包围盒数组作为参数来避免特定区域的出现,例如:

function calculateRoute(platform) {
  var router = platform.getEnterpriseRoutingService(),
    parameters = {
      waypoint0: '50.0522,8.2180',
      waypoint1: '50.0957,8.5280',
      mode: 'fastest;truck',
      avoidareas: '50.1062,8.2811;50.0180,8.4253'};

  router.calculateRoute(parameters,
    function (result) {
      alert(result);
    }, function (error) {
      alert(error);
    });
}


您可以在以下文档中找到此代码:
https://developer.here.com/api-explorer/rest/routing/route-avoiding-a-specified-area

我正在尝试找到将避免区域指定为一层的方法,但是我在文档中没有找到任何内容。有人知道这是否可能吗?

注意:可以使用自定义位置扩展名将图层上传到此处的地图中,然后可以将其作为ID检索。

最佳答案

您需要的是“定制路由扩展”(developer.here.com/documentation/custom-routing-extension/topics/quick-start-block-a-road.html)。您可以上传覆盖图以避免特定区域。编码愉快!

关于javascript - 使用自定义位置扩展层避开指定区域,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52255012/

10-14 21:00
查看更多