添加部分钩子函数,便于代码维护
This commit is contained in:
@@ -4,72 +4,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
baQiao,
|
||||
beiLin,
|
||||
changAn,
|
||||
gaoLing,
|
||||
huYi,
|
||||
lanTian,
|
||||
lianHu,
|
||||
linTong,
|
||||
weiYang,
|
||||
xinCheng,
|
||||
yanLiang,
|
||||
yanTa,
|
||||
zhouZhi,
|
||||
} from '@/assets';
|
||||
import { useAdministrativeDivision } from '@/hooks/map/useAdministrativeDivision';
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils';
|
||||
import { Color } from 'cesium';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
const areas = [
|
||||
baQiao,
|
||||
beiLin,
|
||||
changAn,
|
||||
gaoLing,
|
||||
huYi,
|
||||
lanTian,
|
||||
lianHu,
|
||||
linTong,
|
||||
weiYang,
|
||||
xinCheng,
|
||||
yanLiang,
|
||||
yanTa,
|
||||
zhouZhi,
|
||||
];
|
||||
const areasId = [
|
||||
'baqiao',
|
||||
'beilin',
|
||||
'changan',
|
||||
'gaoling',
|
||||
'huyi',
|
||||
'lantian',
|
||||
'lianhu',
|
||||
'lintong',
|
||||
'weiyang',
|
||||
'xincheng',
|
||||
'yanliang',
|
||||
'yanta',
|
||||
'zhouzhi',
|
||||
];
|
||||
const areasColor = [
|
||||
new Color(255 / 255, 153 / 255, 0 / 255),
|
||||
new Color(255 / 255, 51 / 255, 102 / 255),
|
||||
new Color(0 / 255, 178 / 255, 255 / 255),
|
||||
new Color(102 / 255, 255 / 255, 102 / 255),
|
||||
new Color(204 / 255, 102 / 255, 255 / 255),
|
||||
new Color(255 / 255, 204 / 255, 0 / 255),
|
||||
new Color(0 / 255, 204 / 255, 153 / 255),
|
||||
new Color(255 / 255, 102 / 255, 102 / 255),
|
||||
new Color(102 / 255, 153 / 255, 255 / 255),
|
||||
new Color(255 / 255, 178 / 255, 102 / 255),
|
||||
new Color(153 / 255, 255 / 255, 204 / 255),
|
||||
new Color(255 / 255, 153 / 255, 204 / 255),
|
||||
new Color(190 / 255, 255 / 255, 232 / 255),
|
||||
];
|
||||
const areaTransparency = 0.3;
|
||||
const labelTransparency = 1;
|
||||
// 配置参数
|
||||
const { areas, areasId, areasColor, areaTransparency, labelTransparency } =
|
||||
useAdministrativeDivision();
|
||||
|
||||
onMounted(() => {
|
||||
// 构建批量添加配置数组
|
||||
|
||||
Reference in New Issue
Block a user