|
|
@@ -456,31 +456,53 @@ export default {
|
|
|
// { label: "其他参数F", value: "...." },
|
|
|
];
|
|
|
|
|
|
- // for (let i = 0; i <= this.randomNum(1, 9); i++) {
|
|
|
- // statusItems.push(statusArray[i]);
|
|
|
- // }
|
|
|
statusItems = statusArray;
|
|
|
|
|
|
- console.log("statusItems====>>>>", statusItems);
|
|
|
-
|
|
|
- // const billboardImage = advancedGenerator.generateAdvancedBillboard({
|
|
|
- // title: val.name,
|
|
|
- // statusItems,
|
|
|
- // borderGradient: ["#00e5ff", "#2979ff"],
|
|
|
- // });
|
|
|
-
|
|
|
- // const entityxy = viewer.entities.add({
|
|
|
- // name: val.name,
|
|
|
- // position,
|
|
|
- // billboard: {
|
|
|
- // image: billboardImage,
|
|
|
- // scale: 1,
|
|
|
- // verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 原来已经是CENTER,现在改为BOTTOM
|
|
|
- // pixelOffset: new Cesium.Cartesian2(80, -50), // 原来是-20,现在改为30,向上移动
|
|
|
- // eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
|
|
|
- // // heightReference: Cesium.HeightReference.NONE,
|
|
|
- // },
|
|
|
- // });
|
|
|
+ const billboardImage = advancedGenerator.generateAdvancedBillboard({
|
|
|
+ title: val.name,
|
|
|
+ statusItems,
|
|
|
+ // borderGradient: ["#00e5ff", "#2979ff"],
|
|
|
+ borderGradient: ["#ccc", "#ccc"],
|
|
|
+ backgroundColor: "transparent",
|
|
|
+ padding: 6,
|
|
|
+ titleHeight: 22,
|
|
|
+ itemHeight: 17,
|
|
|
+ titleColor: "#1890ff",
|
|
|
+ titleStrokeStyle: "#000",
|
|
|
+ titleStrokeWidth: 1,
|
|
|
+ labelStrokeStyle: "#000",
|
|
|
+ labelStrokeWidth: 1,
|
|
|
+ valueStrokeStyle: "#000",
|
|
|
+ valueStrokeWidth: 1,
|
|
|
+ });
|
|
|
+
|
|
|
+ const entityxy = viewer.entities.add({
|
|
|
+ name: val.name,
|
|
|
+ position,
|
|
|
+ billboard: {
|
|
|
+ image: billboardImage,
|
|
|
+ scale: 1,
|
|
|
+ verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 原来已经是CENTER,现在改为BOTTOM
|
|
|
+ pixelOffset: new Cesium.Cartesian2(80, -50), // 原来是-20,现在改为30,向上移动
|
|
|
+ eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
|
|
|
+ // heightReference: Cesium.HeightReference.NONE,
|
|
|
+ // 近大远小
|
|
|
+ scaleByDistance: new Cesium.NearFarScalar(
|
|
|
+ 6000, // 5010米内
|
|
|
+ 1.2, // 1倍大小
|
|
|
+ 9000, // 10000米外
|
|
|
+ 0.5 // 0.1倍大小
|
|
|
+ ),
|
|
|
+
|
|
|
+ // 透明度渐变
|
|
|
+ translucencyByDistance: new Cesium.NearFarScalar(
|
|
|
+ 6000, // 500米内
|
|
|
+ 1.0, // 完全不透明
|
|
|
+ 9000, // 3000米外
|
|
|
+ 0.5 // 完全透明
|
|
|
+ ),
|
|
|
+ },
|
|
|
+ });
|
|
|
|
|
|
const btn = document.getElementById("windBtn");
|
|
|
|
|
|
@@ -497,7 +519,7 @@ export default {
|
|
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
|
// 模型贴地
|
|
|
- // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
+ // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
},
|
|
|
// label: {
|
|
|
// // text: val.name ? val.name : val.plantname,
|
|
|
@@ -524,6 +546,7 @@ export default {
|
|
|
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
|
|
this.allWindEntitys.push({ entity, handler });
|
|
|
},
|
|
|
+
|
|
|
randomNum(minNum, maxNum) {
|
|
|
switch (arguments.length) {
|
|
|
case 1:
|
|
|
@@ -534,6 +557,7 @@ export default {
|
|
|
return 0;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
//添加svg或png贴图
|
|
|
addSvgs(viewer, uri, lon, lat, val, index) {
|
|
|
let that = this;
|
|
|
@@ -549,7 +573,7 @@ export default {
|
|
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
|
// 模型贴地
|
|
|
- // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
+ // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
// 核心:使用 CallbackProperty 实现旋转动画
|
|
|
rotation: new Cesium.CallbackProperty(function (time) {
|
|
|
// 每 3 秒转一圈(可调速度)
|
|
|
@@ -895,9 +919,9 @@ export default {
|
|
|
},
|
|
|
duration: 3.0,
|
|
|
complete: function () {
|
|
|
- console.log('飞入完成,启用拖拽限制逻辑');
|
|
|
- enableHeightBasedDragControl();
|
|
|
- }
|
|
|
+ console.log("飞入完成,启用拖拽限制逻辑");
|
|
|
+ enableHeightBasedDragControl();
|
|
|
+ },
|
|
|
});
|
|
|
// ===== 控制逻辑:根据高度决定是否允许拖拽 =====
|
|
|
function enableHeightBasedDragControl() {
|