智慧园区前端大屏
shuishen
2024-11-20 49c8b89710f806e3d4e50e86fb90a48baa54af01
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-18 17:07:09
 * @LastEditTime: 2024-11-19 15:53:37
 * @FilePath: \bigScreen\src\pages\layout\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -106,6 +106,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'
  },
@@ -173,7 +185,7 @@
            layerName: 'gsgw',
            source: gsgw,
            color: DC.Color.BLUE,
            height: 5,
            height: 65,
          },
          {
            id: '3-3-2',
@@ -183,7 +195,7 @@
            layerName: 'wsgw',
            source: wsgw,
            color: DC.Color.BLACK,
            height: 10,
            height: 68,
          },
          {
            id: '3-3-3',
@@ -193,7 +205,7 @@
            layerName: 'rqgw',
            source: rqgw,
            color: DC.Color.RED,
            height: 15,
            height: 71,
          },
          {
            id: '3-3-4',
@@ -203,7 +215,7 @@
            layerName: 'ysgw',
            source: ysgw,
            color: DC.Color.CYAN,
            height: 20,
            height: 75,
          },
        ]
      },
@@ -274,17 +286,40 @@
  {
    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',
      },
      {
        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',
      }
    ]
  },
  {
@@ -466,7 +501,7 @@
          addTileLayers[item.layerName] = new DC.VectorLayer(item.layerName)
          window.$viewer.addLayer(addTileLayers[item.layerName])
          function computeCircle(radius) {
          function computeCircle (radius) {
            var positions = []
            for (var i = 0; i < 360; i++) {
              var radians = DC.Math.toRadians(i)
@@ -481,7 +516,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({
@@ -509,7 +544,7 @@
  })
}
function findObjectById(data, id) {
function findObjectById (data, id) {
  // 遍历数据数组
  for (let i = 0; i < data.length; i++) {
    const item = data[i]