如何在HERE Map API上获取方向折线而不是实线

时间:2013-11-05 01:25:46

标签: javascript api routing polyline here-api

使用HERE Map Javascript API,如何绘制路线结果示例here

所示的方向折线

enter image description here

如果我使用nokia.maps.map.Polyline,如下所示:

map.objects.add(new nokia.maps.map.Polyline(routes[0].shape));

我得到以下内容:

enter image description here

我在polyline上找不到改变其风格的方法。

1 个答案:

答案 0 :(得分:3)

您需要创建指定arrows属性的Polyline,例如

polyline = new nokia.maps.map.Polyline(routes[0].shape,{
    pen: {
        strokeColor: "#22CA", 
        lineWidth: 5
        },
    arrows : true
});

您还可以在创建后使用arrows方法添加set()

polyline.set("arrows", true);