javascript - 如何在 HERE Map API 上获取方向多段线而不是实线

标签 javascript api routes 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 上找不到改变其样式的方法。

最佳答案

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

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

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

polyline.set("arrows", true);

关于javascript - 如何在 HERE Map API 上获取方向多段线而不是实线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19780453/

相关文章:

javascript - 使用特定颜色创建指向 Google 日历的 HTML 链接

javascript - AngularJS 中指令(和其他部分)之间的通信

ruby-on-rails - 使用 Rails 构建私有(private) API

ruby-on-rails - 在不重定向的情况下在 Rails Controller 中发出警报

javascript - 如何突出显示任意数量的(可能重复的)A,后跟非贪婪匹配器,然后是任意数量的 B 等(没有不合理的限制)?

javascript - 我如何用 Backbone MVC 表达数据依赖?

python - Google BigQuery API,如何设置destinationTable的字段类型?

c# - 创建对象与直接从数据库中选择

scala - 分页 Play 路线的最佳做法?

ruby-on-rails - 路由文件中的 "map.resource"到底是做什么的?