From 43a4e322ff588f463984eb23b0e4270f1e9d690c Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 31 Dec 2021 13:57:22 +0800
Subject: [PATCH] +3d模型点击高亮
---
src/components/mobilemap/index.vue | 29 +++++++++++++-
src/store/modules/mobile.js | 34 +++++++---------
src/components/mobileCortrol/index.vue | 4 +-
3 files changed, 43 insertions(+), 24 deletions(-)
diff --git a/src/components/mobileCortrol/index.vue b/src/components/mobileCortrol/index.vue
index bc66720..f3e58af 100644
--- a/src/components/mobileCortrol/index.vue
+++ b/src/components/mobileCortrol/index.vue
@@ -5,8 +5,8 @@
</div>
<div
class="m-l-inbut zoom-in m-l-inbut-2d"
- :class="{ active: dimension == '2D' }"
- @click="zoomIn('2D')"
+ :class="{ active: dimension == '3D' }"
+ @click="zoomIn('3D')"
>
3 维
</div>
diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index 4302b23..b0d0d2f 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -372,9 +372,7 @@
introduce: e.layer._id,
}
);
- });
- //移动事件
- tileset.on(that.DC.MouseEventType.MOUSE_MOVE, (e) => {
+ //高亮
silhouetteBlue.selected = [];
if (that.DC.Namespace.Cesium.defined(highlighted.feature)) {
@@ -398,6 +396,31 @@
);
}
});
+ //移动事件
+ // tileset.on(that.DC.MouseEventType.MOUSE_MOVE, (e) => {
+ // silhouetteBlue.selected = [];
+
+ // if (that.DC.Namespace.Cesium.defined(highlighted.feature)) {
+ // highlighted.feature.color = highlighted.originalColor;
+ // highlighted.feature = undefined;
+ // }
+
+ // if (e.feature !== selected.feature) {
+ // silhouetteBlue.selected = [e.feature];
+
+ // highlighted.feature = e.feature;
+
+ // that.DC.Namespace.Cesium.Color.clone(
+ // e.feature.color,
+ // highlighted.originalColor
+ // );
+ // e.feature.color = that.DC.Namespace.Cesium.Color.fromBytes(
+ // 155,
+ // 255,
+ // 175
+ // );
+ // }
+ // });
tilesetLayer["changesilhouetteBlue"] = () => {
silhouetteBlue.selected = [];
};
diff --git a/src/store/modules/mobile.js b/src/store/modules/mobile.js
index 922f776..8373b0d 100644
--- a/src/store/modules/mobile.js
+++ b/src/store/modules/mobile.js
@@ -95,20 +95,20 @@
MSET_MORENWEIZHI(state, data) {
state.startPointFn = data
},
- // 开关飞入点图标
- MSET_OPENPOINTEL(state, val) {
- if (val) {
- state.pointLayerData.img = state.pointLayerData.checked
- state[state.pointLayerData.layer].show = true
- } else {
- state.pointLayerData.img = state.pointLayerData.normal
- state[state.pointLayerData.layer].show = false
- }
- },
+ // // 开关飞入点图标
+ // MSET_OPENPOINTEL(state, val) {
+ // if (val) {
+ // state.pointLayerData.img = state.pointLayerData.checked
+ // state[state.pointLayerData.layer].show = true
+ // } else {
+ // state.pointLayerData.img = state.pointLayerData.normal
+ // state[state.pointLayerData.layer].show = false
+ // }
+ // },
//切换2D和2.5D
- MSET_DIMENSION(state, data) {
+ MSET_DIMENSION(state, data) {//3d,2.5d转换事件
state.dimension = data;
- if (data == "2D") { // 改数据为3d数据
+ if (data == "3D") { // 改数据为3d数据
state.dimensionData = {// 维度镜头数据
heading: 0,
pitch: -45,
@@ -131,13 +131,9 @@
roll: 0
};
state.tilesetLayer.show = false//隐藏3d图形
-
state.newLayer = state.usetowpointfive();//添加2.5d图形贴片
-
state.wallLayer.show = true//打开瀑布
-
state.startPointFn();//移动默认视角
-
}
},
//切换控制
@@ -164,7 +160,7 @@
let clas, Flys;
const nowHeight = Math.ceil(state.mviewer.camera.positionCartographic.height);
console.log(data)
- if (state.dimension == "2D") {
+ if (state.dimension == "3D") {
Flys = [
+data.lntLat[0] + 0.01197,
// +data.lntLat[1] - 0.0001,
@@ -384,7 +380,7 @@
state.mviewer.camera.lookAtTransform(global.DC.Namespace.Cesium.Matrix4.IDENTITY)
// console.log(global.DC.Namespace.Cesium.Matrix4.IDENTITY)
},
- MSET_DIMENSIONS({ state, commit, dispatch }, val) {
+ MSET_DIMENSIONS({ state, commit, dispatch }, val) {//3d,2.5d转换事件
commit("MSET_DIMENSION", val);
//控制高度
const height = Math.ceil(state.mviewer.camera.positionCartographic.height);
@@ -403,7 +399,7 @@
},
});
},
- MSET_GOTOCC({ state, commit, dispatch }, val) {
+ MSET_GOTOCC({ state, commit, dispatch }, val) {//测试移动位置
// commit("MSET_DIMENSION", val);
//控制高度
// const height = Math.ceil(state.mviewer.camera.positionCartographic.height);
--
Gitblit v1.9.3