From 2411eb9a84f290fdb44852278c314df826ceb160 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 15 Apr 2022 13:56:47 +0800
Subject: [PATCH] 1

---
 src/components/map/components/dimension.vue |  663 ++++++++++--------------------------------------------
 1 files changed, 128 insertions(+), 535 deletions(-)

diff --git a/src/components/map/components/dimension.vue b/src/components/map/components/dimension.vue
index df1f9b0..9f568c1 100644
--- a/src/components/map/components/dimension.vue
+++ b/src/components/map/components/dimension.vue
@@ -74,23 +74,11 @@
 let layerSATtwo = null
 let tcLayer = null
 
-let slLayer = null
-let bzLayer = null
 let yxLayer = null
 let dxLayer = null
 
-// let viewerHeight = 950
-// let smallViewerHeight = 1950
-
-// const mixVH = 500
-// const maxVH = 950
-// const oneVH = 500
-// const twoVH = 650
-// const fourVH = 800
-// const fiveVH = 950
-
 let viewerHeight = 700
-let smallViewerHeight = 1700
+let heightChange = 700
 
 const mixVH = 150
 const maxVH = 700
@@ -99,6 +87,8 @@
 const twoVH = 300
 const fourVH = 500
 const fiveVH = 700
+
+const heightDifferenceValue = 100
 
 // const wallLayer = null
 
@@ -185,26 +175,6 @@
                         global.DC.Namespace.Cesium.PostProcessStageLibrary.createSilhouetteStage(
                             [silhouetteBlue]
                         )
-                    )
-
-                    slLayer = global.viewer.imageryLayers.addImageryProvider(
-                        new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
-                            url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=9ae78c51a0a28f06444d541148496e36',
-                            subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
-                            format: 'image/jpeg',
-                            show: true,
-                            maximumLevel: 18
-                        })
-                    )
-
-                    bzLayer = global.viewer.imageryLayers.addImageryProvider(
-                        new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
-                            url: 'http://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=9ae78c51a0a28f06444d541148496e36',
-                            subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
-                            format: 'image/jpeg',
-                            show: true,
-                            maximumLevel: 18
-                        })
                     )
 
                     // global.viewer.imageryLayers.addImageryProvider(
@@ -528,146 +498,6 @@
                                     })
                                 }
                             }
-
-                        document.querySelector('.dc-zoom-controller').children[2].onclick =
-                            function () {
-                                if (
-                                    that.dimensionValue != undefined &&
-                                    that.dimensionValue != '真三维'
-                                ) {
-                                    if (viewerHeight == oneVH) {
-                                        global.viewer.camera.setView({
-                                            destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                                                global.viewer.camera.positionCartographic.longitude,
-                                                global.viewer.camera.positionCartographic.latitude,
-                                                twoVH
-                                            ),
-                                            orientation: {
-                                                // 指向
-                                                heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                                                // 视角
-                                                pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                                                roll: 0.0
-                                            }
-                                        })
-                                        viewerHeight = twoVH
-                                        that.$emit('change-wheel', false, 'startWheel')
-                                        that.addBaseLayer()
-                                        return
-                                    }
-
-                                    if (viewerHeight == twoVH) {
-                                        global.viewer.camera.setView({
-                                            destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                                                global.viewer.camera.positionCartographic.longitude,
-                                                global.viewer.camera.positionCartographic.latitude,
-                                                fourVH
-                                            ),
-                                            orientation: {
-                                                // 指向
-                                                heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                                                // 视角
-                                                pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                                                roll: 0.0
-                                            }
-                                        })
-                                        viewerHeight = fourVH
-                                        that.$emit('change-wheel', false, 'startWheel')
-                                        that.addBaseLayer()
-                                        return
-                                    }
-
-                                    if (viewerHeight == fourVH) {
-                                        global.viewer.camera.setView({
-                                            destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                                                global.viewer.camera.positionCartographic.longitude,
-                                                global.viewer.camera.positionCartographic.latitude,
-                                                fiveVH
-                                            ),
-                                            orientation: {
-                                                // 指向
-                                                heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                                                // 视角
-                                                pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                                                roll: 0.0
-                                            }
-                                        })
-                                        viewerHeight = fiveVH
-                                        that.$emit('change-wheel', false, 'startWheel')
-                                        that.addBaseLayer()
-                                    }
-                                }
-                            }
-
-                        document.querySelector('.dc-zoom-controller').children[0].onclick =
-                            function () {
-                                if (
-                                    that.dimensionValue != undefined &&
-                                    that.dimensionValue != '真三维'
-                                ) {
-                                    if (viewerHeight == fiveVH) {
-                                        global.viewer.camera.setView({
-                                            destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                                                global.viewer.camera.positionCartographic.longitude,
-                                                global.viewer.camera.positionCartographic.latitude,
-                                                fourVH
-                                            ),
-                                            orientation: {
-                                                // 指向
-                                                heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                                                // 视角
-                                                pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                                                roll: 0.0
-                                            }
-                                        })
-                                        viewerHeight = fourVH
-                                        that.$emit('change-wheel', false, 'startWheel')
-                                        that.addBaseLayer()
-                                        return
-                                    }
-
-                                    if (viewerHeight == fourVH) {
-                                        global.viewer.camera.setView({
-                                            destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                                                global.viewer.camera.positionCartographic.longitude,
-                                                global.viewer.camera.positionCartographic.latitude,
-                                                twoVH
-                                            ),
-                                            orientation: {
-                                                // 指向
-                                                heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                                                // 视角
-                                                pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                                                roll: 0.0
-                                            }
-                                        })
-                                        viewerHeight = twoVH
-                                        that.$emit('change-wheel', false, 'startWheel')
-                                        that.addBaseLayer()
-                                        return
-                                    }
-
-                                    if (viewerHeight == twoVH) {
-                                        global.viewer.camera.setView({
-                                            destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                                                global.viewer.camera.positionCartographic.longitude,
-                                                global.viewer.camera.positionCartographic.latitude,
-                                                oneVH
-                                            ),
-                                            orientation: {
-                                                // 指向
-                                                heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                                                // 视角
-                                                pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                                                roll: 0.0
-                                            }
-                                        })
-                                        viewerHeight = oneVH
-                                        that.$emit('change-wheel', false, 'startWheel')
-                                        that.addBaseLayer()
-                                    }
-                                }
-                            }
                     })
 
                     global.viewer.on(global.DC.SceneEventType.CAMERA_CHANGED, that.mapCameraEvent)
@@ -808,108 +638,129 @@
         },
 
         addBaseLayer () {
-            this.removeBaseLayer()
-            baseLayer = []
-            this.updateBaseLayer(false)
+            this.updateBaseLayer()
         },
 
-        removeBaseLayer () {
+        raiseBaseLayer (array) {
             if (baseLayer.length > 0) {
-                baseLayer.forEach(item => {
-                    global.viewer.imageryLayers.remove(
-                        item.layer
-                    )
+                array.forEach(item => {
+                    baseLayer.forEach((it, index) => {
+                        if (it.id.indexOf(item.id) != -1 && it.id.indexOf(viewerHeight) != -1) {
+                            it.layer.show = true
+                        }
+                    })
+
+                    baseLayer.forEach((it, index) => {
+                        if (it.id.indexOf(item.id) != -1 && it.id.indexOf(viewerHeight) == -1) {
+                            it.layer.show = false
+
+                            global.viewer.imageryLayers.remove(
+                                it.layer
+                            )
+
+                            baseLayer.splice(index, 1)
+                        }
+                    })
                 })
+
+                console.log(baseLayer)
             }
         },
 
-        updateBaseLayer (flag) {
+        updateBaseLayer () {
             const extent = this.getViewExtend()
-            baseLayerImgUrl.forEach(item => {
-                if (item[viewerHeight]) {
-                    item[viewerHeight].forEach(sm => {
-                        let startFlag = true
 
-                        if (flag == true) {
-                            baseLayer.forEach(dt => {
-                                if (dt.id == sm.id) startFlag = false
-                            })
-                        }
+            const array = baseLayerImgUrl.filter(item => {
+                return item[viewerHeight]
+            })
 
-                        if (startFlag == false) return
+            var oldLayer = []
 
-                        if (
-                            (
-                                sm.rectangle[0] > extent.minx &&
-                                sm.rectangle[1] > extent.miny &&
-                                sm.rectangle[2] < extent.maxx &&
-                                sm.rectangle[3] < extent.maxy
-                            ) ||
-                            (
-                                sm.rectangle[0] < extent.minx &&
-                                sm.rectangle[1] < extent.maxy &&
-                                sm.rectangle[2] > extent.minx &&
-                                sm.rectangle[3] > extent.maxy
-                            ) ||
-                            (
-                                sm.rectangle[0] < extent.maxx &&
-                                sm.rectangle[1] < extent.maxy &&
-                                sm.rectangle[2] > extent.maxx &&
-                                sm.rectangle[3] > extent.maxy
-                            ) ||
-                            (
-                                sm.rectangle[0] < extent.maxx &&
-                                sm.rectangle[1] < extent.miny &&
-                                sm.rectangle[2] > extent.maxx &&
-                                sm.rectangle[3] > extent.miny
-                            ) ||
-                            (
-                                sm.rectangle[0] < extent.minx &&
-                                sm.rectangle[1] < extent.miny &&
-                                sm.rectangle[2] > extent.minx &&
-                                sm.rectangle[3] > extent.miny
-                            ) ||
-                            (
-                                sm.rectangle[0] > extent.minx &&
-                                sm.rectangle[1] < extent.maxy &&
-                                sm.rectangle[2] < extent.maxx &&
-                                sm.rectangle[3] > extent.maxy
-                            ) ||
-                            (
-                                sm.rectangle[0] > extent.minx &&
-                                sm.rectangle[1] > extent.miny &&
-                                sm.rectangle[2] > extent.maxx &&
-                                sm.rectangle[3] < extent.maxy
-                            ) ||
-                            (
-                                sm.rectangle[0] > extent.minx &&
-                                sm.rectangle[1] < extent.miny &&
-                                sm.rectangle[2] < extent.maxx &&
-                                sm.rectangle[3] > extent.miny
-                            ) ||
-                            (
-                                sm.rectangle[0] < extent.minx &&
-                                sm.rectangle[1] > extent.miny &&
-                                sm.rectangle[2] > extent.minx &&
-                                sm.rectangle[3] < extent.maxy
-                            )
-                        ) {
-                            var layer = global.viewer.imageryLayers.addImageryProvider(new global.DC.Namespace.Cesium.SingleTileImageryProvider({
-                                url: sm.url,
-                                rectangle: global.DC.Namespace.Cesium.Rectangle.fromDegrees(sm.rectangle[0], sm.rectangle[1], sm.rectangle[2], sm.rectangle[3])
-                            }))
+            array[0][viewerHeight].forEach(sm => {
+                let startFlag = false
 
-                            baseLayer.push({ layer, id: sm.id })
-                        }
-                    })
+                startFlag = baseLayer.some(dt => {
+                    return dt.id.indexOf(sm.id) != -1 && dt.id.indexOf(viewerHeight) != -1
+                })
+
+                if (startFlag == true) return
+
+                if (
+                    (
+                        sm.rectangle[0] > extent.minx &&
+                        sm.rectangle[1] > extent.miny &&
+                        sm.rectangle[2] < extent.maxx &&
+                        sm.rectangle[3] < extent.maxy
+                    ) ||
+                    (
+                        sm.rectangle[0] < extent.minx &&
+                        sm.rectangle[1] < extent.maxy &&
+                        sm.rectangle[2] > extent.minx &&
+                        sm.rectangle[3] > extent.maxy
+                    ) ||
+                    (
+                        sm.rectangle[0] < extent.maxx &&
+                        sm.rectangle[1] < extent.maxy &&
+                        sm.rectangle[2] > extent.maxx &&
+                        sm.rectangle[3] > extent.maxy
+                    ) ||
+                    (
+                        sm.rectangle[0] < extent.maxx &&
+                        sm.rectangle[1] < extent.miny &&
+                        sm.rectangle[2] > extent.maxx &&
+                        sm.rectangle[3] > extent.miny
+                    ) ||
+                    (
+                        sm.rectangle[0] < extent.minx &&
+                        sm.rectangle[1] < extent.miny &&
+                        sm.rectangle[2] > extent.minx &&
+                        sm.rectangle[3] > extent.miny
+                    ) ||
+                    (
+                        sm.rectangle[0] > extent.minx &&
+                        sm.rectangle[1] < extent.maxy &&
+                        sm.rectangle[2] < extent.maxx &&
+                        sm.rectangle[3] > extent.maxy
+                    ) ||
+                    (
+                        sm.rectangle[0] > extent.minx &&
+                        sm.rectangle[1] > extent.miny &&
+                        sm.rectangle[2] > extent.maxx &&
+                        sm.rectangle[3] < extent.maxy
+                    ) ||
+                    (
+                        sm.rectangle[0] > extent.minx &&
+                        sm.rectangle[1] < extent.miny &&
+                        sm.rectangle[2] < extent.maxx &&
+                        sm.rectangle[3] > extent.miny
+                    ) ||
+                    (
+                        sm.rectangle[0] < extent.minx &&
+                        sm.rectangle[1] > extent.miny &&
+                        sm.rectangle[2] > extent.minx &&
+                        sm.rectangle[3] < extent.maxy
+                    )
+                ) {
+                    var layer = global.viewer.imageryLayers.addImageryProvider(new global.DC.Namespace.Cesium.SingleTileImageryProvider({
+                        url: sm.url,
+                        rectangle: global.DC.Namespace.Cesium.Rectangle.fromDegrees(sm.rectangle[0], sm.rectangle[1], sm.rectangle[2], sm.rectangle[3])
+                    }), 1)
+
+                    oldLayer.push({ id: sm.id })
+
+                    baseLayer.push({ layer, id: sm.id + viewerHeight })
                 }
             })
+
+            this.raiseBaseLayer(oldLayer)
         },
 
         mapCameraEvent () {
             const that = this
 
-            that.updateBaseLayer(true)
+            const height = global.viewer.camera.positionCartographic.height
+
+            heightChange = viewerHeight
 
             global.viewer.camera.setView({
                 orientation: {
@@ -921,137 +772,24 @@
                 }
             })
 
-            if (this.startWheel == false) return
-
-            if (this.wheelFlag) { // 下
-                if (viewerHeight == fiveVH) {
-                    global.viewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.viewer.camera.positionCartographic.longitude,
-                            global.viewer.camera.positionCartographic.latitude,
-                            fourVH
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    viewerHeight = fourVH
-                    that.$emit('change-wheel', false, 'startWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (viewerHeight == fourVH) {
-                    global.viewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.viewer.camera.positionCartographic.longitude,
-                            global.viewer.camera.positionCartographic.latitude,
-                            twoVH
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    viewerHeight = twoVH
-                    that.$emit('change-wheel', false, 'startWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (viewerHeight == twoVH) {
-                    global.viewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.viewer.camera.positionCartographic.longitude,
-                            global.viewer.camera.positionCartographic.latitude,
-                            oneVH
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    viewerHeight = oneVH
-                    that.$emit('change-wheel', false, 'startWheel')
-                    that.addBaseLayer()
-                }
-            } else { // 上
-                if (viewerHeight == oneVH) {
-                    global.viewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.viewer.camera.positionCartographic.longitude,
-                            global.viewer.camera.positionCartographic.latitude,
-                            twoVH
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    viewerHeight = twoVH
-                    that.$emit('change-wheel', false, 'startWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (viewerHeight == twoVH) {
-                    global.viewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.viewer.camera.positionCartographic.longitude,
-                            global.viewer.camera.positionCartographic.latitude,
-                            fourVH
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    viewerHeight = fourVH
-                    that.$emit('change-wheel', false, 'startWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (viewerHeight == fourVH) {
-                    global.viewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.viewer.camera.positionCartographic.longitude,
-                            global.viewer.camera.positionCartographic.latitude,
-                            fiveVH
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    viewerHeight = fiveVH
-                    that.$emit('change-wheel', false, 'startWheel')
-                    that.addBaseLayer()
-                }
+            if (height > fiveVH - heightDifferenceValue) {
+                viewerHeight = fiveVH
+            } else if (height <= fourVH + heightDifferenceValue && height > fourVH - heightDifferenceValue) {
+                viewerHeight = fourVH
+            } else if (height <= twoVH + heightDifferenceValue && height > twoVH - heightDifferenceValue) {
+                viewerHeight = twoVH
+            } else if (height <= oneVH + 50) {
+                viewerHeight = oneVH
             }
+
+            if (heightChange != viewerHeight) {
+                that.addBaseLayer()
+            }
+
+            that.updateBaseLayer()
         },
 
         smallMapCameraEvent () {
-            const that = this
             global.eagleViewer.camera.setView({
                 orientation: {
                     // 指向
@@ -1061,134 +799,6 @@
                     roll: 0.0
                 }
             })
-
-            if (this.startSmallWheel == false) return
-
-            if (this.wheelFlag) { // 下
-                if (smallViewerHeight == fiveVH + 1000) {
-                    global.eagleViewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.eagleViewer.camera.positionCartographic.longitude,
-                            global.eagleViewer.camera.positionCartographic.latitude,
-                            fourVH + 1000
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    smallViewerHeight = fourVH + 1000
-                    that.$emit('change-wheel', false, 'startSmallWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (smallViewerHeight == fourVH + 1000) {
-                    global.eagleViewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.eagleViewer.camera.positionCartographic.longitude,
-                            global.eagleViewer.camera.positionCartographic.latitude,
-                            twoVH + 1000
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    smallViewerHeight = twoVH + 1000
-                    that.$emit('change-wheel', false, 'startSmallWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (smallViewerHeight == twoVH + 1000) {
-                    global.eagleViewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.eagleViewer.camera.positionCartographic.longitude,
-                            global.eagleViewer.camera.positionCartographic.latitude,
-                            oneVH + 1000
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    smallViewerHeight = oneVH + 1000
-                    that.$emit('change-wheel', false, 'startSmallWheel')
-                    that.addBaseLayer()
-                }
-            } else { // 上
-                if (smallViewerHeight == oneVH + 1000) {
-                    global.eagleViewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.eagleViewer.camera.positionCartographic.longitude,
-                            global.eagleViewer.camera.positionCartographic.latitude,
-                            twoVH + 1000
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    smallViewerHeight = twoVH + 1000
-                    that.$emit('change-wheel', false, 'startSmallWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (smallViewerHeight == twoVH + 1000) {
-                    global.eagleViewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.eagleViewer.camera.positionCartographic.longitude,
-                            global.eagleViewer.camera.positionCartographic.latitude,
-                            fourVH + 1000
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    smallViewerHeight = fourVH + 1000
-                    that.$emit('change-wheel', false, 'startSmallWheel')
-                    that.addBaseLayer()
-                    return
-                }
-
-                if (smallViewerHeight == fourVH + 1000) {
-                    global.eagleViewer.camera.setView({
-                        destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
-                            global.eagleViewer.camera.positionCartographic.longitude,
-                            global.eagleViewer.camera.positionCartographic.latitude,
-                            fiveVH + 1000
-                        ),
-                        orientation: {
-                            // 指向
-                            heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
-                            // 视角
-                            pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
-                            roll: 0.0
-                        }
-                    })
-                    smallViewerHeight = fiveVH + 1000
-                    that.$emit('change-wheel', false, 'startSmallWheel')
-                    that.addBaseLayer()
-                }
-            }
         },
 
         createdLayers () {
@@ -1512,9 +1122,6 @@
             that.$store.commit('SET_TWOORTHREE', that.dimensionValue)
 
             if (that.dimensionValue == '真三维') {
-                global.viewer.imageryLayers.remove(slLayer)
-                global.viewer.imageryLayers.remove(bzLayer)
-
                 global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, that.mouseMoveEvent)
                 global.viewer.off(global.DC.SceneEventType.CAMERA_CHANGED, that.mapCameraEvent)
                 global.eagleViewer.off(global.DC.SceneEventType.CAMERA_CHANGED, that.smallMapCameraEvent)
@@ -1539,7 +1146,13 @@
                 that.createTC()
 
                 that.removeLayers()
-                that.removeBaseLayer()
+                baseLayer.forEach(item => {
+                    global.viewer.imageryLayers.remove(
+                        item.layer
+                    )
+                })
+
+                baseLayer = []
 
                 silhouetteBlue.selected = []
 
@@ -1595,26 +1208,6 @@
             } else {
                 global.viewer.imageryLayers.remove(yxLayer)
                 global.viewer.removeTerrain(dxLayer)
-
-                slLayer = global.viewer.imageryLayers.addImageryProvider(
-                    new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
-                        url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=9ae78c51a0a28f06444d541148496e36',
-                        subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
-                        format: 'image/jpeg',
-                        show: true,
-                        maximumLevel: 18
-                    })
-                )
-
-                bzLayer = global.viewer.imageryLayers.addImageryProvider(
-                    new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
-                        url: 'http://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=9ae78c51a0a28f06444d541148496e36',
-                        subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
-                        format: 'image/jpeg',
-                        show: true,
-                        maximumLevel: 18
-                    })
-                )
 
                 that.btnGroupShow = false
                 that.removeSAT()

--
Gitblit v1.9.3