2020-04-17 16:39:42 +08:00
|
|
|
import Group from 'zrender/src/container/Group';
|
|
|
|
import Circle from 'zrender/src/graphic/shape/Circle';
|
|
|
|
import Line from 'zrender/src/graphic/shape/Line';
|
|
|
|
|
|
|
|
class EDetainCircle extends Group {
|
|
|
|
constructor(model) {
|
|
|
|
super();
|
|
|
|
this.model = model;
|
|
|
|
this.create();
|
|
|
|
}
|
|
|
|
|
|
|
|
create() {
|
|
|
|
const model = this.model;
|
|
|
|
const style = this.model.style;
|
|
|
|
this.detainCircle = new Circle({
|
|
|
|
zlevel: model.zlevel,
|
|
|
|
z: model.z,
|
|
|
|
shape: {
|
|
|
|
cx: model.x,
|
|
|
|
cy: model.y,
|
|
|
|
r: model.radius
|
|
|
|
},
|
|
|
|
style:{
|
|
|
|
lineWidth:2,
|
2020-04-17 18:42:58 +08:00
|
|
|
stroke:style.StationStand.detainCar.defaultColor
|
2020-04-17 16:39:42 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
this.line1 = new Line({
|
|
|
|
zlevel: model.zlevel,
|
|
|
|
z: model.z,
|
|
|
|
shape:{
|
|
|
|
x1:model.x - model.radius * 0.7,
|
|
|
|
y1:model.y - model.radius * 0.7,
|
|
|
|
x2:model.x + model.radius * 0.7,
|
|
|
|
y2:model.y + model.radius * 0.7
|
|
|
|
},
|
|
|
|
style:{
|
|
|
|
lineWidth:2,
|
2020-04-17 18:42:58 +08:00
|
|
|
stroke:style.StationStand.detainCar.defaultColor
|
2020-04-17 16:39:42 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
this.line2 = new Line({
|
|
|
|
zlevel: model.zlevel,
|
|
|
|
z: model.z,
|
|
|
|
shape:{
|
|
|
|
x1:model.x - model.radius * 0.7,
|
|
|
|
y1:model.y + model.radius * 0.7,
|
|
|
|
x2:model.x + model.radius * 0.7,
|
|
|
|
y2:model.y - model.radius * 0.7
|
|
|
|
},
|
|
|
|
style:{
|
|
|
|
lineWidth:2,
|
2020-04-17 18:42:58 +08:00
|
|
|
stroke:style.StationStand.detainCar.defaultColor
|
2020-04-17 16:39:42 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
this.add(this.detainCircle);
|
|
|
|
this.add(this.line1);
|
|
|
|
this.add(this.line2);
|
|
|
|
}
|
|
|
|
|
|
|
|
setColor(color) {
|
|
|
|
this.detainCircle.setStyle('stroke', color);
|
|
|
|
this.line1.setStyle('stroke', color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default EDetainCircle;
|