|
@@ -295,6 +295,8 @@ import centerModel3 from 'public/static/model/whitehouse3.glb';
|
|
import radarModel3 from 'public/static/model/radar3.glb'
|
|
import radarModel3 from 'public/static/model/radar3.glb'
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
import CesiumNavigation from 'cesium-navigation-es6/viewerCesiumNavigationMixin';
|
|
import CesiumNavigation from 'cesium-navigation-es6/viewerCesiumNavigationMixin';
|
|
|
|
+let Cesium = require('cesium/Cesium')
|
|
|
|
+let widget = require('cesium/Widgets/widgets.css');
|
|
export default {
|
|
export default {
|
|
// components: {
|
|
// components: {
|
|
// TimeLine
|
|
// TimeLine
|
|
@@ -405,7 +407,7 @@ export default {
|
|
jsonData: null,
|
|
jsonData: null,
|
|
mapNavOptions: {
|
|
mapNavOptions: {
|
|
// 用于在使用重置导航重置地图视图时设置默认视图控制。接受的值是Cesium.Cartographic 和Cesium.Rectangle.
|
|
// 用于在使用重置导航重置地图视图时设置默认视图控制。接受的值是Cesium.Cartographic 和Cesium.Rectangle.
|
|
- defaultResetView: this.Cesium.Cartographic.fromDegrees(110, 30, 2000000),
|
|
|
|
|
|
+ defaultResetView: Cesium.Cartographic.fromDegrees(110, 30, 2000000),
|
|
// 罗盘
|
|
// 罗盘
|
|
enableCompass: true,
|
|
enableCompass: true,
|
|
// 缩放控件
|
|
// 缩放控件
|
|
@@ -420,7 +422,6 @@ export default {
|
|
watch: {
|
|
watch: {
|
|
dimension: {
|
|
dimension: {
|
|
handler: function (val, oldVal) {
|
|
handler: function (val, oldVal) {
|
|
- console.log(val)
|
|
|
|
if (val == 2) {
|
|
if (val == 2) {
|
|
this.leftwidth = 24;
|
|
this.leftwidth = 24;
|
|
} else if (val == 3) {
|
|
} else if (val == 3) {
|
|
@@ -665,8 +666,8 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
cesiumInit() {
|
|
cesiumInit() {
|
|
- this.$data._viewer2D = new this.Cesium.Viewer("2DcesiumContainer", {
|
|
|
|
- sceneMode: this.Cesium.SceneMode.SCENE2D,
|
|
|
|
|
|
+ this.$data._viewer2D = new Cesium.Viewer("2DcesiumContainer", {
|
|
|
|
+ sceneMode: Cesium.SceneMode.SCENE2D,
|
|
animation: this.mode, // 是否显示时间轴动画
|
|
animation: this.mode, // 是否显示时间轴动画
|
|
baseLayerPicker: false,
|
|
baseLayerPicker: false,
|
|
homeButton: false,
|
|
homeButton: false,
|
|
@@ -676,7 +677,7 @@ export default {
|
|
sceneModePicker: false,
|
|
sceneModePicker: false,
|
|
navigationHelpButton: false,
|
|
navigationHelpButton: false,
|
|
selectionIndicator: false,
|
|
selectionIndicator: false,
|
|
- imageryProvider: new this.Cesium.UrlTemplateImageryProvider({
|
|
|
|
|
|
+ imageryProvider: new Cesium.UrlTemplateImageryProvider({
|
|
url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
|
|
url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
|
|
layer: "tdtVecBasicLayer",
|
|
layer: "tdtVecBasicLayer",
|
|
style: "default",
|
|
style: "default",
|
|
@@ -686,7 +687,7 @@ export default {
|
|
})
|
|
})
|
|
});
|
|
});
|
|
|
|
|
|
- this.$data._viewer3D = new this.Cesium.Viewer("3DcesiumContainer", {
|
|
|
|
|
|
+ this.$data._viewer3D = new Cesium.Viewer("3DcesiumContainer", {
|
|
animation: this.mode, // 是否显示时间轴动画
|
|
animation: this.mode, // 是否显示时间轴动画
|
|
baseLayerPicker: false,
|
|
baseLayerPicker: false,
|
|
homeButton: false,
|
|
homeButton: false,
|
|
@@ -696,7 +697,7 @@ export default {
|
|
sceneModePicker: false,
|
|
sceneModePicker: false,
|
|
navigationHelpButton: false,
|
|
navigationHelpButton: false,
|
|
selectionIndicator: false,
|
|
selectionIndicator: false,
|
|
- // imageryProvider: new this.Cesium.WebMapServiceImageryProvider({
|
|
|
|
|
|
+ // imageryProvider: new Cesium.WebMapServiceImageryProvider({
|
|
// url: '/geoserver/map/wms',
|
|
// url: '/geoserver/map/wms',
|
|
// // 这里是自定义的图层名称
|
|
// // 这里是自定义的图层名称
|
|
// layers: 'map',
|
|
// layers: 'map',
|
|
@@ -708,15 +709,17 @@ export default {
|
|
// }),
|
|
// }),
|
|
|
|
|
|
imageryProvider:
|
|
imageryProvider:
|
|
- // new this.Cesium.WebMapTileServiceImageryProvider({
|
|
|
|
- // url: "http://10.170.16.95:8080/geoserver/gwc/service/wmts/rest/map:map/{style}/{TileMatrixSet}/{TileMatrixSet}:{TileMatrix}/{TileRow}/{TileCol}?format=image/png",
|
|
|
|
|
|
+ // new Cesium.WebMapTileServiceImageryProvider({
|
|
|
|
+ // url: "http://127.0.0.1:8080/geoserver/gwc/service/wmts/rest/map:map/{style}/{TileMatrixSet}/{TileMatrixSet}:{TileMatrix}/{TileRow}/{TileCol}?format=image/png",
|
|
// layer: 'map:map',
|
|
// layer: 'map:map',
|
|
// style: 'raster',
|
|
// style: 'raster',
|
|
// format: 'image/png',
|
|
// format: 'image/png',
|
|
- // tileMatrixSetID: 'EPSG:900913', //一般使用EPSG:3857坐标系
|
|
|
|
|
|
+ // tileMatrixSetID: 'EPSG:4326',
|
|
|
|
+ // tilingScheme: new Cesium.GeographicTilingScheme(), // 切片方案,与TileMatrixSet中的切片组织相对应;调用EPSG4326坐标系时,切片方案必须为GeographicTilingScheme;
|
|
|
|
+ // maximumLevel:10,
|
|
|
|
|
|
// }),
|
|
// }),
|
|
- new this.Cesium.UrlTemplateImageryProvider({
|
|
|
|
|
|
+ new Cesium.UrlTemplateImageryProvider({
|
|
url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
|
|
url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
|
|
layer: "tdtVecBasicLayer",
|
|
layer: "tdtVecBasicLayer",
|
|
style: "default",
|
|
style: "default",
|
|
@@ -729,19 +732,19 @@ export default {
|
|
this.$data._viewer3D._cesiumWidget._creditContainer.style.display = "none";
|
|
this.$data._viewer3D._cesiumWidget._creditContainer.style.display = "none";
|
|
this.$data._viewer2D._cesiumWidget._creditContainer.style.display = "none";
|
|
this.$data._viewer2D._cesiumWidget._creditContainer.style.display = "none";
|
|
this.$data._viewer3D.camera.setView({
|
|
this.$data._viewer3D.camera.setView({
|
|
- destination: new this.Cesium.Cartesian3.fromDegrees(117.918977, 25.0, 1500000)
|
|
|
|
|
|
+ destination: new Cesium.Cartesian3.fromDegrees(117.918977, 25.0, 1500000)
|
|
// 方向,俯视和仰视的视角
|
|
// 方向,俯视和仰视的视角
|
|
// orientation:{
|
|
// orientation:{
|
|
- // heading: this.Cesium.Math.toRadians(90),//坐标系旋转90度
|
|
|
|
- // pitch: this.Cesium.Math.toRadians(-45) ,//设置俯仰角度为-45度
|
|
|
|
|
|
+ // heading: Cesium.Math.toRadians(90),//坐标系旋转90度
|
|
|
|
+ // pitch: Cesium.Math.toRadians(-45) ,//设置俯仰角度为-45度
|
|
// }
|
|
// }
|
|
});
|
|
});
|
|
this.$data._viewer2D.camera.setView({
|
|
this.$data._viewer2D.camera.setView({
|
|
- destination: new this.Cesium.Cartesian3.fromDegrees(117.918977, 25.0, 1500000)
|
|
|
|
|
|
+ destination: new Cesium.Cartesian3.fromDegrees(117.918977, 25.0, 1500000)
|
|
// 方向,俯视和仰视的视角
|
|
// 方向,俯视和仰视的视角
|
|
// orientation:{
|
|
// orientation:{
|
|
- // heading: this.Cesium.Math.toRadians(90),//坐标系旋转90度
|
|
|
|
- // pitch: this.Cesium.Math.toRadians(-45) ,//设置俯仰角度为-45度
|
|
|
|
|
|
+ // heading: Cesium.Math.toRadians(90),//坐标系旋转90度
|
|
|
|
+ // pitch: Cesium.Math.toRadians(-45) ,//设置俯仰角度为-45度
|
|
// }
|
|
// }
|
|
});
|
|
});
|
|
// this.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 1500000; //相机高度的最大值
|
|
// this.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 1500000; //相机高度的最大值
|
|
@@ -751,8 +754,8 @@ export default {
|
|
this.$data._viewer3D.camera.changed.addEventListener(this.sync); //地图移动事件
|
|
this.$data._viewer3D.camera.changed.addEventListener(this.sync); //地图移动事件
|
|
this.$data._viewer2D.camera.moveEnd.addEventListener(this.getCammeraHeightAndZoom) //地图缩放事件
|
|
this.$data._viewer2D.camera.moveEnd.addEventListener(this.getCammeraHeightAndZoom) //地图缩放事件
|
|
this.$data._viewer3D.camera.moveEnd.addEventListener(this.getCammeraHeightAndZoom) //地图缩放事件
|
|
this.$data._viewer3D.camera.moveEnd.addEventListener(this.getCammeraHeightAndZoom) //地图缩放事件
|
|
- this.handler2D = new this.Cesium.ScreenSpaceEventHandler(this.$data._viewer2D.scene.canvas);
|
|
|
|
- this.handler3D = new this.Cesium.ScreenSpaceEventHandler(this.$data._viewer3D.scene.canvas);
|
|
|
|
|
|
+ this.handler2D = new Cesium.ScreenSpaceEventHandler(this.$data._viewer2D.scene.canvas);
|
|
|
|
+ this.handler3D = new Cesium.ScreenSpaceEventHandler(this.$data._viewer3D.scene.canvas);
|
|
//设置导航组件
|
|
//设置导航组件
|
|
// new CesiumNavigation(this.$data._viewer2D, this.mapNavOptions);
|
|
// new CesiumNavigation(this.$data._viewer2D, this.mapNavOptions);
|
|
new CesiumNavigation(this.$data._viewer3D, this.mapNavOptions);
|
|
new CesiumNavigation(this.$data._viewer3D, this.mapNavOptions);
|
|
@@ -760,39 +763,39 @@ export default {
|
|
sync() {
|
|
sync() {
|
|
if (this.mousevalue == "3D") {
|
|
if (this.mousevalue == "3D") {
|
|
// 三维地图中心点
|
|
// 三维地图中心点
|
|
- let center = new this.Cesium.Cartesian2(
|
|
|
|
|
|
+ let center = new Cesium.Cartesian2(
|
|
Math.floor(this.$data._viewer3D.canvas.clientWidth / 2),
|
|
Math.floor(this.$data._viewer3D.canvas.clientWidth / 2),
|
|
Math.floor(this.$data._viewer3D.canvas.clientHeight / 2)
|
|
Math.floor(this.$data._viewer3D.canvas.clientHeight / 2)
|
|
);
|
|
);
|
|
// 转为世界坐标系
|
|
// 转为世界坐标系
|
|
let position = this.$data._viewer3D.scene.camera.pickEllipsoid(center);
|
|
let position = this.$data._viewer3D.scene.camera.pickEllipsoid(center);
|
|
// 判断中心点是否在椭球体上
|
|
// 判断中心点是否在椭球体上
|
|
- if (this.Cesium.defined(position)) {
|
|
|
|
|
|
+ if (Cesium.defined(position)) {
|
|
// 获取三维地图中心点与相机之间的距离
|
|
// 获取三维地图中心点与相机之间的距离
|
|
- let distance = this.Cesium.Cartesian3.distance(position, this.$data._viewer3D.scene.camera.positionWC);
|
|
|
|
|
|
+ let distance = Cesium.Cartesian3.distance(position, this.$data._viewer3D.scene.camera.positionWC);
|
|
position = this.convertWorldToCartographic(position);
|
|
position = this.convertWorldToCartographic(position);
|
|
// 更新二维地图
|
|
// 更新二维地图
|
|
this.$data._viewer2D.scene.camera.setView({
|
|
this.$data._viewer2D.scene.camera.setView({
|
|
- destination: new this.Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, distance)
|
|
|
|
|
|
+ destination: new Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, distance)
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.mousevalue == "2D") {
|
|
if (this.mousevalue == "2D") {
|
|
// 二维地图中心点
|
|
// 二维地图中心点
|
|
- let center = new this.Cesium.Cartesian2(
|
|
|
|
|
|
+ let center = new Cesium.Cartesian2(
|
|
Math.floor(this.$data._viewer2D.canvas.clientWidth / 2),
|
|
Math.floor(this.$data._viewer2D.canvas.clientWidth / 2),
|
|
Math.floor(this.$data._viewer2D.canvas.clientHeight / 2)
|
|
Math.floor(this.$data._viewer2D.canvas.clientHeight / 2)
|
|
);
|
|
);
|
|
// 转为世界坐标系
|
|
// 转为世界坐标系
|
|
let position = this.$data._viewer2D.scene.camera.pickEllipsoid(center);
|
|
let position = this.$data._viewer2D.scene.camera.pickEllipsoid(center);
|
|
// 判断中心点是否在椭球体上
|
|
// 判断中心点是否在椭球体上
|
|
- if (this.Cesium.defined(position)) {
|
|
|
|
|
|
+ if (Cesium.defined(position)) {
|
|
// 获取三维地图中心点与相机之间的距离
|
|
// 获取三维地图中心点与相机之间的距离
|
|
let distance = this.$data._viewer2D.scene.camera.positionCartographic.height;
|
|
let distance = this.$data._viewer2D.scene.camera.positionCartographic.height;
|
|
position = this.convertWorldToCartographic(position);
|
|
position = this.convertWorldToCartographic(position);
|
|
// 更新三维地图
|
|
// 更新三维地图
|
|
this.$data._viewer3D.scene.camera.setView({
|
|
this.$data._viewer3D.scene.camera.setView({
|
|
- destination: new this.Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, distance)
|
|
|
|
|
|
+ destination: new Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, distance)
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -801,8 +804,8 @@ export default {
|
|
convertWorldToCartographic(worldPosition) {
|
|
convertWorldToCartographic(worldPosition) {
|
|
const ellipsoid = this.$data._viewer2D.scene.globe.ellipsoid;
|
|
const ellipsoid = this.$data._viewer2D.scene.globe.ellipsoid;
|
|
const cartographic = ellipsoid.cartesianToCartographic(worldPosition);
|
|
const cartographic = ellipsoid.cartesianToCartographic(worldPosition);
|
|
- const longitude = this.Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
|
- const latitude = this.Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
|
|
|
+ const longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
|
+ const latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
const height = cartographic.height;
|
|
const height = cartographic.height;
|
|
return { longitude, latitude, height };
|
|
return { longitude, latitude, height };
|
|
},
|
|
},
|
|
@@ -825,9 +828,9 @@ export default {
|
|
getCenterPosition(is3D = false) {
|
|
getCenterPosition(is3D = false) {
|
|
let viewer = is3D ? this.$data._viewer3D : this.$data._viewer2D;
|
|
let viewer = is3D ? this.$data._viewer3D : this.$data._viewer2D;
|
|
let result = viewer.camera.pickEllipsoid(
|
|
let result = viewer.camera.pickEllipsoid(
|
|
- new this.Cesium.Cartesian2(viewer.canvas.clientWidth / 2, viewer.canvas.clientHeight / 2)
|
|
|
|
|
|
+ new Cesium.Cartesian2(viewer.canvas.clientWidth / 2, viewer.canvas.clientHeight / 2)
|
|
);
|
|
);
|
|
- let curPosition = this.Cesium.Ellipsoid.WGS84.cartesianToCartographic(result);
|
|
|
|
|
|
+ let curPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(result);
|
|
let lon = (curPosition.longitude * 180) / Math.PI;
|
|
let lon = (curPosition.longitude * 180) / Math.PI;
|
|
let lat = (curPosition.latitude * 180) / Math.PI;
|
|
let lat = (curPosition.latitude * 180) / Math.PI;
|
|
let height = viewer.camera.positionCartographic.height;
|
|
let height = viewer.camera.positionCartographic.height;
|
|
@@ -843,7 +846,7 @@ export default {
|
|
let viewer = (this.dimension === 3 || this.dimension === 5) ? this.$data._viewer3D : this.$data._viewer2D;
|
|
let viewer = (this.dimension === 3 || this.dimension === 5) ? this.$data._viewer3D : this.$data._viewer2D;
|
|
// 镜头拉进
|
|
// 镜头拉进
|
|
viewer.camera.flyTo({
|
|
viewer.camera.flyTo({
|
|
- destination: this.Cesium.Cartesian3.fromDegrees(lon, lat, height / 1.8),
|
|
|
|
|
|
+ destination: Cesium.Cartesian3.fromDegrees(lon, lat, height / 1.8),
|
|
duration: 1.0
|
|
duration: 1.0
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -853,14 +856,14 @@ export default {
|
|
let viewer = (this.dimension === 3 || this.dimension === 5) ? this.$data._viewer3D : this.$data._viewer2D;
|
|
let viewer = (this.dimension === 3 || this.dimension === 5) ? this.$data._viewer3D : this.$data._viewer2D;
|
|
// 镜头远离
|
|
// 镜头远离
|
|
viewer.camera.flyTo({
|
|
viewer.camera.flyTo({
|
|
- destination: this.Cesium.Cartesian3.fromDegrees(lon, lat, height * 1.2),
|
|
|
|
|
|
+ destination: Cesium.Cartesian3.fromDegrees(lon, lat, height * 1.2),
|
|
duration: 1.0
|
|
duration: 1.0
|
|
});
|
|
});
|
|
},
|
|
},
|
|
home() {
|
|
home() {
|
|
let viewer = (this.dimension === 3 || this.dimension === 5) ? this.$data._viewer3D : this.$data._viewer2D;
|
|
let viewer = (this.dimension === 3 || this.dimension === 5) ? this.$data._viewer3D : this.$data._viewer2D;
|
|
viewer.camera.flyTo({
|
|
viewer.camera.flyTo({
|
|
- destination: this.Cesium.Cartesian3.fromDegrees(117.918977, 25.0, 1500000),
|
|
|
|
|
|
+ destination: Cesium.Cartesian3.fromDegrees(117.918977, 25.0, 1500000),
|
|
duration: 2.0
|
|
duration: 2.0
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -927,7 +930,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
markLocationbyJson(latitude, longitude, height, name, type) {
|
|
markLocationbyJson(latitude, longitude, height, name, type) {
|
|
- const position = this.Cesium.Cartesian3.fromDegrees(longitude, latitude, height);
|
|
|
|
|
|
+ const position = Cesium.Cartesian3.fromDegrees(longitude, latitude, height);
|
|
console.log('position :>> ', position);
|
|
console.log('position :>> ', position);
|
|
let color = ''
|
|
let color = ''
|
|
let currentModel = null
|
|
let currentModel = null
|
|
@@ -935,8 +938,8 @@ export default {
|
|
let size = 64
|
|
let size = 64
|
|
if (type == 'red') {
|
|
if (type == 'red') {
|
|
color = 'Red'
|
|
color = 'Red'
|
|
- console.log(this.models.missile2!=null?this.Cesium.clone(this.models.missile2):null+"333333333333333333333333333333333333333333333333333")
|
|
|
|
- currentModel = [this.models.missile2!=null?this.Cesium.clone(this.models.missile2):null,this.models.missile3!=null?this.Cesium.clone(this.models.missile3):null];
|
|
|
|
|
|
+ currentModel = [this.models.missile2!=null?Cesium.clone(this.models.missile2):null,this.models.missile3!=null?Cesium.clone(this.models.missile3):null];
|
|
|
|
+ console.log("333333333333333333333333333333333333333333333333333"+this.models.missile2)
|
|
modelUrl = [missileModel2,missileModel3]
|
|
modelUrl = [missileModel2,missileModel3]
|
|
for(let i = 0;i < this.jsonData.redunit.length;i++)
|
|
for(let i = 0;i < this.jsonData.redunit.length;i++)
|
|
{
|
|
{
|
|
@@ -994,7 +997,7 @@ export default {
|
|
else if (type == 'blue') {
|
|
else if (type == 'blue') {
|
|
|
|
|
|
color = 'Blue'
|
|
color = 'Blue'
|
|
- currentModel = [this.models.radar2!=null?this.Cesium.clone(this.models.radar2):null,this.models.radar3!=null?this.Cesium.clone(this.models.radar3):null];
|
|
|
|
|
|
+ currentModel = [this.models.radar2!=null?Cesium.clone(this.models.radar2):null,this.models.radar3!=null?Cesium.clone(this.models.radar3):null];
|
|
modelUrl = [radarModel2,radarModel3]
|
|
modelUrl = [radarModel2,radarModel3]
|
|
let fire_number = 0
|
|
let fire_number = 0
|
|
for(let i = 0;i<this.jsonData.blueunit.length;i++){
|
|
for(let i = 0;i<this.jsonData.blueunit.length;i++){
|
|
@@ -1013,13 +1016,13 @@ export default {
|
|
}
|
|
}
|
|
else if (type == 'center') {
|
|
else if (type == 'center') {
|
|
color = 'Blue'
|
|
color = 'Blue'
|
|
- currentModel = [this.models.center2!=null?this.Cesium.clone(this.models.center2):null,this.models.center3!=null?this.Cesium.clone(this.models.center3):null];
|
|
|
|
|
|
+ currentModel = [this.models.center2!=null?Cesium.clone(this.models.center2):null,this.models.center3!=null?Cesium.clone(this.models.center3):null];
|
|
modelUrl = [centerModel2,centerModel3]
|
|
modelUrl = [centerModel2,centerModel3]
|
|
this.centerPosition = position
|
|
this.centerPosition = position
|
|
}
|
|
}
|
|
else if (type == 'satelite') {
|
|
else if (type == 'satelite') {
|
|
color = 'Blue'
|
|
color = 'Blue'
|
|
- currentModel = [this.model.satellite2!=null?this.Cesium.clone(this.models.satellite2):null,this.model.satellite3!=null?this.Cesium.clone(this.models.satellite3):null];
|
|
|
|
|
|
+ currentModel = [this.model.satellite2!=null?Cesium.clone(this.models.satellite2):null,this.model.satellite3!=null?Cesium.clone(this.models.satellite3):null];
|
|
modelUrl = [satelliteModel2,satelliteModel3]
|
|
modelUrl = [satelliteModel2,satelliteModel3]
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1031,14 +1034,14 @@ export default {
|
|
id: this.id,
|
|
id: this.id,
|
|
position: position,
|
|
position: position,
|
|
ellipsoid: {
|
|
ellipsoid: {
|
|
- radii: new this.Cesium.Cartesian3(range, range, range),
|
|
|
|
- material: this.Cesium.Color.GREEN.withAlpha(0.5), // 设置球体的颜色和透明度
|
|
|
|
|
|
+ radii: new Cesium.Cartesian3(range, range, range),
|
|
|
|
+ material: Cesium.Color.GREEN.withAlpha(0.5), // 设置球体的颜色和透明度
|
|
outline: true,
|
|
outline: true,
|
|
- outlineColor: this.Cesium.Color.GREEN,
|
|
|
|
|
|
+ outlineColor: Cesium.Color.GREEN,
|
|
},
|
|
},
|
|
point: {
|
|
point: {
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
- color: this.Cesium.Color.fromCssColorString(color)
|
|
|
|
|
|
+ color: Cesium.Color.fromCssColorString(color)
|
|
},
|
|
},
|
|
model: currentModel[0]!=null?currentModel[0]:{
|
|
model: currentModel[0]!=null?currentModel[0]:{
|
|
uri: modelUrl[0], // 替换为你的3D模型文件路径
|
|
uri: modelUrl[0], // 替换为你的3D模型文件路径
|
|
@@ -1049,21 +1052,21 @@ export default {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
show: true,
|
|
show: true,
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
- pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
|
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
}
|
|
}
|
|
});
|
|
});
|
|
let entity3 = this.$data._viewer3D.entities.add({
|
|
let entity3 = this.$data._viewer3D.entities.add({
|
|
id: this.id,
|
|
id: this.id,
|
|
position: position,
|
|
position: position,
|
|
ellipsoid: {
|
|
ellipsoid: {
|
|
- radii: new this.Cesium.Cartesian3(range, range, range),
|
|
|
|
- material: this.Cesium.Color.GREEN.withAlpha(0.5), // 设置球体的颜色和透明度
|
|
|
|
|
|
+ radii: new Cesium.Cartesian3(range, range, range),
|
|
|
|
+ material: Cesium.Color.GREEN.withAlpha(0.5), // 设置球体的颜色和透明度
|
|
outline: true,
|
|
outline: true,
|
|
- outlineColor: this.Cesium.Color.GREEN,
|
|
|
|
|
|
+ outlineColor: Cesium.Color.GREEN,
|
|
},
|
|
},
|
|
point: {
|
|
point: {
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
- color: this.Cesium.Color.fromCssColorString(color)
|
|
|
|
|
|
+ color: Cesium.Color.fromCssColorString(color)
|
|
},
|
|
},
|
|
model: currentModel[1]!=null?currentModel[1]:{
|
|
model: currentModel[1]!=null?currentModel[1]:{
|
|
uri: modelUrl[1], // 替换为你的3D模型文件路径
|
|
uri: modelUrl[1], // 替换为你的3D模型文件路径
|
|
@@ -1074,7 +1077,7 @@ export default {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
show: true,
|
|
show: true,
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
- pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
|
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if(currentModel[0] == null){
|
|
if(currentModel[0] == null){
|
|
@@ -1096,7 +1099,7 @@ export default {
|
|
position: position,
|
|
position: position,
|
|
point: {
|
|
point: {
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
- color: this.Cesium.Color.fromCssColorString(color)
|
|
|
|
|
|
+ color: Cesium.Color.fromCssColorString(color)
|
|
},
|
|
},
|
|
model: currentModel[0]!=null?currentModel[0]:{
|
|
model: currentModel[0]!=null?currentModel[0]:{
|
|
uri: modelUrl[0], // 替换为你的3D模型文件路径
|
|
uri: modelUrl[0], // 替换为你的3D模型文件路径
|
|
@@ -1107,7 +1110,7 @@ export default {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
show: true,
|
|
show: true,
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
- pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
|
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
}
|
|
}
|
|
});
|
|
});
|
|
let entity3 = this.$data._viewer3D.entities.add({
|
|
let entity3 = this.$data._viewer3D.entities.add({
|
|
@@ -1115,7 +1118,7 @@ export default {
|
|
position: position,
|
|
position: position,
|
|
point: {
|
|
point: {
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
- color: this.Cesium.Color.fromCssColorString(color)
|
|
|
|
|
|
+ color: Cesium.Color.fromCssColorString(color)
|
|
},
|
|
},
|
|
model: currentModel[1]!=null?currentModel[1]:{
|
|
model: currentModel[1]!=null?currentModel[1]:{
|
|
uri: modelUrl[1], // 替换为你的3D模型文件路径
|
|
uri: modelUrl[1], // 替换为你的3D模型文件路径
|
|
@@ -1126,7 +1129,7 @@ export default {
|
|
text: type + ' ' + name,
|
|
text: type + ' ' + name,
|
|
show: true,
|
|
show: true,
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
- pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
|
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if(currentModel[0] == null){
|
|
if(currentModel[0] == null){
|
|
@@ -1148,15 +1151,15 @@ export default {
|
|
let viewer = this.mousevalue === "2D" ? this.$data._viewer2D : this.$data._viewer3D;
|
|
let viewer = this.mousevalue === "2D" ? this.$data._viewer2D : this.$data._viewer3D;
|
|
let clickPosition;
|
|
let clickPosition;
|
|
if (this.dimension === 5 && this.mousevalue === "3D") {
|
|
if (this.dimension === 5 && this.mousevalue === "3D") {
|
|
- clickPosition = new this.Cesium.Cartesian2(event.clientX - 1080, event.clientY - 160);
|
|
|
|
|
|
+ clickPosition = new Cesium.Cartesian2(event.clientX - 1080, event.clientY - 160);
|
|
} else {
|
|
} else {
|
|
- clickPosition = new this.Cesium.Cartesian2(event.clientX - 280, event.clientY - 160);
|
|
|
|
|
|
+ clickPosition = new Cesium.Cartesian2(event.clientX - 280, event.clientY - 160);
|
|
}
|
|
}
|
|
// 获取地图上的经纬度
|
|
// 获取地图上的经纬度
|
|
const viewerPosition = viewer.scene.camera.pickEllipsoid(clickPosition);
|
|
const viewerPosition = viewer.scene.camera.pickEllipsoid(clickPosition);
|
|
const cartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(viewerPosition);
|
|
const cartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(viewerPosition);
|
|
- const latitude = this.Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
|
- const longitude = this.Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
|
|
|
+ const latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
|
+ const longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
|
return {
|
|
return {
|
|
latitude,
|
|
latitude,
|
|
longitude
|
|
longitude
|
|
@@ -1164,11 +1167,11 @@ export default {
|
|
},
|
|
},
|
|
markLine(point1, point2, color) {
|
|
markLine(point1, point2, color) {
|
|
// 从点1和点2的WGS84坐标创建Cartesian3对象
|
|
// 从点1和点2的WGS84坐标创建Cartesian3对象
|
|
- const position1 = this.Cesium.Cartesian3.fromDegrees(point1.longitude, point1.latitude, point1.height || 0);
|
|
|
|
- const position2 = this.Cesium.Cartesian3.fromDegrees(point2.longitude, point2.latitude, point2.height || 0);
|
|
|
|
|
|
+ const position1 = Cesium.Cartesian3.fromDegrees(point1.longitude, point1.latitude, point1.height || 0);
|
|
|
|
+ const position2 = Cesium.Cartesian3.fromDegrees(point2.longitude, point2.latitude, point2.height || 0);
|
|
// 创建一个带有箭头图标的PolylineMaterial
|
|
// 创建一个带有箭头图标的PolylineMaterial
|
|
- const material = new this.Cesium.PolylineArrowMaterialProperty(
|
|
|
|
- this.Cesium.Color.fromCssColorString(color || "red")
|
|
|
|
|
|
+ const material = new Cesium.PolylineArrowMaterialProperty(
|
|
|
|
+ Cesium.Color.fromCssColorString(color || "red")
|
|
);
|
|
);
|
|
|
|
|
|
// 将点1和点2之间的连线添加到Viewer中
|
|
// 将点1和点2之间的连线添加到Viewer中
|
|
@@ -1192,8 +1195,8 @@ export default {
|
|
markSatelliteLine(position1, position2, color, viewer) {
|
|
markSatelliteLine(position1, position2, color, viewer) {
|
|
|
|
|
|
// 创建一个带有箭头图标的PolylineMaterial
|
|
// 创建一个带有箭头图标的PolylineMaterial
|
|
- const material = new this.Cesium.PolylineArrowMaterialProperty(
|
|
|
|
- this.Cesium.Color.fromCssColorString(color || "red")
|
|
|
|
|
|
+ const material = new Cesium.PolylineArrowMaterialProperty(
|
|
|
|
+ Cesium.Color.fromCssColorString(color || "red")
|
|
);
|
|
);
|
|
|
|
|
|
// 将点1和点2之间的连线添加到Viewer中
|
|
// 将点1和点2之间的连线添加到Viewer中
|
|
@@ -1208,11 +1211,11 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
setTimeLine(startTime, endtime, stepTime) {
|
|
setTimeLine(startTime, endtime, stepTime) {
|
|
- let start = this.Cesium.JulianDate.fromDate(new Date(startTime)); // 设置时间轴当前时间为开始时间
|
|
|
|
- let stop = this.Cesium.JulianDate.fromDate(new Date(endtime));
|
|
|
|
|
|
+ let start = Cesium.JulianDate.fromDate(new Date(startTime)); // 设置时间轴当前时间为开始时间
|
|
|
|
+ let stop = Cesium.JulianDate.fromDate(new Date(endtime));
|
|
// 添加8小时,使地图时间和北京时间相同
|
|
// 添加8小时,使地图时间和北京时间相同
|
|
- start = this.Cesium.JulianDate.addHours(start, 8, new this.Cesium.JulianDate());
|
|
|
|
- stop = this.Cesium.JulianDate.addHours(stop, 8, new this.Cesium.JulianDate());
|
|
|
|
|
|
+ start = Cesium.JulianDate.addHours(start, 8, new Cesium.JulianDate());
|
|
|
|
+ stop = Cesium.JulianDate.addHours(stop, 8, new Cesium.JulianDate());
|
|
// 设置时钟开始时间
|
|
// 设置时钟开始时间
|
|
this.$data._viewer2D.clock.startTime = start.clone();
|
|
this.$data._viewer2D.clock.startTime = start.clone();
|
|
this.$data._viewer3D.clock.startTime = start.clone();
|
|
this.$data._viewer3D.clock.startTime = start.clone();
|
|
@@ -1229,8 +1232,8 @@ export default {
|
|
this.$data._viewer2D.timeline.zoomTo(start, stop);
|
|
this.$data._viewer2D.timeline.zoomTo(start, stop);
|
|
this.$data._viewer3D.timeline.zoomTo(start, stop);
|
|
this.$data._viewer3D.timeline.zoomTo(start, stop);
|
|
// 循环执行,到达终止时间,重新从起点时间开始
|
|
// 循环执行,到达终止时间,重新从起点时间开始
|
|
- this.$data._viewer2D.clock.clockRange = this.Cesium.ClockRange.LOOP_STOP;
|
|
|
|
- this.$data._viewer3D.clock.clockRange = this.Cesium.ClockRange.LOOP_STOP;
|
|
|
|
|
|
+ this.$data._viewer2D.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
|
|
|
|
+ this.$data._viewer3D.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
|
|
this.messageList.push({
|
|
this.messageList.push({
|
|
order: this.order++,
|
|
order: this.order++,
|
|
time: startTime,
|
|
time: startTime,
|
|
@@ -1238,7 +1241,7 @@ export default {
|
|
})
|
|
})
|
|
this.$data._viewer2D.clock.onTick.addEventListener(clock => {
|
|
this.$data._viewer2D.clock.onTick.addEventListener(clock => {
|
|
const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
- const elapsedTime = this.Cesium.JulianDate.secondsDifference(
|
|
|
|
|
|
+ const elapsedTime = Cesium.JulianDate.secondsDifference(
|
|
currentTime,
|
|
currentTime,
|
|
this.$data._viewer2D.clock.startTime
|
|
this.$data._viewer2D.clock.startTime
|
|
); // 获取从起始时间到当前时间的秒数
|
|
); // 获取从起始时间到当前时间的秒数
|
|
@@ -1249,7 +1252,7 @@ export default {
|
|
});
|
|
});
|
|
this.$data._viewer3D.clock.onTick.addEventListener(clock => {
|
|
this.$data._viewer3D.clock.onTick.addEventListener(clock => {
|
|
const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
const currentTime = clock.currentTime; // 获取当前时间轴的时间
|
|
- const elapsedTime = this.Cesium.JulianDate.secondsDifference(
|
|
|
|
|
|
+ const elapsedTime = Cesium.JulianDate.secondsDifference(
|
|
currentTime,
|
|
currentTime,
|
|
this.$data._viewer3D.clock.startTime
|
|
this.$data._viewer3D.clock.startTime
|
|
); // 获取从起始时间到当前时间的秒数
|
|
); // 获取从起始时间到当前时间的秒数
|
|
@@ -1293,24 +1296,24 @@ export default {
|
|
let y = parseFloat(data[key].y) * 1000
|
|
let y = parseFloat(data[key].y) * 1000
|
|
let z = parseFloat(data[key].z) * 1000
|
|
let z = parseFloat(data[key].z) * 1000
|
|
//终点位置
|
|
//终点位置
|
|
- let position = new this.Cesium.Cartesian3(x, y, z);
|
|
|
|
|
|
+ let position = new Cesium.Cartesian3(x, y, z);
|
|
let cylinderposition = this.convertWorldToCartographic(position)
|
|
let cylinderposition = this.convertWorldToCartographic(position)
|
|
cylinderposition.height = cylinderposition.height / 10.0
|
|
cylinderposition.height = cylinderposition.height / 10.0
|
|
- cylinderposition = this.Cesium.Cartesian3.fromDegrees(cylinderposition.longitude, cylinderposition.latitude, cylinderposition.height);
|
|
|
|
|
|
+ cylinderposition = Cesium.Cartesian3.fromDegrees(cylinderposition.longitude, cylinderposition.latitude, cylinderposition.height);
|
|
this.$data._viewer2D.entities.add({
|
|
this.$data._viewer2D.entities.add({
|
|
id: this.id,
|
|
id: this.id,
|
|
position: position,
|
|
position: position,
|
|
point: {
|
|
point: {
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
- color: this.Cesium.Color.fromCssColorString('Blue')
|
|
|
|
|
|
+ color: Cesium.Color.fromCssColorString('Blue')
|
|
},
|
|
},
|
|
// cylinder: {
|
|
// cylinder: {
|
|
// length: range, // 锥形的高度,可以根据需要调整
|
|
// length: range, // 锥形的高度,可以根据需要调整
|
|
// topRadius: 0,
|
|
// topRadius: 0,
|
|
// bottomRadius: range / 2,
|
|
// bottomRadius: range / 2,
|
|
- // material: this.Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
|
|
|
|
+ // material: Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
// outline: true,
|
|
// outline: true,
|
|
- // outlineColor: this.Cesium.Color.BLUE,
|
|
|
|
|
|
+ // outlineColor: Cesium.Color.BLUE,
|
|
// },
|
|
// },
|
|
model: {
|
|
model: {
|
|
uri: satelliteModel2, // 替换为你的3D模型文件路径
|
|
uri: satelliteModel2, // 替换为你的3D模型文件路径
|
|
@@ -1321,7 +1324,7 @@ export default {
|
|
text: 'satellite ' + key,
|
|
text: 'satellite ' + key,
|
|
show: true,
|
|
show: true,
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
- pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
|
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
}
|
|
}
|
|
});
|
|
});
|
|
this.$data._viewer2D.entities.add({
|
|
this.$data._viewer2D.entities.add({
|
|
@@ -1331,9 +1334,9 @@ export default {
|
|
length: range, // 锥形的高度,可以根据需要调整
|
|
length: range, // 锥形的高度,可以根据需要调整
|
|
topRadius: 0,
|
|
topRadius: 0,
|
|
bottomRadius: range / 2,
|
|
bottomRadius: range / 2,
|
|
- material: this.Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
|
|
|
|
+ material: Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
outline: true,
|
|
outline: true,
|
|
- outlineColor: this.Cesium.Color.BLUE,
|
|
|
|
|
|
+ outlineColor: Cesium.Color.BLUE,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
this.$data._viewer3D.entities.add({
|
|
this.$data._viewer3D.entities.add({
|
|
@@ -1341,15 +1344,15 @@ export default {
|
|
position: position,
|
|
position: position,
|
|
point: {
|
|
point: {
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
pixelSize: 12, // 调整点的大小,可以增大点的像素大小
|
|
- color: this.Cesium.Color.fromCssColorString('Blue')
|
|
|
|
|
|
+ color: Cesium.Color.fromCssColorString('Blue')
|
|
},
|
|
},
|
|
// cylinder: {
|
|
// cylinder: {
|
|
// length: range, // 锥形的高度,可以根据需要调整
|
|
// length: range, // 锥形的高度,可以根据需要调整
|
|
// topRadius: 0,
|
|
// topRadius: 0,
|
|
// bottomRadius: range / 2,
|
|
// bottomRadius: range / 2,
|
|
- // material: this.Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
|
|
|
|
+ // material: Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
// outline: true,
|
|
// outline: true,
|
|
- // outlineColor: this.Cesium.Color.BLUE,
|
|
|
|
|
|
+ // outlineColor: Cesium.Color.BLUE,
|
|
// },
|
|
// },
|
|
model: {
|
|
model: {
|
|
uri: satelliteModel3, // 替换为你的3D模型文件路径
|
|
uri: satelliteModel3, // 替换为你的3D模型文件路径
|
|
@@ -1360,7 +1363,7 @@ export default {
|
|
text: 'satellite ' + key,
|
|
text: 'satellite ' + key,
|
|
show: true,
|
|
show: true,
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
font: "18px Helvetica", // 调整标签的字体样式和大小
|
|
- pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
|
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
|
|
},
|
|
},
|
|
});
|
|
});
|
|
this.$data._viewer3D.entities.add({
|
|
this.$data._viewer3D.entities.add({
|
|
@@ -1370,9 +1373,9 @@ export default {
|
|
length: range, // 锥形的高度,可以根据需要调整
|
|
length: range, // 锥形的高度,可以根据需要调整
|
|
topRadius: 0,
|
|
topRadius: 0,
|
|
bottomRadius: range / 2,
|
|
bottomRadius: range / 2,
|
|
- material: this.Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
|
|
|
|
+ material: Cesium.Color.BLUE.withAlpha(0.5), // 设置锥形的颜色和透明度
|
|
outline: true,
|
|
outline: true,
|
|
- outlineColor: this.Cesium.Color.BLUE,
|
|
|
|
|
|
+ outlineColor: Cesium.Color.BLUE,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
this.nameIdList.push({
|
|
this.nameIdList.push({
|
|
@@ -1513,27 +1516,27 @@ export default {
|
|
if (id == this.satelliteRange[i].satelliteId) {
|
|
if (id == this.satelliteRange[i].satelliteId) {
|
|
//是卫星
|
|
//是卫星
|
|
let rangeEntity = viewer.entities.getById(this.satelliteRange[i].rangeId)
|
|
let rangeEntity = viewer.entities.getById(this.satelliteRange[i].rangeId)
|
|
- let position = new this.Cesium.Cartesian3(x, y, z);
|
|
|
|
|
|
+ let position = new Cesium.Cartesian3(x, y, z);
|
|
let cylinderposition = this.convertWorldToCartographic(position)
|
|
let cylinderposition = this.convertWorldToCartographic(position)
|
|
|
|
|
|
- cylinderposition = this.Cesium.Cartesian3.fromDegrees(cylinderposition.longitude, cylinderposition.latitude, cylinderposition.height / 10.0);
|
|
|
|
|
|
+ cylinderposition = Cesium.Cartesian3.fromDegrees(cylinderposition.longitude, cylinderposition.latitude, cylinderposition.height / 10.0);
|
|
let oldPosition = viewer.entities.getById(id).position._value
|
|
let oldPosition = viewer.entities.getById(id).position._value
|
|
//设置方向,根据实体的位置来配置方向
|
|
//设置方向,根据实体的位置来配置方向
|
|
- entity.orientation = new this.Cesium.VelocityOrientationProperty(entity.position);
|
|
|
|
|
|
+ entity.orientation = new Cesium.VelocityOrientationProperty(entity.position);
|
|
//设置实体位置
|
|
//设置实体位置
|
|
entity.position.setValue(position)
|
|
entity.position.setValue(position)
|
|
//设置方向,根据实体的位置来配置方向
|
|
//设置方向,根据实体的位置来配置方向
|
|
- rangeEntity.orientation = new this.Cesium.VelocityOrientationProperty(rangeEntity.position);
|
|
|
|
|
|
+ rangeEntity.orientation = new Cesium.VelocityOrientationProperty(rangeEntity.position);
|
|
//设置实体位置getValue
|
|
//设置实体位置getValue
|
|
rangeEntity.position.setValue(cylinderposition)
|
|
rangeEntity.position.setValue(cylinderposition)
|
|
this.markSatelliteLine(oldPosition, position, 'Blue', viewer)
|
|
this.markSatelliteLine(oldPosition, position, 'Blue', viewer)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//终点位置
|
|
//终点位置
|
|
- let position = new this.Cesium.Cartesian3(x, y, z);
|
|
|
|
|
|
+ let position = new Cesium.Cartesian3(x, y, z);
|
|
let oldPosition = viewer.entities.getById(id).position._value
|
|
let oldPosition = viewer.entities.getById(id).position._value
|
|
//设置方向,根据实体的位置来配置方向
|
|
//设置方向,根据实体的位置来配置方向
|
|
- entity.orientation = new this.Cesium.VelocityOrientationProperty(entity.position);
|
|
|
|
|
|
+ entity.orientation = new Cesium.VelocityOrientationProperty(entity.position);
|
|
//设置实体位置
|
|
//设置实体位置
|
|
entity.position.setValue(position)
|
|
entity.position.setValue(position)
|
|
this.markSatelliteLine(oldPosition, position, 'Blue', viewer)
|
|
this.markSatelliteLine(oldPosition, position, 'Blue', viewer)
|
|
@@ -1545,7 +1548,7 @@ export default {
|
|
let health = 100
|
|
let health = 100
|
|
for (let key in this.missileList) {
|
|
for (let key in this.missileList) {
|
|
let missilePos = viewer.entities.getById(this.missileList[key].id).position._value
|
|
let missilePos = viewer.entities.getById(this.missileList[key].id).position._value
|
|
- if (this.Cesium.Cartesian3.distance(radarPos, missilePos) <= this.thaadList[name].range) {//距离小于range
|
|
|
|
|
|
+ if (Cesium.Cartesian3.distance(radarPos, missilePos) <= this.thaadList[name].range) {//距离小于range
|
|
health = health * (100-this.missileList[key].disturb) * 0.01
|
|
health = health * (100-this.missileList[key].disturb) * 0.01
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1584,7 +1587,7 @@ export default {
|
|
for (let item in this.thaadList) {
|
|
for (let item in this.thaadList) {
|
|
console.log('this.thaadList[item].fire_number :>> ', this.thaadList[item].fire_number);
|
|
console.log('this.thaadList[item].fire_number :>> ', this.thaadList[item].fire_number);
|
|
let radarPos = viewer.entities.getById(this.thaadList[item].id).position._value
|
|
let radarPos = viewer.entities.getById(this.thaadList[item].id).position._value
|
|
- if (this.Cesium.Cartesian3.distance(radarPos, missilePos) <= this.thaadList[item].range * this.thaadList[item].health * 0.01&&status!=='逃脱拦截') {
|
|
|
|
|
|
+ if (Cesium.Cartesian3.distance(radarPos, missilePos) <= this.thaadList[item].range * this.thaadList[item].health * 0.01&&status!=='逃脱拦截') {
|
|
this.findMissile++
|
|
this.findMissile++
|
|
// 导弹进入了被干扰后的雷达探测范围,判断被拦截 移除实体,删除信息
|
|
// 导弹进入了被干扰后的雷达探测范围,判断被拦截 移除实体,删除信息
|
|
if(this.thaadList[item].fire_number>=this.missileList[key].toll_number+1){
|
|
if(this.thaadList[item].fire_number>=this.missileList[key].toll_number+1){
|
|
@@ -1664,7 +1667,7 @@ export default {
|
|
})
|
|
})
|
|
let radar = viewer.entities.getById(id)
|
|
let radar = viewer.entities.getById(id)
|
|
let newRange = range * health * 0.01
|
|
let newRange = range * health * 0.01
|
|
- radar.ellipsoid.radii = new this.Cesium.Cartesian3(newRange, newRange, newRange);
|
|
|
|
|
|
+ radar.ellipsoid.radii = new Cesium.Cartesian3(newRange, newRange, newRange);
|
|
},
|
|
},
|
|
isObjectEmpty(obj) {
|
|
isObjectEmpty(obj) {
|
|
for (let key in obj) {
|
|
for (let key in obj) {
|
|
@@ -1687,7 +1690,7 @@ export default {
|
|
else {
|
|
else {
|
|
for (let key in this.missileList) {
|
|
for (let key in this.missileList) {
|
|
let missilePos = viewer.entities.getById(this.missileList[key].id).position._value
|
|
let missilePos = viewer.entities.getById(this.missileList[key].id).position._value
|
|
- if (this.Cesium.Cartesian3.distance(this.centerPosition, missilePos) <= 10) {
|
|
|
|
|
|
+ if (Cesium.Cartesian3.distance(this.centerPosition, missilePos) <= 10) {
|
|
this.messageList.push({
|
|
this.messageList.push({
|
|
order: this.order,
|
|
order: this.order,
|
|
time: time,
|
|
time: time,
|