Compare commits

...

3 Commits

Author SHA1 Message Date
zh
a6fb1af6f9 二三维单独显示状态保存 2025-08-13 21:56:53 +08:00
zh
d17b038388 贴地图片增加立体模式 2025-08-13 21:56:07 +08:00
zh
fff8041faa showView状态保存 2025-08-13 11:51:39 +08:00
18 changed files with 1440 additions and 129 deletions

View File

@ -50,6 +50,11 @@ async function init(sdk) {
for (let i = 0; i < imageryLayers.length; i++) {
let entity = sdk2D.viewer.imageryLayers.addImageryProvider(imageryLayers[i].imageryProvider, imageryLayers[i]._layerIndex)
entity.show = imageryLayers[i].show
if (imageryLayers[i]._objectState) {
if (imageryLayers[i]._showView == 3) {
entity.show = false
}
}
}
// sdk.viewer.entities.collectionChanged.addEventListener(syncEntities)
// sdk.viewer.dataSources.dataSourceAdded.addEventListener(syncDataSources)
@ -61,6 +66,12 @@ async function init(sdk) {
JwwStatusSwitch(sdk2, true)
}
sdk.entityMap.forEach((item, key) => {
if (item.showView == 2) {
item.showView = 2
}
})
}
async function on(sdk) {
if (sdk2D) {
@ -95,9 +106,10 @@ function off(sdk) {
syncObject = {}
}
sdk.entityMap.forEach((item, key) => {
item.showView = undefined
if (item.showView) {
item.show = item.show
}
})
}
async function syncData2(sdk, id, entityId) {
@ -123,10 +135,10 @@ async function syncData2(sdk, id, entityId) {
options.heightMode = 0
options.height = 0
}
if (!that.type || (that.type !== 'tileset' && that.type !== 'bim' && that.type !== 'glb' && that.type !== 'layer')) {
if(that.showView==3) {
options.show=false
if (that.showView == 3) {
options.show = false
}
let newObject = await new that.constructor(sdk2D, options)
newObject.onClick = that.onClick
@ -216,6 +228,9 @@ async function syncData2(sdk, id, entityId) {
}
let options = syncObject.tools.deepCopyObj(obj.options)
if (!obj.type || (obj.type !== 'tileset' && obj.type !== 'bim' && obj.type !== 'glb' && obj.type !== 'layer')) {
if (obj.showView == 3) {
options.show = false
}
let target = await new obj.constructor(sdk2D, options)
target.onClick = obj.onClick
target.onRightClick = obj.onRightClick
@ -413,15 +428,15 @@ function syncImageryLayerShownOrHidden(layer, index, state) {
let layer2d = sdk2D.viewer.imageryLayers._layers[index]
let layer3d = sdk3D.viewer.imageryLayers._layers[index]
console.log('layer2d', layer2d, sdk2D, layer3d)
if (!layer2d) {
return
}
if(layer3d._objectState) {
if(!layer3d._showView || layer3d._showView==2) {
if (layer3d._objectState) {
if (!layer3d._showView || layer3d._showView == 2) {
layer2d.show = true
}
if(layer3d._showView==3) {
if (layer3d._showView == 3) {
layer2d.show = false
}
}

View File

@ -100,14 +100,14 @@ function MouseRightMenu(sdk, status, callBack) {
that = sdk.entityMap.get(entityId)
}
if (that && that.picking) {
addedMenu = `
<span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>
<ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">
<li style="padding: 3px 10px;cursor: pointer;">属性</li>
</ul>
`
}
// if (that && that.picking) {
// addedMenu = `
// <span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>
// <ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">
// <li style="padding: 3px 10px;cursor: pointer;">属性</li>
// </ul>
// `
// }
let position = tools.cartesian3Towgs84(cartesian, sdk.viewer)
menuElm = document.createElement('div')
menuElm.id = 'custom-menu'

View File

@ -6,7 +6,7 @@ import EventBinding from '../../Element/Dialog/eventBinding';
import richText from "../../Element/richText";
import MouseEvent from '../../../Event/index'
import LabelObject from '../LabelObject'
import { syncData } from '../../../Global/MultiViewportMode'
import { syncData, getSdk as get2DSdk } from '../../../Global/MultiViewportMode'
import { legp } from '../../Element/datalist';
import { getFontList, getFontFamilyName } from '../../Element/fontSelect'
import MouseTip from '../../../MouseTip'
@ -223,10 +223,11 @@ class CircleDiffuse extends Base {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DSdk().sdkD
if (!this.isShowView || !sdkD) {
this.options.show = v
}
if (!this.showView || this.showView == 3) {
if (!this.showView || this.showView == 3 || !sdkD) {
this.entity.show = this.options.show
if (this.options.label.show) {
this.label.show = this.options.show
@ -442,8 +443,9 @@ class CircleDiffuse extends Base {
return this.options.label.show
}
set labelShow(v) {
let sdkD = get2DSdk().sdkD
this.options.label.show = v
if (this.show && (!this.showView || this.showView == 3)) {
if (this.show && (!this.showView || this.showView == 3 || !sdkD)) {
this.label.show = v
}
else {
@ -1336,7 +1338,7 @@ class CircleDiffuse extends Base {
}
async remove() {
this.label.remove()
this.label && this.label.remove()
this.entity && this.sdk.viewer.entities.remove(this.entity)
this.entity2 && this.sdk.viewer.entities.remove(this.entity2)
this.entity = null

View File

@ -9,7 +9,7 @@ import { getHost, getToken } from "../../../on";
import Base from '../index'
import Tools from '../../../Tools'
import { syncSplitData } from "../../../Global/SplitScreen";
import { syncData } from '../../../Global/MultiViewportMode'
import { syncData, getSdk as get2DSdk } from '../../../Global/MultiViewportMode'
import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Global/global'
class GeoJson extends Base {
@ -52,11 +52,12 @@ class GeoJson extends Base {
}
// set show(status) {
// if (!this.isShowView) {
// let sdkD = get2DSdk().sdkD
// if (!this.isShowView || !sdkD) {
// this.options.show = status
// }
// if (this.entity) {
// if (!this.showView || this.showView == 3) {
// if (!this.showView || this.showView == 3 || !sdkD) {
// for (let i = 0; i < this.entity.entities.values.length; i++) {
// this.entity.entities.values[i].show = this.options.show
// }

View File

@ -1,5 +1,5 @@
function html() {
return `
return `
<span class="custom-divider"></span>
<div class="div-item">
<div class="row">
@ -7,14 +7,21 @@ function html() {
<span class="label">名称</span>
<input class="input" maxlength="40" type="text" @model="name">
</div>
<div class="col">
<button class="anchor btn">调整锚点</button>
</div>
<div class="col"></div>
</div>
</div>
<span class="custom-divider"></span>
<div class="div-item">
<div class="row">
<div class="col">
<button class="anchor btn">调整锚点</button>
</div>
<div class="col mode-box">
<span class="label" style="flex: unset;">军标模式</span>
<div class="mode"></div>
</div>
</div>
<div class="row" mode="0">
<div class="col">
<span class="label">旋转角度</span>
<input type="range" max="360" min="0" step="0.1" @model="angle">
@ -25,7 +32,7 @@ function html() {
</div>
</div>
</div>
<div class="row">
<div class="row" mode="0">
<div class="col">
<span class="label">调整大小</span>
<input type="range" max="40000" min="0" step="0.1" @model="scale">
@ -35,6 +42,75 @@ function html() {
</div>
</div>
</div>
<div class="row" mode="1">
<div class="col height-mode-box" style="flex: 0 0 155px;margin-right: 10px;">
<span class="label" style="flex: 0 0 56px;">高度模式</span>
<div class="height-mode"></div>
</div>
<div class="col" style="margin: 0 10px;">
<div class="height-box" style="display: flex; align-items: center;">
<span class="label" style="flex: 0 0 56px;">高度</span>
<div class="input-number input-number-unit-1">
<input class="input height" type="number" title="" min="-9999999" max="999999999">
<span class="unit">m</span>
<span class="arrow"></span>
</div>
</div>
</div>
<div class="col" style="margin-left: 10px;">
<span class="label">图标倍数</span>
<div class="input-number input-number-unit-1">
<input class="input" type="number" title="" data-min="0.1" max="99" @model="billboardScale">
<span class="unit">倍</span>
<span class="arrow"></span>
</div>
</div>
</div>
<div class="row" mode="1">
<div class="col" style="flex: 0 0 155px;margin-right: 10px;">
<span class="label">视野缩放</span>
<input class="btn-switch" type="checkbox" @model="billboardScaleByDistance">
</div>
<div class="col" style="margin: 0 10px;">
<span class="label">最近距离</span>
<div class="input-number input-number-unit-1">
<input class="input" type="number" title="" min="1" max="99999999" @model="billboardNear">
<span class="unit">m</span>
<span class="arrow"></span>
</div>
</div>
<div class="col" style="margin-left: 10px;">
<span class="label">最远距离</span>
<div class="input-number input-number-unit-1">
<input class="input" type="number" title="" min="1" max="99999999" @model="billboardFar">
<span class="unit">m</span>
<span class="arrow"></span>
</div>
</div>
</div>
<h4 mode="1">文字设置</h4>
<div class="row" mode="1">
<div class="col" style="flex: 0 0 80px;margin: 0 10px;">
<span class="label" style="flex: none;">显隐</span>
<input class="btn-switch" type="checkbox" @model="labelShow">
</div>
<div class="col font-select-box" style="margin: 0 0px;flex: 0 0 150px;">
<span class="label" style="flex: none;">字体选择</span>
<div class="input input-select font-select"></div>
</div>
<div class="col" style="margin: 0 10px;">
<span class="label">文字大小</span>
<div class="input-number input-number-unit-2">
<input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;">
<span class="unit">px</span>
<span class="arrow"></span>
</div>
</div>
<div class="col" style="margin-left: 10px;">
<span class="label">文字颜色</span>
<div class="labelColor"></div>
</div>
</div>
</div>
<span class="custom-divider"></span>
`

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ import EventBinding from './eventBinding'
import Base from "../../index";
import MouseEvent from '../../../../Event/index'
import { syncPrimitives } from '../../../../Global/MultiViewportMode'
import { syncData } from '../../../../Global/MultiViewportMode'
import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode'
import MouseTip from '../../../../MouseTip'
import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen'
import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global'
@ -82,10 +82,11 @@ class Flame extends Base {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DSdk().sdkD
if (!this.isShowView || !sdkD) {
this.options.show = v
}
if (!this.showView || this.showView == 3) {
if (!this.showView || this.showView == 3 || !sdkD) {
if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) {
this.entity.show = this.options.show
}

View File

@ -6,7 +6,7 @@ import { html } from "./_element";
import EventBinding from './eventBinding'
import Base from "../../index";
import MouseEvent from '../../../../Event/index'
import { syncData } from '../../../../Global/MultiViewportMode'
import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode'
import MouseTip from '../../../../MouseTip'
import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen'
import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global'
@ -83,10 +83,11 @@ class Fountain extends Base {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DSdk().sdkD
if (!this.isShowView || !sdkD) {
this.options.show = v
}
if (!this.showView || this.showView == 3) {
if (!this.showView || this.showView == 3 || !sdkD) {
if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) {
this.entity.show = this.options.show
}

View File

@ -6,7 +6,7 @@ import { html, css } from "./_element";
import EventBinding from './eventBinding'
import Base from "../../index";
import MouseEvent from '../../../../Event/index'
import { syncData } from '../../../../Global/MultiViewportMode'
import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode'
import MouseTip from '../../../../MouseTip'
import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen'
import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global'
@ -81,10 +81,11 @@ class Smoke extends Base {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DSdk().sdkD
if (!this.isShowView || !sdkD) {
this.options.show = v
}
if (!this.showView || this.showView == 3) {
if (!this.showView || this.showView == 3 || !sdkD) {
if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) {
this.entity.show = this.options.show
}

View File

@ -5,7 +5,7 @@ import Dialog from '../../../Element/Dialog';
import { html, css } from "./_element";
import Base from "../../index";
import MouseEvent from '../../../../Event/index'
import { syncData } from '../../../../Global/MultiViewportMode'
import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode'
import MouseTip from '../../../../MouseTip'
import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen'
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global'
@ -84,10 +84,11 @@ class Spout extends Base {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DSdk().sdkD
if (!this.isShowView || !sdkD) {
this.options.show = v
}
if (!this.showView || this.showView == 3) {
if (!this.showView || this.showView == 3 || !sdkD) {
if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) {
this.entity.show = this.options.show
}

View File

@ -1216,7 +1216,6 @@ class PolygonObject extends Base {
alt: this.label.position[2]
}
this.originalOptions = this.deepCopyObj(this.options)
console.log('000000000000',this.options.label.scaleByDistance)
this._DialogObject.close()
this.Dialog.confirmCallBack &&
this.Dialog.confirmCallBack(this.originalOptions)

View File

@ -61,7 +61,7 @@ class eventBinding {
})
blurEvent = (e) => {
let value = e.target.value
if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) {
if ((e.target.type == 'number') && (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null)))) {
value = Number(value)
if ((e.target.max) && value > Number(e.target.max)) {
value = Number(e.target.max)

View File

@ -6,7 +6,7 @@ import EventBinding from '../../Element/Dialog/eventBinding';
import richText from "../../Element/richText";
import MouseEvent from '../../../Event/index'
import LabelObject from '../LabelObject'
import { syncData } from '../../../Global/MultiViewportMode'
import { syncData, getSdk as get2DSdk } from '../../../Global/MultiViewportMode'
import { legp } from '../../Element/datalist';
import { getFontList, getFontFamilyName } from '../../Element/fontSelect'
import MouseTip from '../../../MouseTip'
@ -246,10 +246,11 @@ class RadarScan extends Base {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DSdk().sdkD
if (!this.isShowView || !sdkD) {
this.options.show = v
}
if (!this.showView || this.showView == 3) {
if (!this.showView || this.showView == 3 || !sdkD) {
this.entity.show = this.options.show
if (this.options.label.show && this.label) {
this.label.show = this.options.show
@ -460,8 +461,9 @@ class RadarScan extends Base {
return this.options.label.show
}
set labelShow(v) {
let sdkD = get2DSdk().sdkD
this.options.label.show = v
if (this.show && (!this.showView || this.showView == 3)) {
if (this.show && (!this.showView || this.showView == 3 || !sdkD)) {
this.label.show = v
}
else {
@ -1386,7 +1388,7 @@ class RadarScan extends Base {
}
async remove() {
this.label.remove()
this.label && this.label.remove()
this.entity && this.sdk.viewer.entities.remove(this.entity)
this.entity2 && this.sdk.viewer.entities.remove(this.entity2)
this.entity = null

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 {

View File

@ -57,7 +57,7 @@ class eventBinding {
})
blurEvent = (e) => {
let value = e.target.value
if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) {
if ((e.target.type == 'number') && (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null)))) {
value = Number(value)
if ((e.target.max) && value > Number(e.target.max)) {
value = Number(e.target.max)

View File

@ -54,7 +54,7 @@ class eventBinding {
})
blurEvent = (e) => {
let value = e.target.value
if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) {
if ((e.target.type == 'number') && (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null)))) {
value = Number(value)
if ((e.target.max) && value > Number(e.target.max)) {
value = Number(e.target.max)

View File

@ -31,6 +31,7 @@ class Base extends Tools {
this.rightClickCallBack = null
this.picking = true
this.options.host = this.options.host || getHost()
// this.#_showView = this.options.showView || 0
this.setDefaultValue()
// this.sdk.addIncetance(this.options.id, this)
@ -66,7 +67,15 @@ class Base extends Tools {
let sdk2D = get2DSdk().sdkD
if (!sdk2D) {
v = 0
this.#_showView = v
if(this.entity) {
this.entity._showView = v
}
return
}
if (this.sdk === sdk2D) {
this.#_showView = 0
return
}
if (!this.#_showView && !this.show) {
return
@ -120,7 +129,8 @@ class Base extends Tools {
set show(v) {
if (typeof v === "boolean") {
if (!this.isShowView) {
let sdkD = get2DSdk().sdkD
if (!this.isShowView || !sdkD) {
this.options.show = v
if (this.originalOptions) {
this.originalOptions.show = v
@ -132,7 +142,7 @@ class Base extends Tools {
this.entity._objectState = this.options.show
}
}
if (!this.showView || this.showView == 3) {
if (!this.showView || this.showView == 3 || !sdkD) {
this.entity && (this.entity.show = this.options.show)
if (this.options.label && this.options.label.show && this.label) {
this.label.show = this.options.show
@ -154,7 +164,6 @@ class Base extends Tools {
syncSplitData(this.sdk, this.options.id)
this.isShowView = false
let { sdkP, sdkD } = get2DSdk()
if (this.type == 'layer' && sdkD) {
let layer2d = sdkD.viewer.imageryLayers._layers[this.layerIndex]
let layer3d = this.entity

View File

@ -3096,7 +3096,7 @@
/* 贴地图片 */
.YJ-custom-base-dialog.ground-image>.content {
width: 500px;
width: 560px;
}
/* 模型 */