From 6c220d64befec39fb2b982558eb837ab6da8087d Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Thu, 18 Sep 2025 10:06:45 +0800
Subject: [PATCH] Merge branch 'feature/v5.0/5.0.5' into feature/v6.0/6.0.2
---
src/utils/cesium/createRouteLine.js | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/src/utils/cesium/createRouteLine.js b/src/utils/cesium/createRouteLine.js
index 92ca1b4..eaa7290 100644
--- a/src/utils/cesium/createRouteLine.js
+++ b/src/utils/cesium/createRouteLine.js
@@ -36,6 +36,34 @@
speed: 5
})
+let arrowLineMaterialPropertyOrange = new ArrowLineMaterialProperty({
+ color: new Cesium.Color(255 / 255, 185 / 255, 58 / 255, 1),
+ directionColor: new Cesium.Color(1, 1, 1, 1),
+ outlineColor: new Cesium.Color(1, 1, 1, 1),
+ outlineWidth: 0,
+ speed: 5,
+})
+
+let arrowLineMaterialPropertyGreen = new ArrowLineMaterialProperty({
+ color: new Cesium.Color(6 / 255, 217 / 255, 87 / 255, 1),
+ directionColor: new Cesium.Color(1, 1, 1, 1),
+ outlineColor: new Cesium.Color(1, 1, 1, 1),
+ outlineWidth: 0,
+ speed: 5,
+})
+
+// 记录index
+let indexLog = 0
+// 颜色
+function getLineColor(lineNumber) {
+ // 颜色顺序: 蓝(0), 黄(1), 绿(2)
+ const colors = [arrowLineMaterialProperty, arrowLineMaterialPropertyOrange, arrowLineMaterialPropertyGreen]
+ // 计算颜色索引 (从0开始)
+ const colorIndex = (lineNumber - 1) % 3
+ // 返回对应颜色
+ return colors[colorIndex]
+}
+
let runningLineMaterial = new LineTrailMaterial({
color: Cesium.Color.fromCssColorString('#1FFF69'),
opacity: 1,
@@ -94,6 +122,7 @@
* @param {*} viewer
*/
initCreateRoute (viewer) {
+ indexLog = 0
this.viewer = viewer
}
@@ -469,7 +498,7 @@
*/
async drawPointRoute (lineObj, missionConfig, dronePosition, data, startPoint, isShowDock, isShowPointBillboard, wayline_type) {
const { positionArray, filePositions } = this.disposeData(lineObj, missionConfig, dronePosition, data, startPoint, wayline_type)
-
+
const droneTransformPosition = Cesium.Cartesian3.fromDegrees(
Number(dronePosition.longitude),
Number(dronePosition.latitude),
@@ -478,6 +507,7 @@
// 路径线
let polyline
+
if (this.type === 'clusterScheduling') {
filePositions.forEach((item, index) => {
@@ -630,7 +660,7 @@
polyline: {
width: 4,
positions: positionArray,
- material: arrowLineMaterialProperty,
+ material: getLineColor(indexLog),
clampToGround: false,
},
@@ -681,6 +711,7 @@
* @returns {} {positionArray: 带拼接点位置, filePositions:光航线点位置}
*/
disposeData (lineObj, missionConfig, dronePosition, data, startPoint, wayline_type) {
+ indexLog = indexLog + 1
const { device_sn } = data
const executeHeightMode = lineObj.executeHeightMode === "WGS84"
--
Gitblit v1.9.3