jeawy
jeawy
  • 发布:2021-07-04 15:35
  • 更新:2023-09-20 15:15
  • 阅读:1419

map的polyline如何绘制多条线段

分类:uni-app
map

要画多条收尾不相连的线段,目前按照官方文档,会把多条线段收尾相连,这不符合预期。请问如何设置?
举例:
根据文档中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的两条线会被收尾相连,形成一条线,我们预期希望是两条线,收尾不相连的。

2021-07-04 15:35 负责人:无 分享
已邀请:
DCloud_iOS_XHY

DCloud_iOS_XHY

参考一下 uniapp 示例工程中 pages/component/map.nvue 的实现吧

r***@126.com

r***@126.com

请问解决了么。我也一样问题

有时会悲伤

有时会悲伤 - 我不用睡觉的

每个轨迹的ID不同,线就不会相连了

要回复问题请先登录注册