From 56731d7e2e96ba549a88aca0ebd89a8fc3e98f01 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 08 Apr 2025 18:04:31 +0800
Subject: [PATCH] feat:行政区加高度
---
src/views/Home/useMapAggregation/useMapAggregation.js | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/views/Home/useMapAggregation/useMapAggregation.js b/src/views/Home/useMapAggregation/useMapAggregation.js
index 3c55da4..eb59787 100644
--- a/src/views/Home/useMapAggregation/useMapAggregation.js
+++ b/src/views/Home/useMapAggregation/useMapAggregation.js
@@ -339,6 +339,7 @@
item.dataSource = dataSource // 保存数据源以便后续删除
// 获取数据源中的实体
const entities = dataSource.entities.values
+
entities.forEach(entity => {
let material = new PolyGradientMaterial({
color: Cesium.Color.fromCssColorString(getColor()),
@@ -346,18 +347,20 @@
alphaPower: 1.3
})
+ entity.polygon.extrudedHeight = (entity.propertyNames.length || 1) * 500
+
entity.polygon.material = material
entity.polygon.outline = false // 显示边框
})
- flyTo &&
- viewer.flyTo(dataSource, {
- offset: new Cesium.HeadingPitchRange(
- 0, // heading: 0 (朝向不变)
- Cesium.Math.toRadians(-90), // pitch: -90° (垂直向下)
- 0 // range: 0 (默认距离)
- ),
- duration: 0.5,
- })
+
+ flyTo && viewer.flyTo(dataSource, {
+ offset: new Cesium.HeadingPitchRange(
+ 0, // heading: 0 (朝向不变)
+ Cesium.Math.toRadians(-60), // pitch: -90° (垂直向下)
+ 0 // range: 0 (默认距离)
+ ),
+ duration: 0.5,
+ })
})
}
--
Gitblit v1.9.3