|
@@ -75,9 +75,27 @@ class Project extends PureComponent {
|
|
this.icon = new BMapGL.Icon(imgWaterPump, new BMapGL.Size(30, 30));
|
|
this.icon = new BMapGL.Icon(imgWaterPump, new BMapGL.Size(30, 30));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ polyline = null;
|
|
|
|
+
|
|
|
|
+ showLine(show) {
|
|
|
|
+ const { points, map } = this.props;
|
|
|
|
+ if (show) {
|
|
|
|
+ this.polyline = new BMapGL.Polyline(points, {
|
|
|
|
+ strokeColor: "#fff",
|
|
|
|
+ strokeWeight: 3,
|
|
|
|
+ strokeOpacity: 0.5,
|
|
|
|
+ strokeStyle: "dashed",
|
|
|
|
+ });
|
|
|
|
+ map.addOverlay(this.polyline);
|
|
|
|
+ } else {
|
|
|
|
+ map.removeOverlay(this.polyline);
|
|
|
|
+ this.polyline = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
startLushu() {
|
|
startLushu() {
|
|
const { points, map } = this.props;
|
|
const { points, map } = this.props;
|
|
|
|
+ this.showLine(true);
|
|
// 删除历史的路书动画
|
|
// 删除历史的路书动画
|
|
if (this.lushu) {
|
|
if (this.lushu) {
|
|
this.lushu.clear();
|
|
this.lushu.clear();
|
|
@@ -94,6 +112,7 @@ class Project extends PureComponent {
|
|
enableRotation: false,
|
|
enableRotation: false,
|
|
onComplete: () => {
|
|
onComplete: () => {
|
|
this.clearLushu();
|
|
this.clearLushu();
|
|
|
|
+ this.showLine(false);
|
|
},
|
|
},
|
|
});
|
|
});
|
|
this.lushu = lushu;
|
|
this.lushu = lushu;
|