From f8d160f65a97f6c3692b42cca08b44b2b1d72c61 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 15 Nov 2024 19:35:02 +0800
Subject: [PATCH] 图层

---
 src/pages/layout/components/scomponents/layersControl.vue |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/pages/layout/components/scomponents/layersControl.vue b/src/pages/layout/components/scomponents/layersControl.vue
index c0611fa..00f876f 100644
--- a/src/pages/layout/components/scomponents/layersControl.vue
+++ b/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-12 18:15:54
+ * @LastEditTime: 2024-11-15 14:57:14
  * @FilePath: \bigScreen\src\pages\layout\components\scomponents\layersControl.vue
  * @Description:
  *
@@ -120,6 +120,7 @@
       size: 1000
     },
     backgroundIcon: VITE_APP_BASE + 'img/mapicon/qy.png',
+    className: 'qyfb-box',
     showPanel: false,
     layerName: 'qyfb'
   },
@@ -230,6 +231,7 @@
       size: 1000
     },
     showParams: 'category',
+    className: 'fxy-box',
     backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy.png',
     showPanel: false,
     layerName: 'fxy'
@@ -374,7 +376,7 @@
   collectNodesWithFlag(data)
 
   collectedNodes.value.forEach(item => {
-    if (options.some(i => i.id == item.id)) {
+    if (options?.some(i => i.id == item.id)) {
 
       //  const Cesium  = DC
       if (item.subType == '3Dtile') {
@@ -418,7 +420,7 @@
 
               let divIcon = new DC.DivIcon(
                 new DC.Position(i.lng, i.lat, 0),
-                `<div class="public-map-popup">
+                `<div class="public-map-popup ${item.className || ''}">
                     ${iconEl}
                   </div>`
               )
@@ -463,9 +465,9 @@
           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 < 1080; i++) {
+            for (var i = 0; i < 360; i++) {
               var radians = DC.Math.toRadians(i)
               positions.push({
                 x: radius * Math.cos(radians),
@@ -506,7 +508,7 @@
   })
 }
 
-function findObjectById(data, id) {
+function findObjectById (data, id) {
   // 遍历数据数组
   for (let i = 0; i < data.length; i++) {
     const item = data[i]
@@ -532,7 +534,7 @@
 const restHandleCheckChange = (key) => {
   let checkIds = treeRef.value?.getCheckedKeys()
 
-  if (checkIds.some(i => i == key)) {
+  if (checkIds && checkIds.some(i => i == key)) {
     return
   }
 

--
Gitblit v1.9.3