智慧园区前端大屏
shuishen
2024-12-24 c532f35dff316106802df5c6f67cfb8626d86aca
src/pages/map/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-12-10 14:33:31
 * @LastEditTime: 2024-12-24 16:31:17
 * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -73,7 +73,7 @@
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"
import yqfw_01 from "@/assets/json/yqfw_01"
// import gsgw from "@/assets/json/gsgw"
// import rqgw from "@/assets/json/rqgw"
import wsgw from "@/assets/json/wsgw"
@@ -119,18 +119,6 @@
        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'
  },
@@ -158,92 +146,42 @@
        parentId: '3',
        id: '3-1',
        label: '应急池',
        children: [
          {
            parentId: '3-1',
            id: '3-1-1',
            label: '园区',
            type: 'layer',
            subType: 'labelPoint',
            method: getList,
            params: {
              type: 1,
              size: 1000,
              category: 1
            },
            backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
            className: 'yjc-box',
            showPanel: false,
            layerName: 'yjc-yq',
            incident: (e) => {
              const { attrParams } = e.overlay
              // 删除
              destroyPop()
              if (!attrParams.firmName) {
                return
              }
              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
              window.$viewer.addLayer(addPopLayers[attrParams.id])
              let iconEl = `<div class="marsBlueGradientPnl">
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 1,
          size: 1000,
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
        className: 'yjc-box',
        showPanel: false,
        layerName: 'yjc-yq',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
          window.$viewer.addLayer(addPopLayers[attrParams.id])
          let iconEl = `<div class="marsBlueGradientPnl">
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
              let divIcon = new DC.DivIcon(
                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
                `<div class="public-map-popup-two">
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
              )
              let incident = () => {
                destroyPop()
              }
              divIcon.on(DC.MouseEventType.CLICK, incident)
              addPopLayers[attrParams.id].addOverlay(divIcon)
            }
          },
          {
            parentId: '3-1',
            id: '3-1-2',
            label: '企业',
            type: 'layer',
            subType: 'labelPoint',
            method: getList,
            params: {
              type: 1,
              size: 1000,
              category: 2
            },
            backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
            className: 'yjc-box',
            showPanel: false,
            layerName: 'yjc-qy',
            incident: (e) => {
              const { attrParams } = e.overlay
              // 删除
              destroyPop()
              if (!attrParams.firmName) {
                return
              }
              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
              window.$viewer.addLayer(addPopLayers[attrParams.id])
              let iconEl = `<div class="marsBlueGradientPnl">
            <div>企业名称:${attrParams.firmName}</div>
            <div>作用:${attrParams.mainFuncName}</div>
                </div>`
              let divIcon = new DC.DivIcon(
                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
                `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
              )
              let incident = () => {
                destroyPop()
              }
              divIcon.on(DC.MouseEventType.CLICK, incident)
              addPopLayers[attrParams.id].addOverlay(divIcon)
            }
          },
        ]
          )
          let incident = () => {
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.id].addOverlay(divIcon)
        }
      },
      {
@@ -741,7 +679,7 @@
    type: 'layer',
    subType: 'geojsonWall',
    layerName: 'yqfw',
    source: yqfw
    source: yqfw_01
  },
  {
@@ -965,7 +903,7 @@
          item.source.features.forEach(i => {
            let wall = new DC.Wall(
              i.geometry.coordinates[0].map(d => [...d, 125].join(',')).join(';')
              i.geometry.coordinates[0].map(d => [d[0], d[1], 125].join(',')).join(';')
            )
            wall.setStyle({
@@ -1139,9 +1077,9 @@
// 飞到园区范围
const flyToyqfw = () => {
  window.$viewer.zoomToPosition(new DC.Position(
    115.1021,
    27.2360,
    5000,
    116.2819,
    27.9400,
    8000,
    0,
    -45,
    0