要画多条收尾不相连的线段,目前按照官方文档,会把多条线段收尾相连,这不符合预期。请问如何设置?
举例:
根据文档中https://uniapp.dcloud.io/component/map设置了
let polylines1 = {
width: width,
color: this.colorlist[Math.floor(Math.random()*10)],
arrowLine: true,
arrowIconPath: "../../static/lineTwo.png",
points: newData1,
};
this.polylines.push(polylines1);
let polylines2 = {
width: width,
color: this.colorlist[Math.floor(Math.random()*10)],
arrowLine: true,
arrowIconPath: "../../static/lineTwo.png",
points: newData2,
};
this.polylines.push(polylines2);
即使按照这种方式设置之后,存储经纬度的newData1和存储经纬度newData2的两条线会被收尾相连,形成一条线,我们预期希望是两条线,收尾不相连的。
3 个回复
DCloud_iOS_XHY
参考一下 uniapp 示例工程中 pages/component/map.nvue 的实现吧
r***@126.com
请问解决了么。我也一样问题
有时会悲伤 - 我不用睡觉的
每个轨迹的ID不同,线就不会相连了