addCompany.js
2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
export default {
createPoint(opt) {
return this.viewer.entities.add({
position: opt.position,
point: opt.point || {
pixelSize: 5,
color: Cesium.Color.YELLOW,
outlineWidth: 2,
outlineColor: Cesium.Color.DARKRED,
disableDepthTestDistance: Number.POSITIVE_INFINITY
},
show: false
});
},
createPolyline(positions) {
let style = this.style || {};
var polyline = this.viewer.entities.add({
polyline: {
positions: new Cesium.CallbackProperty(() => {
return positions || this.positions
}, false),
show: true,
material: style.material || Cesium.Color.YELLOW,
width: style.width || 3,
clampToGround: style.clampToGround == undefined ? false : true
}
});
polyline.objId = this.objId;
return polyline;
},
createPolygon() {
return this.viewer.entities.add({
polygon: {
hierarchy: new Cesium.CallbackProperty(() => {
return new Cesium.PolygonHierarchy(this.positions)
}, false),
material: new Cesium.Color.fromCssColorString("#FFD700").withAlpha(.2),
perPositionHeight: true,
width: 3,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
outline: true
}
});
},
createRectangle() {
var that = this;
var rectangle = this.viewer.entities.add({
rectangle: {
coordinates: new Cesium.CallbackProperty(() => {
return Cesium.Rectangle.fromCartesianArray([this.leftup, this.rightdown])
}, false),
material: new Cesium.Color.fromCssColorString("#FFD700").withAlpha(.2),
perPositionHeight: true,
width: 3,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
outline: true
}
});
rectangle.objId = this.objId;
return rectangle;
},
createCircle() {
var ellipse = this.viewer.entities.add({
position: this.center,
ellipse: {
semiMajorAxis: new Cesium.CallbackProperty(() => {
return this.radius
}, false),
semiMinorAxis: new Cesium.CallbackProperty(() => {
return this.radius
}, false),
material: new Cesium.Color.fromCssColorString("#FFD700").withAlpha(.2),
perPositionHeight: true,
width: 3,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
outline: true
}
});
ellipse.objId = this.objId;
return ellipse;
}
}