From 8fa0d6fdb819ddb15b22250d019ce0a564632959 Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Mon, 21 Apr 2025 19:24:45 +0800
Subject: [PATCH] Merge branch 'test' into prod

---
 src/hooks/useMapAggregation/useMapAggregation.js |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/hooks/useMapAggregation/useMapAggregation.js b/src/hooks/useMapAggregation/useMapAggregation.js
index d46d74a..739da34 100644
--- a/src/hooks/useMapAggregation/useMapAggregation.js
+++ b/src/hooks/useMapAggregation/useMapAggregation.js
@@ -1,8 +1,7 @@
 import * as Cesium from 'cesium'
 import aggregationImg from '@/assets/images/home/useUavHome/aggregation.png'
 import eventAggregationImg from '@/assets/images/home/useUavHome/eventAggregationImg.png'
-import uavImg from '@/assets/images/home/useUavHome/uavImg.png'
-
+import _ from 'lodash'
 import { getEventImage } from '@/utils/stateToImageMap/event'
 import { getDroneStatusImage } from '@/utils/stateToImageMap/drone'
 
@@ -15,6 +14,7 @@
 
 // hook
 import { useMapHandlerClick } from '@/hooks/components/useMapHandlerClick'
+import { MAP_LEVEL } from '@/const/drc'
 
 /**
  * 机巢聚合功能
@@ -56,19 +56,8 @@
     }
   })
 
-  let scalingJudgment = [
-    { name: '县', splashedList: [], gJson: null, show: false, outline: {}, value: [0, 48651], height: 31753 },
-    { name: '市', splashedList: [], gJson: null, show: false, outline: {}, value: [48651, 314863], height: 257731 },
-    {
-      name: '省',
-      splashedList: [],
-      gJson: null,
-      show: false,
-      outline: {},
-      value: [314863, 3796280000],
-      height: 1987280,
-    },
-  ]
+  let scalingJudgment = _.cloneDeep(MAP_LEVEL).map(i => ({...i,gJson: null,splashedList:[], show: false, outline: {}}))
+
   let viewer = null
   let active = null
 
@@ -100,7 +89,7 @@
     // 根据高度展示对应的 gJson
     for (let [index, item] of scalingJudgment.entries()) {
       if (!item.show) return
-      if (height > item.value[0] && height <= item.value[1]) {
+      if (height > item.heightRange[0] && height <= item.heightRange[1]) {
         if (active === item.name) return
         active = item.name
         removeEntities()

--
Gitblit v1.9.3