From 9fa6e9ea26470378bec1628de2968d52c3bc135f Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 28 Mar 2022 10:52:30 +0800
Subject: [PATCH] 兼容问题处理
---
src/components/map/index.vue | 62 ++++++++++++++++++++++++------
1 files changed, 49 insertions(+), 13 deletions(-)
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index 31e5896..da5d9ff 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -29,7 +29,12 @@
"
>智慧校区</div>
- <dimension />
+ <dimension
+ :wheelFlag="wheelFlag"
+ :startWheel="startWheel"
+ :startSmallWheel="startSmallWheel"
+ @change-wheel="changeWheel"
+ />
<calender v-if="calenderShow" />
@@ -70,7 +75,10 @@
},
data () {
return {
- samllMapFlag: false
+ samllMapFlag: false,
+ wheelFlag: true,
+ startWheel: false,
+ startSmallWheel: false
}
},
watch: {
@@ -227,14 +235,15 @@
preserveDrawingBuffer: true
}
}
- }).setOptions({
- // showAtmosphere: false, 大气层
- showMoon: true, // 月亮
- showSun: true, // 太阳
- skyBox: {
- show: true
- }
})
+ // .setOptions({
+ // // showAtmosphere: false, 大气层
+ // showMoon: true, // 月亮
+ // showSun: true, // 太阳
+ // skyBox: {
+ // show: true
+ // }
+ // })
// const chartLayer = new global.DC.ChartLayer('busLayer').addTo(global.viewer)
@@ -242,9 +251,9 @@
// global.viewer.scene.backgroundColor = global.DC.Namespace.Cesium.Color.fromBytes(245, 244, 238)
- global.viewer.use(new global.DC.Weather())
- global.viewer.weather.cloud.enable = true
- global.viewer.weather.cloud.rotateAmount = 0.02
+ // global.viewer.use(new global.DC.Weather())
+ // global.viewer.weather.cloud.enable = true
+ // global.viewer.weather.cloud.rotateAmount = 0.02
that.$store.commit('SET_VIEWEREXIST', true)
@@ -294,6 +303,30 @@
var isLeftTrigger = false
var isRightTrigger = false
+
+ handlerL.setInputAction(function (movement) {
+ that.startWheel = true
+ if (movement > 0) {
+ // 向下
+ that.wheelFlag = true
+ } else {
+ // 向上
+ that.wheelFlag = false
+ }
+ }, global.DC.Namespace.Cesium.ScreenSpaceEventType.WHEEL)
+
+ handlerR.setInputAction(function (movement) {
+ that.startSmallWheel = true
+ if (that.samllMapFlag) {
+ if (movement > 0) {
+ // 向下
+ that.wheelFlag = true
+ } else {
+ // 向上
+ that.wheelFlag = false
+ }
+ }
+ }, global.DC.Namespace.Cesium.ScreenSpaceEventType.WHEEL)
handlerL.setInputAction(function (movement) {
isLeftTrigger = true
@@ -363,7 +396,7 @@
// Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
// fromDegrees()方法,将经纬度和高程转换为世界坐标
destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
- 115.871863, 28.743861, 1400.0
+ 116.35381525, 27.95839468, 1950.0
),
orientation: {
// 指向
@@ -550,6 +583,9 @@
global.DC.ready(initViewer)
},
methods: {
+ changeWheel (val, type) {
+ this[type] = val
+ },
mapClick (e) {
this.$refs.campusNavRoute.shortcutShow(e)
this.$refs.campusBuildingSearch.shortcutShow(e)
--
Gitblit v1.9.3