From 49f1198d1f2da71f6213270dfe94be9b34ebf235 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 07 Apr 2025 20:41:50 +0800
Subject: [PATCH] feat: 量尺

---
 src/views/Home/useMapAggregation/useMapAggregation.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/views/Home/useMapAggregation/useMapAggregation.js b/src/views/Home/useMapAggregation/useMapAggregation.js
index c3f6248..f28e071 100644
--- a/src/views/Home/useMapAggregation/useMapAggregation.js
+++ b/src/views/Home/useMapAggregation/useMapAggregation.js
@@ -160,8 +160,6 @@
     const splashedList = type === 'device'
       ? await getDeviceList(areaCode)
       : eventList.map(i=>({eventId:i.id,latitude:Number(i.latitude),longitude:Number(i.longitude),type:'event'}))
-    console.log(list, 'list');
-    console.log(splashedList, 'splashedList');
     const hierarchy = convertToHierarchy(areaCode.slice(0, 6));
     const jsonPath = hierarchy.join('/');
     const jsonPathPre = hierarchy.slice(0, hierarchy.length - 1).join('/');
@@ -305,9 +303,10 @@
         id: feature.id,
         position: position,
         label: {
-          text: feature.data.total_device_count.toString(),
+          text: (feature.data.total_device_count || 0).toString(),
           font: '12pt Source Han Sans CN',
           fillColor: Cesium.Color.BLACK,
+          outlineColor: Cesium.Color.BLACK,
           style: Cesium.LabelStyle.FILL_AND_OUTLINE,
           eyeOffset: new Cesium.Cartesian3(0, 0, -10), // 让label "浮" 在广告牌前面
         },
@@ -426,6 +425,7 @@
 
   // 移除所有监听事件,变量置空
   const removeAll = () => {
+    if (!viewer) return
     removeEntities();
     removeLabel();
     // viewer.camera.moveEnd.removeEventListener(determineScaling);

--
Gitblit v1.9.3