showView状态保存

This commit is contained in:
zh
2025-08-13 11:51:39 +08:00
parent 20ae03cc5e
commit fff8041faa
11 changed files with 86 additions and 57 deletions

View File

@ -144,7 +144,8 @@ class TrajectoryMotion extends Base {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DView()
if (!this.isShowView || !sdkD) {
this.options.show = v
if (this.originalOptions) {
this.originalOptions.show = v
@ -155,10 +156,10 @@ class TrajectoryMotion extends Base {
this.model.show = false
}
else {
this.model.show = (!this.showView || this.showView == 3) ? this.modelShow : false
this.model.show = (!this.showView || this.showView == 3 || !sdkD) ? this.modelShow : false
}
if ((!this.showView || this.showView == 3)) {
if ((!this.showView || this.showView == 3 || !sdkD)) {
this.line.polyline.material = this.lineShow ? new Cesium.PolylineDashMaterialProperty({
color: new Cesium.Color.fromCssColorString('#00ffff'),
dashLength: 20,
@ -174,17 +175,17 @@ class TrajectoryMotion extends Base {
})
}
for (let i = 0; i < this.keyPoints.length; i++) {
this.keyPoints[i].show = (!this.showView || this.showView == 3) ? this.keyPointShow : false
this.keyPoints[i].show = (!this.showView || this.showView == 3 || !sdkD) ? this.keyPointShow : false
}
if (this.realTimeRoute) {
this.realTimeLine && (this.realTimeLine.show = (!this.showView || this.showView == 3) ? true : false)
this.realTimeLine && (this.realTimeLine.show = (!this.showView || this.showView == 3 || !sdkD) ? true : false)
}
this.label && (this.label.show = (!this.showView || this.showView == 3) ? this.options.label.show : false)
this.label && (this.label.show = (!this.showView || this.showView == 3 || !sdkD) ? this.options.label.show : false)
}
else {
this.model.show = (!this.showView || this.showView == 3) ? this.options.show : false
this.model.show = (!this.showView || this.showView == 3 || !sdkD) ? this.options.show : false
let show = this.options.show
if ((!this.showView || this.showView == 3)) {
if ((!this.showView || this.showView == 3 || !sdkD)) {
show = this.options.show
}
else {
@ -673,9 +674,10 @@ class TrajectoryMotion extends Base {
return this.options.model.show
}
set modelShow(v) {
let sdkD = get2DView()
this.options.model.show = v
let show = v
if (this.show && (!this.showView || this.showView == 3)) {
if (this.show && (!this.showView || this.showView == 3 || !sdkD)) {
show = v
}
else {
@ -749,7 +751,8 @@ class TrajectoryMotion extends Base {
}
this.options.line.show = v
let show = v
if ((!this.showView || this.showView == 3)) {
let sdkD = get2DView()
if ((!this.showView || this.showView == 3 || !sdkD)) {
show = v
}
else {
@ -973,6 +976,7 @@ class TrajectoryMotion extends Base {
set firstPersonView(v) {
// this.state = true
let sdkD = get2DView()
let splitSdk = getSdk()
if (get2DView() || splitSdk.sdkD || !this.show) {
v = false
@ -1027,7 +1031,7 @@ class TrajectoryMotion extends Base {
CameraController(this.sdk, true)
if (this.model && this.modelShow && this.show) {
let show = true
if (this.show && (!this.showView || this.showView == 3)) {
if (this.show && (!this.showView || this.showView == 3 || !sdkD)) {
show = true
}
else {
@ -1155,8 +1159,9 @@ class TrajectoryMotion extends Base {
}
set labelShow(v) {
this.options.label.show = v
let sdkD = get2DView()
let show = v
if (this.show && (!this.showView || this.showView == 3)) {
if (this.show && (!this.showView || this.showView == 3 || !sdkD)) {
show = v
}
else {