智慧园区前端大屏
1
shuishen
2024-12-02 1dee40ea46601f2ee5d10aa0190625ebf03bdc4e
src/pages/layout/components/scomponents/layersControl.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-10-31 10:47:29
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-14 18:32:01
 * @LastEditTime: 2024-11-28 19:23:46
 * @FilePath: \bigScreen\src\pages\layout\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -15,7 +15,7 @@
    </template>
    <template #close>
      <div class="close cursor-p" @click="$emit('close', 'layers')"><i class="fa fa-close"></i></div>
      <div class="close cursor-p" @click="emit('close', 'layers')"><i class="fa fa-close"></i></div>
    </template>
    <template #content>
@@ -57,9 +57,12 @@
    default: false
  }
})
const emit = defineEmits(['close'])
import panorama from './popup/panorama.vue'
import { getPage } from '@/api/indParkInfo'
import { getList } from "@/api/space/space"
import { getPage as getfirmPage } from '@/api/firmInfo/firmInfo'
import { getList, getGouQu } from "@/api/space/space"
import { getList as getRiskList } from "@/api/riskSource/riskSource"
import { getPanoramaList } from "@/api/panorama/"
import yqfw from "@/assets/json/yqfw"
@@ -73,11 +76,11 @@
const pointStore = usePointStore()
const { VITE_APP_BASE } = import.meta.env
let indexPoint = ref(['1'])
// , '7',
let indexPoint = ref(['1', '5'])
const treeRef = ref(null)
const Cesium = DC.getLib('Cesium')
const treeProps = {
  indent: 16,
  showLabelLine: true,
@@ -90,6 +93,7 @@
const closePanoramaPopup = () => {
  panoramaShow.value = false
}
let addPupoLayers = {}
const data = [
  {
@@ -105,6 +109,18 @@
      {
        url: VITE_APP_BASE + 'mx/tile_02/tileset.json',
        label: 'tile_02'
      },
      {
        url: VITE_APP_BASE + 'mx/tile_03/tileset.json',
        label: 'tile_03'
      },
      {
        url: VITE_APP_BASE + 'mx/tile_04/tileset.json',
        label: 'tile_04'
      },
      {
        url: VITE_APP_BASE + 'mx/tile_05/tileset.json',
        label: 'tile_05'
      },
    ],
    layerName: 'hgyq'
@@ -139,7 +155,35 @@
          type: 1,
          size: 1000
        },
        layerName: 'yjc'
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
        className: 'yjc-box',
        showPanel: false,
        layerName: 'yjc',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroy()
          if (!attrParams.imageUrl) {
            return
          }
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
            <div>${attrParams.fullName}</div>
            <img src="${attrParams.imageUrl}" />
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroy()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPupoLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        id: '3-2',
@@ -151,20 +195,83 @@
          type: 2,
          size: 1000
        },
        layerName: 'fm'
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
        className: 'ysf-box',
        showPanel: false,
        layerName: 'fm',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroy()
          if (!attrParams.imageUrl) {
            return
          }
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
                  <div>${attrParams.fullName}</div>
                  <img src="${attrParams.imageUrl}" width="160" height="160" />
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroy()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPupoLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        id: '3-3',
        label: '公共管网',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 3,
          size: 1000
        },
        layerName: 'gggw'
        children: [
          // 给水管网、污水管网、燃气管网、雨水管网
          {
            id: '3-3-1',
            label: '给水管网',
            type: 'layer',
            subType: 'geojsonPipe',
            layerName: 'gsgw',
            source: gsgw,
            color: DC.Color.BLUE.withAlpha(0.9),
            height: 65,
          },
          {
            id: '3-3-2',
            label: '污水管网',
            type: 'layer',
            subType: 'geojsonPipe',
            layerName: 'wsgw',
            source: wsgw,
            color: DC.Color.DARKBLUE.withAlpha(0.9),
            height: 68,
          },
          {
            id: '3-3-3',
            label: '燃气管网',
            type: 'layer',
            subType: 'geojsonPipe',
            layerName: 'rqgw',
            source: rqgw,
            color: DC.Color.RED.withAlpha(0.9),
            height: 71,
          },
          {
            id: '3-3-4',
            label: '雨水管网',
            type: 'layer',
            subType: 'geojsonPipe',
            layerName: 'ysgw',
            source: ysgw,
            color: DC.Color.CYAN.withAlpha(0.9),
            height: 75,
          },
        ]
      },
      {
@@ -177,7 +284,32 @@
          type: 4,
          size: 1000
        },
        layerName: 'wstsbz'
        layerName: 'wstsbz',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroy()
          if (!attrParams.imageUrl) {
            return
          }
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
                  <div>${attrParams.fullName}</div>
                  <img src="${attrParams.imageUrl}" width="160" height="160" />
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroy()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPupoLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
@@ -190,7 +322,35 @@
          type: 5,
          size: 1000
        },
        layerName: 'sk'
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/sk.png',
        className: 'sk-box',
        showPanel: false,
        layerName: 'sk',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroy()
          if (!attrParams.imageUrl) {
            return
          }
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
                   <div>${attrParams.fullName}</div>
                  <img src="${attrParams.imageUrl}" width="160" height="160" />
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroy()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPupoLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
@@ -203,20 +363,97 @@
          type: 6,
          size: 1000
        },
        layerName: 'yjb'
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjb.png',
        className: 'yjb-box',
        showPanel: false,
        layerName: 'yjb',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroy()
          if (!attrParams.imageUrl) {
            return
          }
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
                  <div>${attrParams.fullName}</div>
                  <img src="${attrParams.imageUrl}" width="160" height="160" />
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroy()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPupoLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        id: '3-7',
        label: '消防沙',
        id: '3-8',
        label: '沟渠',
        type: 'layer',
        subType: 'geojsonPolygon',
        method: getGouQu,
        params: {
          type: 8,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/gouqu.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'gouqu'
      },
      {
        id: '3-9',
        label: '废水处理站',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 7,
          type: 9,
          size: 1000
          // name: '吉水县绿源污水处理厂',
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsclc.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'fsclz'
      },
      {
        id: '3-10',
        label: '排水口',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 10,
          size: 1000
        },
        layerName: 'xfs'
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/psk.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'psk'
      },
      {
        id: '3-11',
        label: '污水池',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 11,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsc.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'wsc'
      }
    ]
  },
@@ -224,17 +461,84 @@
  {
    id: '4',
    label: '风险源',
    type: 'layer',
    subType: 'labelPoint',
    method: getRiskList,
    params: {
      size: 1000
    },
    showParams: 'category',
    className: 'fxy-box',
    backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy.png',
    showPanel: false,
    layerName: 'fxy'
    children: [
      {
        id: '4-1',
        label: '一般',
        type: 'layer',
        subType: 'labelPoint',
        method: getRiskList,
        params: {
          riskLevel: 1,
          size: 1000
        },
        showParams: 'category',
        className: 'fxy-ordinary',
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy.png',
        showPanel: false,
        layerName: 'fxyOrdinary',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroy()
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
            <li>${attrParams.firmName || ''}</li>
            <li>${attrParams.riskLevelName || ''}</li>
            </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
            `<div class="public-map-popup-three">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroy()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPupoLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        id: '4-2',
        label: '较大',
        type: 'layer',
        subType: 'labelPoint',
        method: getRiskList,
        params: {
          riskLevel: 2,
          size: 1000
        },
        showParams: 'category',
        className: 'fxy-larger',
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy.png',
        showPanel: false,
        layerName: 'fxyLarger',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroy()
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
            <li>${attrParams.firmName || ''}</li>
            <li>${attrParams.riskLevelName || ''}</li>
            </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
            `<div class="public-map-popup-three">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroy()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPupoLayers[attrParams.name].addOverlay(divIcon)
        }
      }
    ]
  },
  {
@@ -247,70 +551,21 @@
  },
  {
    id: '6',
    label: '地下管网',
    children: [
      // 给水管网、污水管网、燃气管网、雨水管网
      {
        id: '6-1',
        label: '给水管网',
        type: 'layer',
        subType: 'geojsonPipe',
        layerName: 'gsgw',
        source: gsgw,
        color: DC.Color.BLUE,
        height: 5,
      },
      {
        id: '6-2',
        label: '污水管网',
        type: 'layer',
        subType: 'geojsonPipe',
        layerName: 'wsgw',
        source: wsgw,
        color: DC.Color.BLACK,
        height: 10,
      },
      {
        id: '6-3',
        label: '燃气管网',
        type: 'layer',
        subType: 'geojsonPipe',
        layerName: 'rqgw',
        source: rqgw,
        color: DC.Color.RED,
        height: 15,
      },
      {
        id: '6-4',
        label: '雨水管网',
        type: 'layer',
        subType: 'geojsonPipe',
        layerName: 'ysgw',
        source: ysgw,
        color: DC.Color.CYAN,
        height: 20,
      },
    ]
  },
  {
    id: '7',
    label: '地图全景点位分布',
    label: '空中全景分布',
    type: 'layer',
    subType: 'labelPoint',
    method: getPanoramaList,
    params: {
      size: 1000
      size: 1000,
      remark: '1'
    },
    backgroundIcon: VITE_APP_BASE + 'img/mapicon/qj.png',
    showPanel: false,
    layerName: 'dtqjdwfb',
    layerName: 'kzqjdwfb',
    incident: (e) => {
      const { attrParams } = e.overlay
      panoramaTitle.value = attrParams.name
      if (
        attrParams.url.indexOf("http://vr.jxpskj.com:180") != -1
      ) {
@@ -319,12 +574,47 @@
          "/panorama"
        )
      }
      panoramaUrl.value = attrParams.url
      panoramaShow.value = true
    }
  },
  {
    id: '8',
    label: '地面全景分布',
    type: 'layer',
    subType: 'labelPoint',
    method: getPanoramaList,
    params: {
      size: 1000,
      remark: '2'
    },
    backgroundIcon: VITE_APP_BASE + 'img/mapicon/qj.png',
    showPanel: false,
    layerName: 'dtqjdwfb',
    incident: (e) => {
      const { attrParams } = e.overlay
      panoramaTitle.value = attrParams.name
      if (
        attrParams.url.indexOf("http://vr.jxpskj.com:180") != -1
      ) {
        attrParams.url = attrParams.url.replace(
          "http://vr.jxpskj.com:180",
          "/panorama"
        )
      }
      panoramaUrl.value = attrParams.url
      panoramaShow.value = true
    }
  },
]
// let modellayer = new DC.VectorLayer("modellayer").addTo(window.$viewer)
// let model = new DC.Model("121.46748793889597,31.22345700031846,200", VITE_APP_BASE + 'gltf/dajiang.gltf')
// model.setStyle({
//   scale: 10000
// })
// modellayer.addOverlay(model)
// window.$viewer.flyToPosition("121.46748793889597,31.22345700031846,300,0,-90")
const defaultProps = {
  children: 'children',
@@ -355,12 +645,14 @@
  if (checkType(nodes) == 'arr') {
    nodes.forEach(item => {
      if (item.type == 'layer') {
        collectedNodes.value.push(item)
      }
      if (item) {
        if (item.type == 'layer') {
          collectedNodes.value.push(item)
        }
      if (item.children && item.children.length > 0) {
        collectNodesWithFlag(item.children)
        if (item.children && item.children.length > 0) {
          collectNodesWithFlag(item.children)
        }
      }
    })
  }
@@ -376,22 +668,43 @@
  collectNodesWithFlag(data)
  collectedNodes.value.forEach(item => {
    if (options.some(i => i.id == item.id)) {
    if (options?.some(i => i.id == item.id)) {
      //  const Cesium  = DC
      //  const window.$Cesium  = DC
      if (item.subType == '3Dtile') {
        if (!addTileLayers[item.layerName]) {
          addTileLayers[item.layerName] = item.urlData.map(i => {
            let tile = new DC.Tileset(i.url)
          // addTileLayers[item.layerName] = []
          // let tile = window.$viewer.delegate.scene.primitives.add(new window.$Cesium.Cesium3DTileset({
          //   url: '/zhyq/mx/tile_01/tileset.json',
          // }))
          //   url: '/zhyq/mx/tile_01/tileset.json',
          // }), 121323)
          // item.urlData.forEach(i => {
          // })
          addTileLayers[item.layerName] = []
          item.urlData.forEach((m, ind) => {
            let tile = new DC.Tileset(m.url, {
              maximumMemoryUsage: 1024,
              maximumScreenSpaceError: 8,
              skipLevels: 5,
              skipLevelOfDetail: true,
              skipScreenSpaceErrorFactor: 128,
              progressiveResolutionHeightFraction: 0.5,
              baseScreenSpaceError: 1024
            })
            tile.setSplitDirection(1)
            // tile.setHeight(-420)
            // tile.setSplitDirection(-1)
            window.$viewer.sceneSplit.addTileset(tile)
            tileLayers.addOverlay(tile)
            return tile
            window.$viewer.sceneSplit.enable = false
            addTileLayers[item.layerName][ind] = tile
          })
        } else {
          addTileLayers[item.layerName].forEach(i => i.show = true)
          addTileLayers[item.layerName].forEach(m => m.show = true)
        }
        window.$viewer.flyTo(addTileLayers[item.layerName][0])
      } else if (item.subType == 'labelPoint') {
        if (!addTileLayers[item.layerName]) {
          addTileLayers[item.layerName] = new DC.HtmlLayer(item.layerName)
@@ -419,7 +732,7 @@
              }
              let divIcon = new DC.DivIcon(
                new DC.Position(i.lng, i.lat, 0),
                new DC.Position(i.lng, i.lat, 64),
                `<div class="public-map-popup ${item.className || ''}">
                    ${iconEl}
                  </div>`
@@ -427,7 +740,8 @@
              divIcon.attrParams = i
              let incident = () => { }
              let incident = () => {
              }
              if (item.incident) incident = item.incident
@@ -451,8 +765,8 @@
            wall.setStyle({
              material: new DC.WallTrailMaterialProperty({
                color: Cesium.Color.fromBytes(0, 123, 255, 180),
                speed: 10
                color: window.$Cesium.Color.fromBytes(0, 123, 255, 180),
                speed: 8
              })
            })
            addTileLayers[item.layerName].addOverlay(wall)
@@ -480,7 +794,7 @@
          item.source.features.forEach(i => {
            let polylineVolume = new DC.PolylineVolume(
              i.geometry.coordinates.map(d => [d[0], d[1], item.height].join(',')).join(';'),
              computeCircle(0.3)
              computeCircle(2)
            )
            polylineVolume.setStyle({
@@ -491,17 +805,46 @@
        } else {
          addTileLayers[item.layerName].show = true
        }
      } else if (item.subType == 'geojsonPolygon') {
        if (!addTileLayers[item.layerName]) {
          addTileLayers[item.layerName] = new DC.VectorLayer(item.layerName)
          window.$viewer.addLayer(addTileLayers[item.layerName])
          item.method(item.params).then(res => {
            let data = res.data.data.records
            data.forEach(i => {
              let stl = ''
              try {
                let geom = JSON.parse(i.geom)
                if (geom && geom.coordinates && geom.coordinates[0]) {
                  stl = geom.coordinates[0][0].map(d => d[0] + ',' + d[1]).join(';')
                } else {
                  console.error('Invalid geom structure')
                }
              } catch (error) {
                console.error('Failed to parse geom:', error)
              }
              let polygon = new DC.Polygon(stl)
              polygon.setStyle({
                width: 2,
                material: DC.Color.BLUE,
                clampToGround: true
              })
              addTileLayers[item.layerName].addOverlay(polygon)
            })
          })
        } else {
          addTileLayers[item.layerName].show = true
        }
      }
    } else {
      if (addTileLayers[item.layerName]) {
        if (item.subType == '3Dtile') {
          addTileLayers[item.layerName].forEach(i => i.show = false)
        } else if (item.subType == 'labelPoint') {
          addTileLayers[item.layerName].show = false
        } else if (item.subType == 'geojsonWall') {
          addTileLayers[item.layerName].show = false
        } else if (item.subType == 'geojsonPipe') {
          addTileLayers[item.layerName].show = false
          addTileLayers[item.layerName].forEach(m => m.show = false)
        } else {
          addTileLayers[item.layerName].clear()
          window.$viewer && window.$viewer.removeLayer(addTileLayers[item.layerName])
          addTileLayers[item.layerName] = null
          delete addTileLayers[item.layerName]
        }
      }
    }
@@ -534,7 +877,7 @@
const restHandleCheckChange = (key) => {
  let checkIds = treeRef.value?.getCheckedKeys()
  if (checkIds.some(i => i == key)) {
  if (checkIds && checkIds.some(i => i == key)) {
    return
  }
@@ -545,36 +888,72 @@
const restHandleDelChange = (key) => {
  let checkIds = treeRef.value?.getCheckedKeys()
  if (!checkIds.some(i => i == key)) {
  if (checkIds && !checkIds.some(i => i == key)) {
    return
  }
  treeRef.value?.setCheckedKeys(checkIds.filter(i => i != key))
  treeRef.value?.setCheckedKeys(checkIds.filter(i => i.indexOf(key)))
  handleCheckChange([findObjectById(data, key)])
}
// 飞到园区范围
const flyToyqfw = () => {
  window.$viewer.zoomToPosition(new DC.Position(
    115.1021,
    27.2360,
    5000,
    0,
    -45,
    0
  ), () => {
  })
}
EventBus.on('restHandleCheckChange', restHandleCheckChange)
EventBus.on('restHandleDelChange', restHandleDelChange)
EventBus.on('flyToyqfw', flyToyqfw)
onMounted(() => {
  handleCheckChange(data.filter(i => indexPoint.value.includes(i.id)))
  setTimeout(() => {
    handleCheckChange(data.filter(i => indexPoint.value.includes(i.id)))
  }, 3000)
})
// const sharedData = computed(() => pointStore.sharedData);
// watch(sharedData, (newValue) => {
// });
// 销毁
function destroy () {
  let arr = Object.keys(addPupoLayers)
  arr.filter(i => i != 'hgyq').forEach(i => {
    addPupoLayers[i] && window.$viewer && window.$viewer.removeLayer(addPupoLayers[i])
    addPupoLayers[i] = null
    delete addPupoLayers[i]
  })
}
onUnmounted(() => {
  tileLayers && window.$viewer.removeLayer(tileLayers)
  if (tileLayers) {
    tileLayers.clear()
    window.$viewer && window.$viewer.removeLayer(tileLayers)
    tileLayers = null
  }
  let arr = Object.keys(addTileLayers)
  arr.filter(i => i != 'hgyq').forEach(i => {
    addTileLayers[i] && window.$viewer.removeLayer(addTileLayers[i])
    addTileLayers[i] && window.$viewer && window.$viewer.removeLayer(addTileLayers[i])
    addTileLayers[i] = null
    delete addTileLayers[i]
  })
  addTileLayers = null
  // 弹窗销毁
  destroy()
  addPupoLayers = null
  EventBus.off('restHandleCheckChange', restHandleCheckChange)
  EventBus.off('restHandleDelChange', restHandleDelChange)
  EventBus.off('flyToyqfw', flyToyqfw)
})
</script>