小编jur*_*cix的帖子

HERE 地图 javascript API 多个路径点

我正在使用 Here 地图 Javascript API。如何以编程方式添加多个航路点?我试过这个:

  var via = new Array();
  var len = waypoints.length-1;
  for(var i = 1; i < waypoints.length-1; i++){
   via.push("waypoint" + i + ":" + waypoints[i][0] + "," + waypoints[i][1] + ",");
   //console.log(waypnts);
  }
  console.log(via);
   var router = platform.getRoutingService(),
routeRequestParams = {
  mode: 'fastest;truck;',
  grossWeight: '40',
  height: '4.0',
  width: '2.55',
  length: '18.25',
  axleCount: '5',
  excludecountries: 'CHE',
  representation: 'display',
  alternatives: '3',
  routeattributes : 'waypoints,summary,legs',
  maneuverattributes: 'direction,action',
  //RouteRepresentationModeType:'dragNDrop',
  start:waypoints[0][0] + "," + waypoints[0][1],

  destination:waypoints[len][0] + "," + waypoints[len][1]
}; …
Run Code Online (Sandbox Code Playgroud)

javascript here-api

3
推荐指数
1
解决办法
1043
查看次数

标签 统计

here-api ×1

javascript ×1