From 4dab9528d8e69c0c3f8ce03a7d4617bb13ecec8d Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Thu, 31 Mar 2022 14:24:24 +0800
Subject: [PATCH] +注释
---
src/components/map/index.vue | 100 +++++++++++++++++++++++++++++++++++--------------
1 files changed, 71 insertions(+), 29 deletions(-)
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index f59faf6..5421c65 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -15,23 +15,28 @@
<div
style="
- position: fixed;
- left: 4px;
- bottom: 4px;
- width: 80px;
- line-height: 24px;
- text-align: center;
- color: #fff;
- font-size: 14px;
- border-radius: 4px;
- background: #2196f3ed;
- z-index: 11;
- "
+ position: fixed;
+ left: 4px;
+ bottom: 4px;
+ width: 80px;
+ line-height: 24px;
+ text-align: center;
+ color: #fff;
+ font-size: 14px;
+ border-radius: 4px;
+ background: #2196f3ed;
+ z-index: 11;
+ "
>智慧校区</div>
- <dimension />
+ <dimension
+ :wheelFlag="wheelFlag"
+ :startWheel="startWheel"
+ :startSmallWheel="startSmallWheel"
+ @change-wheel="changeWheel"
+ />
- <!-- <calender /> -->
+ <calender v-if="calenderShow" />
<left-nav ref="leftNav"></left-nav>
@@ -65,12 +70,15 @@
components: {
mapPopup,
campusBuildingSearch,
- dimension
- // calender
+ dimension,
+ calender
},
data () {
return {
- samllMapFlag: false
+ samllMapFlag: false,
+ wheelFlag: true,
+ startWheel: false,
+ startSmallWheel: false
}
},
watch: {
@@ -158,7 +166,8 @@
'campusNavFlag',
'orgNavBarFlag',
'arcNavBarFlag',
- 'searchPopupFlag'
+ 'searchPopupFlag',
+ 'calenderShow'
])
},
mounted () {
@@ -218,6 +227,11 @@
global.viewer.measure.deactivate()
}
+ if (global.viewer != null) {
+ global.viewer = null
+ global.eagleViewer = null
+ }
+
function initViewer () {
global.viewer = new global.DC.Viewer('viewer-container', {
contextOptions: {
@@ -226,14 +240,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)
@@ -241,9 +256,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)
@@ -293,6 +308,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
@@ -362,7 +401,7 @@
// Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
// fromDegrees()方法,将经纬度和高程转换为世界坐标
destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
- 115.871863, 28.743861, 1400.0
+ 116.35381525, 27.95839468, 1950.0
),
orientation: {
// 指向
@@ -549,6 +588,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