智慧园区前端大屏
shuishen
2025-01-12 e16a3ba0d9c867f9a530799498ac08ea4a7e1547
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-08 17:28:02
 * @LastEditTime: 2025-01-12 00:48:59
 * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -118,12 +118,12 @@
    subType: '3Dtile',
    urlData: [
      {
        url: '/3Dtile/rcmx/tile_01/tileset.json',
        label: 'tile_01'
        url: '/3Dtile/rcmx/tiles_01/tileset.json',
        label: 'tiles_01'
      },
      {
        url: '/3Dtile/rcmx/tile_02/tileset.json',
        label: 'tile_02'
        url: '/3Dtile/rcmx/tiles_02/tileset.json',
        label: 'tiles_02'
      },
    ],
    layerName: 'hgyq'
@@ -391,17 +391,17 @@
        layerName: 'ql'
      },
      // {
      //   parentId: '3',
      //   id: '3-9',
      //   label: '雨水管网',
      //   type: 'layer',
      //   subType: 'geojsonPipe',
      //   layerName: 'ysgw',
      //   source: ysgw,
      //   color: DC.Color.CYAN.withAlpha(0.9),
      //   height: 48,
      // },
      {
        parentId: '3',
        id: '3-9',
        label: '雨水管网',
        type: 'layer',
        subType: 'geojsonPipe',
        layerName: 'ysgw',
        source: ysgw,
        color: DC.Color.CYAN.withAlpha(0.9),
        height: 30,
      },
      {
        parentId: '3',
@@ -461,55 +461,16 @@
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        parentId: '4',
        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-zd-b.png',
        showPanel: false,
        layerName: 'fxyLarger',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPopLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
            <li>企业名称:${attrParams.firmName || ''}</li>
            <li>风险等级:${attrParams.riskLevelName || ''}</li>
            <li>行业类别:${attrParams.name || ''}</li>
            </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
            `<div class="public-map-popup-three">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        parentId: '4',
        id: '4-3',
        label: '重大',
        type: 'layer',
        subType: 'labelPoint',
        method: getRiskList,
        params: {
          riskLevel: 3,
          riskLevel: 2,
          size: 1000
        },
        showParams: 'category',
@@ -541,10 +502,11 @@
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        parentId: '4',
        id: '4-9',
        label: '其他',
        label: '暂定',
        type: 'layer',
        subType: 'labelPoint',
        method: getRiskList,
@@ -854,13 +816,14 @@
            }
            return positions
          }
          item.source.geometries.forEach(i => {
          item.source.features.forEach(i => {
            let polylineVolume = new DC.PolylineVolume(
              i.coordinates.map(d => [d[0], d[1], item.height].join(',')).join(';'),
              i.geometry.coordinates.map(d => [d[0], d[1], item.height].join(',')).join(';'),
              computeCircle(1.6)
            )
            if ('properties' in i && i.properties?.RefName.indexOf('拟建') != -1) {
            if ('RefName' in i.properties && i.properties.RefName.indexOf('拟建') != -1) {
              polylineVolume.setStyle({
                material: DC.Color.fromBytes(255, 0, 0, 230)
              })
@@ -985,9 +948,9 @@
// 飞到园区范围
const flyToyqfw = () => {
  window.$viewer.zoomToPosition(new DC.Position(
    115.6050,
    29.7420,
    6000,
    115.6080,
    29.7880,
    3000,
    0,
    -45,
    0