智慧园区前端大屏
linwe
2024-11-22 ddb76492b96539151ab1947660b3bcbd9e20e302
src/pages/layout/components/scomponents/layersControl.vue
@@ -74,7 +74,7 @@
const { VITE_APP_BASE } = import.meta.env
let indexPoint = ref(['1'])
let indexPoint = ref(['5', '7', '1'])
const treeRef = ref(null)
const Cesium = DC.getLib('Cesium')
@@ -166,7 +166,8 @@
          addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPupoLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
                  <img src="${attrParams.imageUrl}" width="160" height="160" />
            <div>${attrParams.fullName}</div>
            <img src="${attrParams.imageUrl}" />
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, 64),
@@ -205,6 +206,7 @@
          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(
@@ -290,6 +292,7 @@
          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(
@@ -330,6 +333,7 @@
          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(
@@ -370,6 +374,7 @@
          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(
@@ -410,6 +415,7 @@
          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(
@@ -570,7 +576,6 @@
        } else {
          addTileLayers[item.layerName].forEach(i => i.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)
@@ -632,7 +637,7 @@
            wall.setStyle({
              material: new DC.WallTrailMaterialProperty({
                color: Cesium.Color.fromBytes(0, 123, 255, 180),
                speed: 10
                speed: 8
              })
            })
            addTileLayers[item.layerName].addOverlay(wall)
@@ -640,6 +645,9 @@
        } else {
          addTileLayers[item.layerName].show = true
        }
        // 飞到园区范围
        window.$viewer.flyTo(addTileLayers[item.layerName])
        // console.log('flyToyqfw********2222222222*******************************', addTileLayers[item.layerName])
      } else if (item.subType == 'geojsonPipe') {
        if (!addTileLayers[item.layerName]) {
          addTileLayers[item.layerName] = new DC.VectorLayer(item.layerName)
@@ -735,8 +743,15 @@
  handleCheckChange([findObjectById(data, key)])
}
// 飞到园区范围
const flyToyqfw = () => {
  console.log('flyToyqfw***************************************', addTileLayers['yqfw'])
  window.$viewer.flyTo(addTileLayers['yqfw'])
}
EventBus.on('restHandleCheckChange', restHandleCheckChange)
EventBus.on('restHandleDelChange', restHandleDelChange)
EventBus.on('flyToyqfw', flyToyqfw)
onMounted(() => {
  handleCheckChange(data.filter(i => indexPoint.value.includes(i.id)))