效果图如下:
台风测试数据获取
关键代码:
/*** 动态绘制点和线*/drawMakerByAnimate () {const pointsMap = typhoneData.points;const title = typhoneData.tfid + typhoneData.name;if (!pointsMap || pointsMap.length === 0) {return;}if (this.markers.length > 0 && this.baiduMap) {this.markers = [];this.baiduMap.clearOverlays();}// console.log(pointsMap.length);const linePoints = pointsMap.map((item) => new BMapGL.Point(item.lng, item.lat));// 添加第一个点的标签if (linePoints.length > 0) {const firstPoint = linePoints[0];const label = new BMapGL.Label(title, {position: firstPoint,offset: new BMapGL.Size(20, -5)});label.setStyle({color: '#000',fontSize: