智慧园区前端大屏
shuishen
2025-01-04 03c0f6b2404445808e0b56346db6b33fa1c4be31
图层控制
1 files modified
44 ■■■■■ changed files
src/pages/map/components/scomponents/layersControl.vue 44 ●●●●● patch | view | raw | blame | history
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: 2025-01-04 20:17:26
 * @LastEditTime: 2025-01-04 20:19:00
 * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -291,6 +291,48 @@
      {
        parentId: '3',
        id: '3-5',
        label: '湿地',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 5,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/sd.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'sd',
        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)
        }
      },
      {
        parentId: '3',
        id: '3-6',
        label: '坑塘',
        type: 'layer',