|
@@ -66,6 +66,7 @@ export default {
|
|
|
save: false,
|
|
|
situation: [],
|
|
|
nameIdList: [],
|
|
|
+ satelliteRange: [],
|
|
|
websocket: null,
|
|
|
leftwidth: 12,
|
|
|
unit: [],
|
|
@@ -798,14 +799,18 @@ export default {
|
|
|
}
|
|
|
// 新建卫星实体
|
|
|
if (isSatellite) {
|
|
|
- let range = 1200000
|
|
|
+ let range = 1000000
|
|
|
console.log('key :>> ', key);
|
|
|
let x = parseFloat(data[key].x) * 1000
|
|
|
let y = parseFloat(data[key].y) * 1000
|
|
|
let z = parseFloat(data[key].z) * 1000
|
|
|
//终点位置
|
|
|
let position = new this.Cesium.Cartesian3(x, y, z);
|
|
|
- let cylinderposition = new this.Cesium.Cartesian3(x,y,z/2.0);
|
|
|
+ let cylinderposition = this.convertWorldToCartographic(position)
|
|
|
+ cylinderposition.height = cylinderposition.height / 10.0
|
|
|
+ cylinderposition = this.Cesium.Cartesian3.fromDegrees(cylinderposition.longitude, cylinderposition.latitude, cylinderposition.height);
|
|
|
+ console.log('position :>> ', position);
|
|
|
+ console.log('cylinderposition :>> ', cylinderposition);
|
|
|
this.$data._viewer2D.entities.add({
|
|
|
id: this.id,
|
|
|
position: position,
|
|
@@ -834,7 +839,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.$data._viewer2D.entities.add({
|
|
|
- id: this.id,
|
|
|
+ id: this.id + 1,
|
|
|
position: cylinderposition,
|
|
|
cylinder: {
|
|
|
length: range, // 锥形的高度,可以根据需要调整
|
|
@@ -873,7 +878,7 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
this.$data._viewer3D.entities.add({
|
|
|
- id: this.id,
|
|
|
+ id: this.id + 1,
|
|
|
position: cylinderposition,
|
|
|
cylinder: {
|
|
|
length: range, // 锥形的高度,可以根据需要调整
|
|
@@ -888,6 +893,11 @@ export default {
|
|
|
id: this.id,
|
|
|
name: key
|
|
|
})
|
|
|
+ this.satelliteRange.push({
|
|
|
+ satelliteId: this.id,
|
|
|
+ rangeId: this.id + 1
|
|
|
+ })
|
|
|
+ this.id++;
|
|
|
this.id++;
|
|
|
}
|
|
|
}
|
|
@@ -945,7 +955,26 @@ export default {
|
|
|
y = parseFloat(y) * 1000
|
|
|
z = parseFloat(z) * 1000
|
|
|
let entity = viewer.entities.getById(id)
|
|
|
+ for (let i = 0; i < this.satelliteRange.length; i++) {
|
|
|
+ if (id == this.satelliteRange[i].satelliteId) {
|
|
|
+ //是卫星
|
|
|
+ let rangeEntity = viewer.entities.getById(this.satelliteRange[i].rangeId)
|
|
|
+ let position = new this.Cesium.Cartesian3(x, y, z);
|
|
|
+ let cylinderposition = this.convertWorldToCartographic(position)
|
|
|
|
|
|
+ cylinderposition = this.Cesium.Cartesian3.fromDegrees(cylinderposition.longitude, cylinderposition.latitude, cylinderposition.height / 10.0);
|
|
|
+ let oldPosition = viewer.entities.getById(id).position._value
|
|
|
+ //设置方向,根据实体的位置来配置方向
|
|
|
+ entity.orientation = new this.Cesium.VelocityOrientationProperty(entity.position);
|
|
|
+ //设置实体位置
|
|
|
+ entity.position.setValue(position)
|
|
|
+ //设置方向,根据实体的位置来配置方向
|
|
|
+ rangeEntity.orientation = new this.Cesium.VelocityOrientationProperty(rangeEntity.position);
|
|
|
+ //设置实体位置
|
|
|
+ rangeEntity.position.setValue(cylinderposition)
|
|
|
+ this.markSatelliteLine(oldPosition, position, 'Blue', viewer)
|
|
|
+ }
|
|
|
+ }
|
|
|
//终点位置
|
|
|
let position = new this.Cesium.Cartesian3(x, y, z);
|
|
|
let oldPosition = viewer.entities.getById(id).position._value
|