使用平均交通状况来映射路线

时间:2018-10-24 12:27:11

标签: here-api

早上好。我正在尝试获取地图,以根据美国东部标准时间周一上午11:00的平均交通状况显示路线。我可以通过将以下内容附加到服务URL来实现calculateRoute服务:

scalaz-analytics

我用它来收集转弯指示的转弯方向,但是我也希望地图上的可视路线也能反映出这一点。我对JS非常陌生,因此请原谅我的代码,我主要使用罐装演示脚本并对它们进行了修改,以完成所需的工作。以下是我的地图的代码。该代码的确也使用PHP,但主要用于SQL数据和获取GET数据。

&depart=".date('Y-m-d', strtotime('monday this week'))."T11:00:00-05

1 个答案:

答案 0 :(得分:2)

您只需在上述共享javascript代码中使用的routingParameters中添加离开参数

var routingParameters = {
// The routing mode:
'mode': 'fastest;truck;traffic:enabled',
'waypoint0': 'geo!<?PHP echo $_GET['shipFrom']; ?>',

// The end point of the route:
'waypoint1': 'geo!<?PHP echo $geoCode; ?>',

// To retrieve the shape of the route we choose the route
// representation mode 'display'
'representation': 'display',

//departure time
'departure' : '2018-10-22T11:00:00-05'
};