微信小程序map地图上显示polyline线,点位超过1250个出现bug,(仅真机上出现,模拟器上正常)
这里以加载四川省边界为例, 以下是示例代码
// 读取geojson数据
uni.request({
url: 'https://geo.datav.aliyun.com/areas_v3/bound/510000.json',
success: ({ data: geojsonData }) => {
console.log(geojsonData);
// 取出坐标点位数组
const coordinates = geojsonData.features[0].geometry.coordinates;
const polylineArr = [];
for (let coordinate of coordinates) {
polylineArr.push({
points: coordinate[0].map(v => ({
latitude: v[1],
longitude: v[0]
})),
width: 2,
color: '#FF6600',
dottedLine: false
});
}
this.polylines = polylineArr; // map组件上的polylines
}
});
在复现问题的时候,我发现只要设置了 width:2 的情况下才会出现该BUG !!!!离谱!莫名其妙!!!