修复图片显示问题
This commit is contained in:
parent
4ded7b26c9
commit
50a860fdf7
@ -1329,51 +1329,59 @@ export default {
|
||||
}
|
||||
},
|
||||
addJobLine(info, isFinish) {
|
||||
console.log('任务信息', info)
|
||||
let load = renderTaskInfo[`${info.id}-${info.uavList[0].uavId}`]
|
||||
// 参数和数据校验
|
||||
console.log(info, info.uavList, 777777777777);
|
||||
|
||||
if (!info || !Array.isArray(info.uavList) || info.uavList.length === 0) return;
|
||||
const uav = info.uavList[0];
|
||||
if (!Array.isArray(uav.airlineList) || uav.airlineList.length === 0) return;
|
||||
const key = `${info.id}-${uav.uavId}`;
|
||||
let load = renderTaskInfo[key];
|
||||
console.log(load, key, 3333333);
|
||||
|
||||
if (load) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
let routes = []
|
||||
let startHeight = 0
|
||||
let endHeight = 0
|
||||
info.uavList[0].airlineList.forEach((item, index) => {
|
||||
let routes = [];
|
||||
let startHeight = 0;
|
||||
let endHeight = 0;
|
||||
uav.airlineList.forEach((item, index) => {
|
||||
if (index === 0) {
|
||||
startHeight = item.flightStartHeight
|
||||
startHeight = item.startHeight;
|
||||
}
|
||||
if (index === info.uavList[0].airlineList.length - 1) {
|
||||
endHeight = item.flightEndHeight
|
||||
if (index === uav.airlineList.length - 1) {
|
||||
endHeight = item.endHeight;
|
||||
}
|
||||
routes.push([item.flightStartLon, item.flightStartLat, item.flightStartHeight])
|
||||
routes.push([item.flightEndLon, item.flightEndLat, item.flightEndHeight])
|
||||
})
|
||||
routes.unshift([info.uavList[0].startLon, info.uavList[0].startLat, startHeight])
|
||||
routes.push([info.uavList[0].endLon, info.uavList[0].endLat, endHeight])
|
||||
let positions = []
|
||||
let minLon, maxLon, minLat, maxLat
|
||||
routes.push([item.startLon, item.startLat, item.startHeight]);
|
||||
routes.push([item.endLon, item.endLat, item.endHeight]);
|
||||
});
|
||||
routes.unshift([uav.startLon, uav.startLat, startHeight]);
|
||||
routes.push([uav.endLon, uav.endLat, endHeight]);
|
||||
let positions = [];
|
||||
let minLon, maxLon, minLat, maxLat;
|
||||
routes.forEach((item, index) => {
|
||||
if (index === 0) {
|
||||
minLon = item[0]
|
||||
maxLon = item[0]
|
||||
minLat = item[1]
|
||||
maxLat = item[1]
|
||||
minLon = item[0];
|
||||
maxLon = item[0];
|
||||
minLat = item[1];
|
||||
maxLat = item[1];
|
||||
} else {
|
||||
minLon = Math.min(minLon, item[0])
|
||||
maxLon = Math.max(maxLon, item[0])
|
||||
minLat = Math.min(minLat, item[1])
|
||||
maxLat = Math.max(maxLat, item[1])
|
||||
minLon = Math.min(minLon, item[0]);
|
||||
maxLon = Math.max(maxLon, item[0]);
|
||||
minLat = Math.min(minLat, item[1]);
|
||||
maxLat = Math.max(maxLat, item[1]);
|
||||
}
|
||||
positions.push(DT.Cesium.Cartesian3.fromDegrees(item[0], item[1], item[2]))
|
||||
})
|
||||
let currentIndex = 0
|
||||
let currentPosition = positions[0].clone()
|
||||
positions.push(DT.Cesium.Cartesian3.fromDegrees(item[0], item[1], item[2]));
|
||||
});
|
||||
if (positions.length === 0) return;
|
||||
let currentIndex = 0;
|
||||
let currentPosition = positions[0].clone();
|
||||
if (isFinish) {
|
||||
currentIndex = positions.length - 1
|
||||
currentPosition = positions[currentIndex].clone()
|
||||
currentIndex = positions.length - 1;
|
||||
currentPosition = positions[currentIndex].clone();
|
||||
}
|
||||
|
||||
let pathEntity = new DT.DirectionPath({
|
||||
id: `${info.id}-${info.uavList[0].uavId}~baseline`,
|
||||
id: `${key}~baseline`,
|
||||
positions: positions,
|
||||
dataFit: false,
|
||||
currentPosition: currentPosition,
|
||||
@ -1401,19 +1409,18 @@ export default {
|
||||
scale: 0.5,
|
||||
show: true,
|
||||
style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
|
||||
text: info.uavList[0].uavName,
|
||||
text: uav.uavName,
|
||||
verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
|
||||
disableDepthTestDistance: 10000
|
||||
},
|
||||
billboardConfig: {
|
||||
image: process.env.BASE_URL + 'static/img/icon_wrj.png',
|
||||
disableDepthTestDistance: 10000
|
||||
// enableRotation: true
|
||||
},
|
||||
enableRepeatAdjust: false,
|
||||
})
|
||||
});
|
||||
let pathEntity2 = new DT.DirectionPath({
|
||||
id: `${info.id}-${info.uavList[0].uavId}~baseline`,
|
||||
id: `${key}~baseline-radar`,
|
||||
positions: positions,
|
||||
dataFit: false,
|
||||
currentPosition: currentPosition,
|
||||
@ -1441,53 +1448,48 @@ export default {
|
||||
scale: 0.5,
|
||||
show: true,
|
||||
style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
|
||||
text: info.uavList[0].uavName,
|
||||
text: uav.uavName,
|
||||
verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
|
||||
disableDepthTestDistance: 10000
|
||||
},
|
||||
billboardConfig: {
|
||||
image: process.env.BASE_URL + 'static/img/icon_wrj.png',
|
||||
disableDepthTestDistance: 10000
|
||||
// enableRotation: true
|
||||
},
|
||||
enableRepeatAdjust: false,
|
||||
})
|
||||
console.log('调用添加方法了吗')
|
||||
lodLayer.add(pathEntity)
|
||||
radarLayer.add(pathEntity2)
|
||||
|
||||
// 添加图片
|
||||
|
||||
|
||||
renderTaskInfo[`${info.id}-${info.uavList[0].uavId}`] = {
|
||||
});
|
||||
lodLayer.add(pathEntity);
|
||||
radarLayer.add(pathEntity2);
|
||||
renderTaskInfo[key] = {
|
||||
entity: pathEntity,
|
||||
entity2: pathEntity2,
|
||||
picture: {}
|
||||
}
|
||||
|
||||
info.uavList.forEach(uav => {
|
||||
uav.payloadList.forEach(payload => {
|
||||
};
|
||||
info.uavList.forEach(uavItem => {
|
||||
if (uavItem.payloadList && Array.isArray(uavItem.payloadList)) {
|
||||
uavItem.payloadList.forEach(payload => {
|
||||
if (payload.imageList && Array.isArray(payload.imageList)) {
|
||||
payload.imageList.forEach(image => {
|
||||
this.addMarkPicture2(image)
|
||||
})
|
||||
})
|
||||
})
|
||||
this.addMarkPicture2(image);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// 适当扩大视角范围
|
||||
let lonDiff = (maxLon - minLon) / 2
|
||||
let latDiff = (maxLat - minLat) / 2
|
||||
minLon -= lonDiff
|
||||
maxLon += lonDiff
|
||||
minLat -= latDiff
|
||||
maxLat += latDiff
|
||||
|
||||
let lonDiff = (maxLon - minLon) / 2;
|
||||
let latDiff = (maxLat - minLat) / 2;
|
||||
minLon -= lonDiff;
|
||||
maxLon += lonDiff;
|
||||
minLat -= latDiff;
|
||||
maxLat += latDiff;
|
||||
let boundingPosition = [
|
||||
DT.Cesium.Cartesian3.fromDegrees(minLon, minLat),
|
||||
DT.Cesium.Cartesian3.fromDegrees(minLon, maxLat),
|
||||
DT.Cesium.Cartesian3.fromDegrees(maxLon, minLat),
|
||||
DT.Cesium.Cartesian3.fromDegrees(minLon, maxLat),
|
||||
DT.Cesium.Cartesian3.fromDegrees(maxLon, maxLat),
|
||||
]
|
||||
// console.log('最小最大', minLon, maxLon, minLat, maxLat)
|
||||
viewer.cesiumViewer.camera.flyToBoundingSphere(DT.Cesium.BoundingSphere.fromPoints(boundingPosition), { duration: 0.1 })
|
||||
];
|
||||
viewer.cesiumViewer.camera.flyToBoundingSphere(DT.Cesium.BoundingSphere.fromPoints(boundingPosition), { duration: 0.1 });
|
||||
},
|
||||
removeJobLine(jobId, uavId) {
|
||||
let load = renderTaskInfo[`${jobId}-${uavId}`]
|
||||
@ -2853,9 +2855,11 @@ export default {
|
||||
// }));
|
||||
// if (this.tempAdd) return
|
||||
// this.tempAdd = true
|
||||
console.log(data, renderTaskInfo, 'tupiantupian');
|
||||
|
||||
let id = `${data.jobId}-${data.uavId}`
|
||||
let target = renderTaskInfo[id]
|
||||
if (target) {
|
||||
// let target = renderTaskInfo[id]
|
||||
// if (target) {
|
||||
let cby_bg_data = [
|
||||
data.left1Lon, data.left1Lat,
|
||||
data.left2Lon, data.left2Lat,
|
||||
@ -2866,14 +2870,11 @@ export default {
|
||||
id: `${data.jobId}-${data.uavId}~${data.fileId}-picture`,
|
||||
name: '背景',
|
||||
polygon: {
|
||||
// hierarchy: DT.Cesium.Cartesian3.fromDegreesArrayHeights(cby_bg_data),
|
||||
hierarchy: DT.Cesium.Cartesian3.fromDegreesArray(cby_bg_data),
|
||||
perPositionHeight: true,
|
||||
material: new DT.Cesium.ImageMaterialProperty({
|
||||
image: window.config.imagePath + data.relativePath,
|
||||
// image: process.env.BASE_URL + 'static/img/ttt.tif',
|
||||
// image: process.env.BASE_URL + 'static/img/pic.png',
|
||||
}),//new Cesium.Color(0.29, 0.85, 0.89, 0.5), //Cesium.Color.PALETURQUOISE.withAlpha(0.5),
|
||||
}),
|
||||
outline: true,
|
||||
outlineColor: DT.Cesium.Color.WHITE,
|
||||
outlineWidth: 2, //很多电脑当宽度>1时,没用
|
||||
@ -2918,11 +2919,11 @@ export default {
|
||||
markLineArr.push(markLine)
|
||||
})
|
||||
}
|
||||
target.picture[`${data.fileId}-picture`] = {
|
||||
pictureEntity: entity,
|
||||
markArr: markLineArr
|
||||
}
|
||||
}
|
||||
// target.picture[`${data.fileId}-picture`] = {
|
||||
// pictureEntity: entity,
|
||||
// markArr: markLineArr
|
||||
// }
|
||||
// }
|
||||
},
|
||||
addPictureHandle() {
|
||||
console.log('双击事件执行了吗', new Date().getTime())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user