From 05e12ffc0cd7ca5cc0469cc7b69f9a524d722d1c Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 13 Jan 2022 17:46:52 +0800
Subject: [PATCH] 忽略模型文件

---
 src/components/leftNav/index.vue |   68 ++++++++++++++++++++++++++++++----
 1 files changed, 60 insertions(+), 8 deletions(-)

diff --git a/src/components/leftNav/index.vue b/src/components/leftNav/index.vue
index a735ae6..c1be958 100644
--- a/src/components/leftNav/index.vue
+++ b/src/components/leftNav/index.vue
@@ -133,9 +133,9 @@
             viewer.addLayer(this.tagLayer)
             this.wayLayer = new this.DC.HtmlLayer('wayLayer')
             viewer.addLayer(this.wayLayer)
-            this.sceneLayer = new this.DC.VectorLayer('sceneLayer')
+            this.sceneLayer = new this.DC.HtmlLayer('sceneLayer')
             viewer.addLayer(this.sceneLayer)
-            this.monitorLayer = new this.DC.VectorLayer('monitorLayer')
+            this.monitorLayer = new this.DC.HtmlLayer('monitorLayer')
             viewer.addLayer(this.monitorLayer)
             this.aedLayer = new this.DC.VectorLayer('aedLayer')
             viewer.addLayer(this.aedLayer)
@@ -186,19 +186,71 @@
 
             getMonitorList().then(res => {
                 res.data.data.forEach(item => {
-                    const billboard = new this.DC.Billboard(new that.DC.Position(Number(item.jd), Number(item.wd), 0), '/img/leftnav/map-monitor.png')
-                    billboard.size = [20, 20]
-                    this.monitorLayer.addOverlay(billboard)
+                    console.log(item, 456)
+                    const divIcon = new this.DC.DivIcon(
+                        new that.DC.Position(Number(item.jd), Number(item.wd), 0),
+                        `
+                        <img class="monitor-entitys-box" src="/img/leftnav/map-monitor.png" alt="">
+                        `
+                    )
+                    divIcon.attrParams = item
+                    this.monitorLayer.addOverlay(divIcon)
+
+                    divIcon.on(that.DC.MouseEventType.CLICK, e => {
+                        this.$store.commit('SET_PANORAMAPOPUP', false)
+                        this.$store.commit('SET_DETAILSPOPUP', false)
+                        this.$store.commit('SET_STATENAME', e.overlay.attrParams.mechanismname)
+                        this.$store.commit('SET_MONITORURL', e.overlay.attrParams.videourl)
+                        // eslint-disable-next-line new-cap
+                        var positions = this.DC.Transform.transformWGS84ToCartesian(new this.DC.Position.fromArray([Number(item.jd), Number(item.wd), 0, 0, -90, 0]))
+                        this.viewer.scene.globe.depthTestAgainstTerrain = false
+                        // eslint-disable-next-line no-unused-vars
+                        var monitor = new this.DC.PanoramaBox(this.viewer, {
+                            domId: 'MonitorBox',
+                            position: [
+                                positions
+                            ]
+                        })
+
+                        this.$store.commit('SET_MONITORPOPUP', true)
+                    })
                 })
+
                 this.monitorLayer.show = false
             })
 
             getSceneList().then(res => {
                 res.data.data.forEach(item => {
-                    const billboard = new this.DC.Billboard(new that.DC.Position(Number(item.jd), Number(item.wd), 0), '/img/leftnav/map-panorama.png')
-                    billboard.size = [20, 20]
-                    this.sceneLayer.addOverlay(billboard)
+                    console.log(item, 123)
+                    const divIcon = new this.DC.DivIcon(
+                        new that.DC.Position(Number(item.jd), Number(item.wd), 0),
+                        `
+                        <img class="scene-entitys-box" src="/img/leftnav/map-panorama.png" alt="">
+                        `
+                    )
+                    divIcon.attrParams = item
+                    this.sceneLayer.addOverlay(divIcon)
+
+                    divIcon.on(that.DC.MouseEventType.CLICK, e => {
+                        this.$store.commit('SET_DETAILSPOPUP', false)
+                        this.$store.commit('SET_MONITORPOPUP', false)
+                        this.$store.commit('SET_STATENAME', e.overlay.attrParams.mechanismname)
+                        this.$store.commit('SET_PANORAMAURL', e.overlay.attrParams.panoramaurl)
+                        // eslint-disable-next-line new-cap
+                        var positions = this.DC.Transform.transformWGS84ToCartesian(new this.DC.Position.fromArray([Number(item.jd), Number(item.wd), 0, 0, -90, 0]))
+                        this.viewer.scene.globe.depthTestAgainstTerrain = false
+                        // eslint-disable-next-line no-unused-vars
+                        var panorama = new this.DC.PanoramaBox(this.viewer, {
+                            domId: 'PanoramaBox',
+                            position: [
+                                positions
+                            ]
+                        })
+
+                        this.$store.commit('SET_PANORAMAPOPUP', true)
+                    })
                 })
+
                 this.sceneLayer.show = false
             })
 

--
Gitblit v1.9.3