2013-11-05 45 views
1

使用HERE地圖的JavaScript API,我怎麼畫定向折線的路由結果例如here我如何獲得HERE地圖API,而不是實線

enter image description here

如果我使用nokia.maps.map.Polyline如出了定向折線如圖所示:

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

我得到如下:

enter image description here

我在polyline上找不到方法來更改其樣式。

回答

2

您將需要創建指定arrows屬性的Polyline,例如,

polyline.set("arrows", true); 

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

您也可以在創建後使用set()方法添加arrows

相關問題