From 3ff8eeda5b5ed0d19f9b04b7c027957be130d5b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com>
Date: Mon, 15 Dec 2025 11:20:06 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A8=E5=B1=80?=
=?UTF-8?q?=E9=AB=98=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/Global/Contour/index.js | 28 ++++++++++++++++++++++++----
src/In/index.js | 5 +++--
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/src/Global/Contour/index.js b/src/Global/Contour/index.js
index 42bfe42..a352a16 100644
--- a/src/Global/Contour/index.js
+++ b/src/Global/Contour/index.js
@@ -76,7 +76,7 @@ function accordingToCameraHeight() {
}
function startDraw(sdk, showData) {
- if(!sdk || !sdk.viewer) {
+ if (!sdk || !sdk.viewer) {
return
}
if (showData) {
@@ -129,8 +129,28 @@ function reset() {
supplementaryContourShow = false
supplementaryContourWidth = 1.0
supplementaryContourColor = '#d084d1'
-
-
+}
+function setVal(data) {
+ secondaryLinesCount = data['secondaryLinesCount']
+ // show = true
+ equalHeightDistance = data['equalHeightDistance']
+ activeColor = rgbaFromObject(data['activeColor'])
+ indexContourShow = data['indexContourShow']
+ indexContourWidth = data['indexContourWidth']
+ indexContourColor = rgbaFromObject(data['indexContourColor'])
+ intermediateContourShow = data['intermediateContourShow']
+ intermediateContourWidth = data['intermediateContourWidth']
+ intermediateContourColor = rgbaFromObject(data['intermediateContourColor'])
+ halfIntervalContourShow = data['halfIntervalContourShow']
+ halfIntervalContourWidth = data['halfIntervalContourWidth']
+ halfIntervalContourColor = rgbaFromObject(data['halfIntervalContourColor'])
+ supplementaryContourShow = data['supplementaryContourShow']
+ supplementaryContourWidth = data['supplementaryContourWidth']
+ supplementaryContourColor = rgbaFromObject(data['supplementaryContourColor'])
+}
+function rgbaFromObject(colorObj) {
+ const { red, green, blue, alpha = 1 } = colorObj;
+ return `rgba(${red * 255}, ${green * 255}, ${blue * 255}, ${alpha})`;
}
async function dialog(sdk) {
_sdk = sdk
@@ -716,4 +736,4 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
});
}
-export { dialog, startDraw, reset }
+export { dialog, startDraw, reset, setVal }
diff --git a/src/In/index.js b/src/In/index.js
index 2caa374..a8b2f92 100644
--- a/src/In/index.js
+++ b/src/In/index.js
@@ -71,7 +71,7 @@ import {
} from '../Global/MultiViewportMode'
import { MouseCoordinate } from '../Global/MouseCoordinate'
import { MouseRightMenu } from '../Global/mouseRightMenu'
-import { dialog as ContourDialog, startDraw as ContourStartDraw, reset as ContourReset } from '../Global/Contour'
+import { dialog as ContourDialog, startDraw as ContourStartDraw, reset as ContourReset, setVal as ContourSetVal } from '../Global/Contour'
import { on as SplitScreenOn, off as SplitScreenOff, setActiveId as SplitScreenSetActiveId, getSdk } from '../Global/SplitScreen'
import LocateCurrent from '../Obj/Base/LocateCurrent'
@@ -352,7 +352,8 @@ if (!window.YJ) {
},
Contour: ContourDialog,
ContourStartDraw,
- ContourReset
+ ContourReset,
+ ContourSetVal
}, //测量
Measure: {
GetMeasureStatus: () => {
From 50b4501b7a13e9332a37aeb300d1a4e99c81087e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com>
Date: Mon, 15 Dec 2025 16:37:56 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/Global/FlyRoam/index.js | 2 ++
src/Global/MouseCoordinate/index.js | 10 +++++-----
src/Global/global.js | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/Global/FlyRoam/index.js b/src/Global/FlyRoam/index.js
index a7c4754..a9f3055 100644
--- a/src/Global/FlyRoam/index.js
+++ b/src/Global/FlyRoam/index.js
@@ -203,6 +203,8 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
trList[i].querySelector("input[name='time']").value = time
}
trList[trList.length - 1].querySelector("input[name='time']").value = 0
+
+ totalTimeElm.value = 0//点击应用后默认时间清零
}
})
totalTimeElm.addEventListener('blur', () => {
diff --git a/src/Global/MouseCoordinate/index.js b/src/Global/MouseCoordinate/index.js
index a7cb7f5..88ad038 100644
--- a/src/Global/MouseCoordinate/index.js
+++ b/src/Global/MouseCoordinate/index.js
@@ -181,13 +181,13 @@ const MouseCoordinate = (sdk, status) => {
// contentElm.innerHTML = `
经度:${degrees.lng.toFixed(6)}°
维度:${degrees.lat.toFixed(6)}°
海拔:${degrees.alt.toFixed(2)} m
`
switch (positionType || '度') {
case '度':
- contentElm.innerHTML = `经度:${degrees.lng.toFixed(8)}°
维度:${degrees.lat.toFixed(8)}°
海拔:${degrees.alt.toFixed(2)} m
`
+ contentElm.innerHTML = `经度:${degrees.lng.toFixed(8)}°
维度:${degrees.lat.toFixed(8)}°
海拔:${Number(degrees.alt.toFixed(2))} m
`
break;
case '度分':
- contentElm.innerHTML = `经度:${proj.degreesToDMS(degrees.lng, true)}
维度:${proj.degreesToDMS(degrees.lat, true)}
海拔:${degrees.alt.toFixed(2)} m
`
+ contentElm.innerHTML = `经度:${proj.degreesToDMS(degrees.lng, true)}
维度:${proj.degreesToDMS(degrees.lat, true)}
海拔:${Number(degrees.alt.toFixed(2))} m
`
break;
case '度分秒':
- contentElm.innerHTML = `经度:${proj.degreesToDMS(degrees.lng, false)}
维度:${proj.degreesToDMS(degrees.lat, false)}
海拔:${degrees.alt.toFixed(2)} m
`
+ contentElm.innerHTML = `经度:${proj.degreesToDMS(degrees.lng, false)}
维度:${proj.degreesToDMS(degrees.lat, false)}
海拔:${Number(degrees.alt.toFixed(2))} m
`
break;
default:
break;
@@ -197,13 +197,13 @@ const MouseCoordinate = (sdk, status) => {
// let result = tools.convert([{ x: degrees.lng, y: degrees.lat, z: degrees.alt }], 'EPSG:4326', coordinateSystem)
let result = tools.convert([{ x: degrees.lng, y: degrees.lat, z: degrees.alt }], 'EPSG:4326', posiToCoordinate(coordinateSystem, degrees))
position = result.points[0]
- contentElm.innerHTML = `x:${position.x.toFixed(2)}
y:${position.y.toFixed(2)}
z:${position.z.toFixed(2)}
`
+ contentElm.innerHTML = `x:${position.x.toFixed(2)}
y:${position.y.toFixed(2)}
z:${Number(position.z.toFixed(2))}
`
}
}
else {
let coordinateSystem = getCoordinateSystem()
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
- contentElm.innerHTML = ``
+ contentElm.innerHTML = ``
}
else {
contentElm.innerHTML = ``
diff --git a/src/Global/global.js b/src/Global/global.js
index aae7b9f..9aec3f9 100644
--- a/src/Global/global.js
+++ b/src/Global/global.js
@@ -872,7 +872,7 @@ function getDMS() {
return positionType
}
function setDMS(sdk, type) {
- if (coordinateSystem !== 'EPSG:4326') {
+ if (coordinateSystem !== 'EPSG:4326' && coordinateSystem !== 'EPSG:4490') {
return
}
positionType = type
From 1e0edcea598fb65ba7cf7ca08cc95726cdaa885a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com>
Date: Tue, 16 Dec 2025 18:01:17 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/Draw/drawPolyline.js | 28 ++++++++++++++--------------
src/Global/SheetIndex/index.js | 6 ++----
src/Obj/Base/BatchModel/index.js | 1 +
3 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/Draw/drawPolyline.js b/src/Draw/drawPolyline.js
index 0c2deda..4317f70 100644
--- a/src/Draw/drawPolyline.js
+++ b/src/Draw/drawPolyline.js
@@ -104,7 +104,7 @@ class DrawPolyline extends Draw {
let cache_positions = []
let car = undefined
this.event.mouse_left((movement, cartesian) => {
- if(into === '2D') {
+ if (into === '2D') {
return
}
into = '3D'
@@ -120,7 +120,6 @@ class DrawPolyline extends Draw {
}
cache_positions.push(cartesian)
this.points_ids.push(this.create_point(cartesian, this.viewer))
-
if (cache_positions.length >= this.options.number) {
let positions = []
cache_positions.forEach((item) => {
@@ -138,11 +137,12 @@ class DrawPolyline extends Draw {
this.end()
}
else {
- cb(cache_positions.length)
+ // cb(cache_positions.length)
+ cb(null, cache_positions)
}
})
this.event.mouse_right((movement, cartesian) => {
- if(into === '2D') {
+ if (into === '2D') {
return
}
let positions = []
@@ -161,7 +161,7 @@ class DrawPolyline extends Draw {
this.end()
})
this.event.mouse_move((movement, cartesian) => {
- if(into === '2D') {
+ if (into === '2D') {
return
}
this.positions = cache_positions.concat(cartesian)
@@ -172,7 +172,7 @@ class DrawPolyline extends Draw {
)
})
this.event.mouse_right_keyboard_ctrl((movement, cartesian) => {
- if(into === '2D') {
+ if (into === '2D') {
return
}
if (this.points_ids.length > 1) {
@@ -183,7 +183,7 @@ class DrawPolyline extends Draw {
})
this.event.gesture_pinck_start_keyboard_ctrl(() => {
- if(into === '2D') {
+ if (into === '2D') {
return
}
if (this.points_ids.length > 1) {
@@ -195,7 +195,7 @@ class DrawPolyline extends Draw {
})
this.event.gesture_pinck_start((movement, cartesian) => {
- if(into === '2D') {
+ if (into === '2D') {
return
}
let startTime = new Date()
@@ -239,7 +239,7 @@ class DrawPolyline extends Draw {
if (!this._is2D && this._sdk2D) {
this.event2D = new MouseEvent(this._sdk2D)
this.event2D.mouse_left((movement, cartesian) => {
- if(into === '3D') {
+ if (into === '3D') {
return
}
into = '2D'
@@ -257,7 +257,7 @@ class DrawPolyline extends Draw {
this.points_ids.push(this.create_point(cartesian, this._sdk2D.viewer))
})
this.event2D.mouse_right((movement, cartesian) => {
- if(into === '3D') {
+ if (into === '3D') {
return
}
let positions = []
@@ -276,7 +276,7 @@ class DrawPolyline extends Draw {
this.end()
})
this.event2D.mouse_move((movement, cartesian) => {
- if(into === '3D') {
+ if (into === '3D') {
return
}
this.positions = cache_positions.concat(cartesian)
@@ -287,7 +287,7 @@ class DrawPolyline extends Draw {
)
})
this.event2D.mouse_right_keyboard_ctrl((movement, cartesian) => {
- if(into === '3D') {
+ if (into === '3D') {
return
}
if (this.points_ids.length > 1) {
@@ -298,7 +298,7 @@ class DrawPolyline extends Draw {
})
this.event2D.gesture_pinck_start_keyboard_ctrl(() => {
- if(into === '3D') {
+ if (into === '3D') {
return
}
if (this.points_ids.length > 1) {
@@ -309,7 +309,7 @@ class DrawPolyline extends Draw {
})
this.event2D.gesture_pinck_start((movement, cartesian) => {
- if(into === '3D') {
+ if (into === '3D') {
return
}
let startTime = new Date()
diff --git a/src/Global/SheetIndex/index.js b/src/Global/SheetIndex/index.js
index 56a798d..6a261d5 100644
--- a/src/Global/SheetIndex/index.js
+++ b/src/Global/SheetIndex/index.js
@@ -9,7 +9,7 @@ let state = false
let scale = '1:100万'
function SheetIndexStatusSwitch(sdk, s = false) {
- if(!sdk) {
+ if (!sdk) {
return
}
if (!tools) {
@@ -32,7 +32,7 @@ function SheetIndexStatusSwitch(sdk, s = false) {
}
let sdkD = getSdk().sdkD
- if(sdkD && sdk !== sdkD) {
+ if (sdkD && sdk !== sdkD) {
SheetIndexStatusSwitch(sdkD, s)
}
@@ -118,7 +118,6 @@ function open(sdk) {
break;
}
}
-
if (!gridPrimitives) {
gridPrimitives = new Cesium.PrimitiveCollection();
gridPrimitives.name = 'SheetIndexGridPrimitives';
@@ -128,7 +127,6 @@ function open(sdk) {
labelCollection = new Cesium.LabelCollection();
labelCollection.name = 'SheetIndexLabelCollection';
}
-
let stationaryFrames = 0;
let maxRectangle = null;
gridPrimitives.postRenderEvent = () => {
diff --git a/src/Obj/Base/BatchModel/index.js b/src/Obj/Base/BatchModel/index.js
index adc67a1..d681af9 100644
--- a/src/Obj/Base/BatchModel/index.js
+++ b/src/Obj/Base/BatchModel/index.js
@@ -72,6 +72,7 @@ class BatchModel extends Base {
break;
}
Draw && Draw.start((a, positions) => {
+ console.log(positions, 'positions')
this.options.positions = positions;
//判断范围是否过大
if (options.type == '面') {