From 552c086d3a7a10f734ab0045b5b0586f9e63c9d2 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 18 Jul 2025 14:23:34 +0800 Subject: [PATCH 01/53] =?UTF-8?q?=E5=88=A4=E6=96=ADviewer=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/BillboardObject/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Obj/Base/BillboardObject/index.js b/src/Obj/Base/BillboardObject/index.js index 053a51c..968d751 100644 --- a/src/Obj/Base/BillboardObject/index.js +++ b/src/Obj/Base/BillboardObject/index.js @@ -2344,6 +2344,9 @@ class BillboardObject extends Base { } async updateHeight() { + if(!this.sdk || !this.sdk.viewer || !this.sdk.viewer.scene) { + return + } let height let height2 let point1 = new Cesium.Cartesian3.fromDegrees( From f2a198ddaff8c2ba9c9064eba037e0ce5df13c0b Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 18 Jul 2025 16:49:42 +0800 Subject: [PATCH 02/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=8C=E4=B8=89?= =?UTF-8?q?=E7=BB=B4=E5=BF=AB=E9=80=9F=E5=88=87=E6=8D=A2=E8=B4=B4=E5=9C=B0?= =?UTF-8?q?svg=E6=98=BE=E9=9A=90=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/GroundSvg/index.js | 21 +++++++++--- src/Obj/Base/LabelObject/index.js | 5 +++ src/Obj/Base/PolylineObject/index.js | 50 ++++++++++++++++++++++++++++ src/Obj/Element/yj-color-picker.js | 7 ++++ static/custom/css/index.css | 2 +- 5 files changed, 79 insertions(+), 6 deletions(-) diff --git a/src/Obj/Base/GroundSvg/index.js b/src/Obj/Base/GroundSvg/index.js index 2a0471c..d738ae7 100644 --- a/src/Obj/Base/GroundSvg/index.js +++ b/src/Obj/Base/GroundSvg/index.js @@ -108,12 +108,18 @@ class GroundSvg extends Base { this._isdrag = false this._EventBinding = new EventBinding() + if(this.sdk.entityMap.get(this.options.id)) { + return + } this.sdk.addIncetance(this.options.id, this) this.picking = true + if (this.options.show) { setSplitDirection(0, this.options.id) } + + this._entityArray = [] this.init() } @@ -157,8 +163,6 @@ class GroundSvg extends Base { if (this.options.text && this.options.text.show && this.text) { this.text.show = v } - syncData(this.sdk, this.options.id) - syncSplitData(this.sdk, this.options.id) } else { console.error("参数必须为boolean") } @@ -820,8 +824,13 @@ class GroundSvg extends Base { } for (let i = 0; i < this.hierarchys.length; i++) { for (let m = 0; m < this.hierarchys[i].length; m++) { + let id = this.options.id + `-${i}_${m}}` + let oldEntity = this.sdk.viewer.entities.getById(id) + if(oldEntity) { + this.sdk.viewer.entities.remove(oldEntity) + } let entity = this.sdk.viewer.entities.add({ - id: this.options.id + `-${i}_${m}`, + id: this.options.id + `-${i}_${m}}`, show: this.options.show, polygon: { hierarchy: new Cesium.CallbackProperty(() => { @@ -854,6 +863,7 @@ class GroundSvg extends Base { color: this.geojson.features[i].properties.color } } + this._entityArray.push(entity) this.entity.add(entity) } } @@ -1991,6 +2001,8 @@ class GroundSvg extends Base { } async remove() { + this._worker.onmessage = (event) => {} + await this.sdk.removeIncetance(this.options.id) if (!this.entity) { return } @@ -2000,12 +2012,11 @@ class GroundSvg extends Base { for (let i = this.entity.values.length; i >= 0; i--) { this.sdk.viewer.entities.remove(this.entity.values[i]) } - this.entity = null if (this._DialogObject && !this._DialogObject.isDestroy) { this._DialogObject.close() this._DialogObject = null } - await this.sdk.removeIncetance(this.options.id) + await syncData(this.sdk, this.options.id) } diff --git a/src/Obj/Base/LabelObject/index.js b/src/Obj/Base/LabelObject/index.js index 25adf1d..dfd9dc1 100644 --- a/src/Obj/Base/LabelObject/index.js +++ b/src/Obj/Base/LabelObject/index.js @@ -65,6 +65,11 @@ class LabelObject extends Base { } this.originalOptions = copyObj(this.options) + let id = this.options.id + '-label' + let oldEntity = this.sdk.viewer.entities.getById(id) + if(oldEntity) { + this.sdk.viewer.entities.remove(oldEntity) + } this.entity = this.sdk.viewer.entities.add({ show: this.options.show, id: this.options.id + '-label', diff --git a/src/Obj/Base/PolylineObject/index.js b/src/Obj/Base/PolylineObject/index.js index 96c6f64..bdc778e 100644 --- a/src/Obj/Base/PolylineObject/index.js +++ b/src/Obj/Base/PolylineObject/index.js @@ -13,6 +13,7 @@ import MouseTip from '../../../MouseTip' import Controller from '../../../Controller/index' import { syncData } from '../../../Global/MultiViewportMode' import { legp } from '../../Element/datalist' +import { getFontList, getFontFamilyName } from '../../Element/fontSelect' import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' @@ -82,6 +83,7 @@ class PolylineObject extends Base { options.label.fontSize || options.label.fontSize === 0 ? options.label.fontSize : 20, + fontFamily: options.label.fontFamily ? options.label.fontFamily : 0, color: options.label.color || '#ffffff', lineWidth: options.label.lineWidth || options.label.lineWidth === 0 @@ -693,6 +695,21 @@ class PolylineObject extends Base { }) } + get labelFontFamily() { + return this.options.label.fontFamily + } + + set labelFontFamily(v) { + this.options.label.fontFamily = v || 0 + this.label && (this.label.fontFamily = this.options.label.fontFamily) + + let name = getFontFamilyName(this.labelFontFamily) || '' + this._elms.labelFontFamily && + this._elms.labelFontFamily.forEach(item => { + item.value = name + }) + } + get labelColor() { return this.options.label.color } @@ -1289,6 +1306,7 @@ class PolylineObject extends Base { ], text: that.options.name, fontSize: that.options.label.fontSize, + fontFamily: that.options.label.fontFamily, color: that.options.label.color, pixelOffset: that.options.label.pixelOffset, backgroundColor: that.options.label.backgroundColor, @@ -2147,6 +2165,37 @@ class PolylineObject extends Base { this._elms.altInput.push(altInput) tBodyElm.appendChild(tr) } + + + let fontData = getFontList() + let fontObject = legp( + this._DialogObject._element.content.getElementsByClassName( + 'font-select-box' + )[0], + '.font-select' + ) + if (fontObject) { + fontObject.legp_search(fontData) + let fontDataLegpElm = this._DialogObject._element.content + .getElementsByClassName('font-select')[0] + .getElementsByTagName('input')[0] + fontDataLegpElm.value = fontData[this.labelFontFamily].value + for (let i = 0; i < fontData.length; i++) { + if (fontData[i].value == fontDataLegpElm.value) { + fontObject.legp_searchActive(fontData[i].value) + break + } + } + fontDataLegpElm.addEventListener('input', () => { + for (let i = 0; i < fontData.length; i++) { + if (fontData[i].value === fontDataLegpElm.value) { + this.labelFontFamily = fontData[i].key + break + } + } + }) + this._elms.labelFontFamily = [fontDataLegpElm] + } }, 0) } else { if (this._DialogObject && this._DialogObject.close) { @@ -2348,6 +2397,7 @@ class PolylineObject extends Base { this.labelShow = this.originalOptions.label.show this.labelColor = this.originalOptions.label.color this.labelFontSize = this.originalOptions.label.fontSize + this.labelFontFamily = this.originalOptions.label.fontFamily this.labelLineWidth = this.originalOptions.label.lineWidth this.labelPixelOffset = this.originalOptions.label.pixelOffset this.labelLineColor = this.originalOptions.label.lineColor diff --git a/src/Obj/Element/yj-color-picker.js b/src/Obj/Element/yj-color-picker.js index 0f95080..0526de9 100644 --- a/src/Obj/Element/yj-color-picker.js +++ b/src/Obj/Element/yj-color-picker.js @@ -86,6 +86,13 @@ class YJColorPicker { let pickPen = document.createElement('div') pickPen.className = 'icon-pen-box' pickPen.innerHTML = '' + + /** 为完成、暂时隐藏 */////// + pickPen.style.opacity = '0' + pickPen.style.cursor = 'unset' + + + let pickerInput = _this.colorPicker.pickerInput pickerInput.parentNode.insertBefore(pickPen, pickerInput) pickerInput.style.width = '188px' diff --git a/static/custom/css/index.css b/static/custom/css/index.css index fc4b55b..c96547d 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -1058,7 +1058,6 @@ .YJ-custom-base-dialog .ew-color-picker .icon-pen-box { display: inline-block; /* cursor: pointer; */ - cursor: no-drop; width: 24px; height: 24px; text-align: center; @@ -1132,6 +1131,7 @@ .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract { border-color: rgba(var(--color-sdk-base-rgb), 0.2); background: unset; + line-height: 22px; } .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.add:hover, .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract:hover { From a79c09b45d8a6fb0e60db85ab3c86045e713d92e Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 23 Jul 2025 16:42:01 +0800 Subject: [PATCH 03/53] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Element/yj-color-picker.js | 60 ++++++++++++++++++++++++------ static/3rdparty/ewPlugins.min.js | 27 ++++++++++++-- static/custom/css/index.css | 4 +- 3 files changed, 75 insertions(+), 16 deletions(-) diff --git a/src/Obj/Element/yj-color-picker.js b/src/Obj/Element/yj-color-picker.js index 0526de9..3495428 100644 --- a/src/Obj/Element/yj-color-picker.js +++ b/src/Obj/Element/yj-color-picker.js @@ -13,13 +13,16 @@ class YJColorPicker { openPickerAni: 'opacity', defaultColor: options.defaultColor, startMainCallback: (t) => { - customizeStyle() + _this.colorPicker && (_this.colorPicker.picker.style.opacity = 0) + setTimeout(() => { + customizeStyle() + }, 0); } } this.el = options.el if (options.sure) { config.sure = (color) => { - this.colorPicker.config.defaultColor = this.colorPicker.pickerInput.value + // this.colorPicker.config.defaultColor = this.colorPicker.pickerInput.value let c = Cesium.Color.fromCssColorString(color) if (pickAlphaInput) { c = c.withAlpha(pickAlphaInput.value / 100) @@ -53,7 +56,7 @@ class YJColorPicker { } } let CesiumColor - if(config.defaultColor) { + if (config.defaultColor) { CesiumColor = Cesium.Color.fromCssColorString(config.defaultColor) } // if (options.predefineColor) { @@ -61,19 +64,40 @@ class YJColorPicker { // } config.predefineColor = ['rgba(255, 255, 255, 1)', 'rgba(255, 0, 0, 1)', 'rgba(208, 132, 209, 1)', 'rgba(100, 182, 217, 1)', 'rgba(42, 130, 228, 1)', 'rgba(214, 36, 36, 1)', 'rgba(252, 222, 111, 1)', 'rgba(67, 207, 124, 1)', 'rgba(176, 243, 143, 1)', 'rgba(121, 72, 234, 1)', 'rgba(255, 195, 0, 1)', 'rgba(0, 186, 173, 1)', 'rgba(165, 214, 63, 1)', 'rgba(0, 0, 0, 1)', 'rgba(46, 47, 51, 1)', 'rgba(172, 51, 193, 1)', 'rgba(130, 21, 21, 1)', 'rgba(255, 87, 51, 1)', 'rgba(255, 140, 0, 1)', 'rgba(125, 191, 255, 1)'] this.colorPicker = new ewPlugins('colorpicker', config) - // window.colorPicker = this.colorPicker + window.colorPicker = this.colorPicker customizeStyle() function customizeStyle() { - if (!_this.colorPicker) { + if (!_this.colorPicker || !_this.colorPicker.picker) { return } let isSubtract = false let box = _this.colorPicker.box let picker = _this.colorPicker.picker + let x = box.getBoundingClientRect().x + let y = box.getBoundingClientRect().y + let height = 0 + + // if (picker.style.display === 'none') { + // picker.style.display = 'block' + // height = picker.offsetHeight + // console.log('picker.style.display.opacity', picker.style.display.opacity) + // picker.style.display = 'none' + // } + // console.log('===========================================') + // console.log((y + box.offsetHeight + 4), height, window.innerHeight) + // if ((y + box.offsetHeight + 4) + height > window.innerHeight) { + // console.log(y, height) + // picker.style.top = y - height + 'px' + // } + // else { + // picker.style.top = (y + box.offsetHeight + 4) + 'px' + // } + + picker.style.left = x + 'px' picker.style.minWidth = '325px' - let pickerContent = picker.getElementsByClassName('ew-color-picker-content')[0] + // let pickerContent = picker.getElementsByClassName('ew-color-picker-content')[0] let pickAlphaSliderBar = picker.getElementsByClassName('ew-alpha-slider-bar')[0] if (pickAlphaSliderBar) { pickAlphaSliderBar.parentNode.style.width = '16px' @@ -101,7 +125,7 @@ class YJColorPicker { let pickAlpha = document.createElement('div') pickAlpha.className = 'input-number input-number-unit-1 color-alpha' pickAlpha.innerHTML = ` - + % ` pickerInput.parentNode.insertBefore(pickAlpha, pickerInput.nextSibling) @@ -121,14 +145,14 @@ class YJColorPicker { if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { value = Number(e.target.dataset.min) } - pickAlphaInput.value = Number(value.toFixed(2)) + pickAlphaInput.value = Number(value.toFixed(0)) } }) if (_this.pickAlphaInputValue || _this.pickAlphaInputValue === 0 || _this.pickAlphaInputValue === '0') { - pickAlphaInput.value = Number(Number(_this.pickAlphaInputValue).toFixed(2)) + pickAlphaInput.value = Number(Number(_this.pickAlphaInputValue).toFixed(0)) } else { - pickAlphaInput.value = CesiumColor ? Number((CesiumColor.alpha * 100).toFixed(2)) : 100 + pickAlphaInput.value = CesiumColor ? Number((CesiumColor.alpha * 100).toFixed(0)) : 100 } _this.pickAlphaInputValue = pickAlphaInput.value box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').withAlpha(pickAlphaInput.value / 100).toCssColorString() @@ -270,12 +294,26 @@ class YJColorPicker { } }) } + + height = picker.offsetHeight + if (picker.style.display === 'none') { + picker.style.display = 'block' + height = picker.offsetHeight + picker.style.display = 'none' + } + if ((y + box.offsetHeight + 4) + height > window.innerHeight) { + picker.style.top = y - height + 'px' + } + else { + picker.style.top = (y + box.offsetHeight + 4) + 'px' + } + _this.colorPicker.pancelTop = parseFloat(picker.style.top) - 2 } function clickDefineColor(color) { if (pickAlphaInput) { let c = Cesium.Color.fromCssColorString(color) - pickAlphaInput.value = Number((c.alpha * 100).toFixed(2)) + pickAlphaInput.value = Number((c.alpha * 100).toFixed(0)) } } diff --git a/static/3rdparty/ewPlugins.min.js b/static/3rdparty/ewPlugins.min.js index 735f08b..8f9a006 100644 --- a/static/3rdparty/ewPlugins.min.js +++ b/static/3rdparty/ewPlugins.min.js @@ -809,6 +809,7 @@ } this.close = () => { this.pickerFlag = !this.pickerFlag, + this.picker.style.opacity = 0 this.render(this.box.parentNode, this.config), d(this), g(this, this.panelWidth, this.panelHeight) @@ -965,6 +966,7 @@ } , f.prototype.startMain = function(e, t) { + // console.log(e,t) var r = this; this.box = l(e, "ew-color-picker-box"), this.box.setAttribute("color-box-id", this.uid), @@ -1002,8 +1004,21 @@ c += s.offsetParent.offsetTop, f += s.offsetParent.offsetLeft, s = s.offsetParent; - this.pancelLeft = f, - this.pancelTop = c + e.offsetHeight, + this.pancelLeft = f; + let defineColorContainer = this.picker.getElementsByClassName('ew-pre-define-color-container')[0] + let customColorHeight = 0 + if(defineColorContainer) { + let colorList = localStorage.getItem('custom-color') || '{}' + colorList = JSON.parse(colorList) + customColorHeight = (Math.floor((Object.keys(colorList).length+2) / 11)+1) * 30 + } + this.picker.style.display = 'block' + this.pancelTop = e.getBoundingClientRect().y + (e.offsetHeight + customColorHeight) + 2 + if((this.picker.offsetHeight + customColorHeight) + this.pancelTop > window.innerHeight) { + this.pancelTop = e.getBoundingClientRect().y - (this.picker.offsetHeight + customColorHeight) + this.picker.style.top = this.pancelTop + 2 + 'px' + } + this.picker.style.display = 'none' this.preDefineItem = l(e, "ew-pre-define-color", !0), this.preDefineItem.length && (0, n.ewObjToArray)(this.preDefineItem).map(function(e) { @@ -1054,7 +1069,7 @@ }, !1), this.pickerClear.addEventListener("click", function() { !function(e, t) { - t.config.defaultColor = "rgba(255,255,255,1)", + t.config.defaultColor = "", t.pickerFlag = !t.pickerFlag, t.render(e, t.config), d(t), @@ -1070,6 +1085,8 @@ o.colorHsbaToRgba)(e.hsba) : (0, o.colorRgbaToHex)((0, o.colorHsbaToRgba)(e.hsba)); + e.config.defaultColor = e.pickerInput.value + e.render(e.box.parentNode, e.config), e.config.sure(t, e) }(r) }), @@ -1097,6 +1114,7 @@ }(r, e) }, !1), this.bindEvent(this.pickerCursor, function(e, t, r, n) { + // console.log(e) r=r-7 n=n-7 u(e, Math.max(0, Math.min(r - e.pancelLeft, i)), Math.max(0, Math.min(n - e.pancelTop, a)), i, a) @@ -1119,7 +1137,8 @@ a = i, o.moveX = n.eventType[0].indexOf("touch") > -1 ? a.changedTouches[0].clientX : a.clientX, o.moveY = n.eventType[0].indexOf("touch") > -1 ? a.changedTouches[0].clientY : a.clientY, - r ? t(o, o.moveX, o.moveY) : t(o, e, o.moveX, o.moveY) + r ? t(o, o.moveX, o.moveY) : t(o, e, o.moveX, o.moveY); + // console.log('222222', i, t,e, o.moveX, o.moveY) }; document.addEventListener(n.eventType[1], a, { capture: !1, diff --git a/static/custom/css/index.css b/static/custom/css/index.css index c96547d..87032c8 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -68,7 +68,6 @@ z-index: 999999; background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); border: 1.5px solid; - backdrop-filter: blur(2px); border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; text-align: left; font-family: 'sy-boldface'; @@ -1033,6 +1032,7 @@ background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; padding: 5px; + position: fixed !important; } .YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content { @@ -1160,6 +1160,7 @@ position: absolute; top: 0; left: 0; + line-height: 20px; } .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color:hover { @@ -1180,6 +1181,7 @@ .YJ-custom-base-dialog .ew-color-picker-box { border-width: 4px; border-color: #ffffff; + display: block; } .YJ-custom-base-dialog .ew-color-picker-box>.ew-color-picker-no, From 8ca3576c3e1e0fdc72007ed963dc56c74074dc3d Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 23 Jul 2025 16:42:47 +0800 Subject: [PATCH 04/53] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9C=B0=E5=BD=A2?= =?UTF-8?q?=E6=97=B6=E6=B8=85=E9=99=A4=E7=BB=98=E5=88=B6=E7=9A=84=E5=B1=80?= =?UTF-8?q?=E9=83=A8=E7=AD=89=E9=AB=98=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BaseDialog/index.js | 9 +++ src/Obj/Analysis/Contour/index.js | 5 ++ src/Obj/Base/BaseSource/BaseTerrain/index.js | 9 ++- src/Obj/Base/TextObject/StandText/index.js | 60 -------------------- src/Obj/Base/TrajectoryMotion/index.js | 2 +- 5 files changed, 22 insertions(+), 63 deletions(-) diff --git a/src/BaseDialog/index.js b/src/BaseDialog/index.js index df9aab3..de36a50 100644 --- a/src/BaseDialog/index.js +++ b/src/BaseDialog/index.js @@ -48,6 +48,15 @@ class BaseDialog { ` this._element.body.appendChild(this._element.foot) + let curtain = await document.createElement('div') + curtain.style.position = 'absolute' + curtain.style.top = '0' + curtain.style.left = '0' + curtain.style.width = '100%' + curtain.style.height = '100%' + curtain.style.backdropFilter = 'blur(2px)' + curtain.style.zIndex = '-999999' + this._element.body.appendChild(curtain) // 关闭 let closeBtnsBox = this._element.body.getElementsByClassName('close-box')[0]; diff --git a/src/Obj/Analysis/Contour/index.js b/src/Obj/Analysis/Contour/index.js index 6a246f9..56f8dff 100644 --- a/src/Obj/Analysis/Contour/index.js +++ b/src/Obj/Analysis/Contour/index.js @@ -47,6 +47,11 @@ class ContourAnalysis { YJ.Analysis.AnalysesResults.push(this) this.createNewLine(); } + + get type() { + return 'ContourAnalysis' + } + createNewLine() { ContourAnalysis.interpolatePoint(this); } diff --git a/src/Obj/Base/BaseSource/BaseTerrain/index.js b/src/Obj/Base/BaseSource/BaseTerrain/index.js index 0d2336c..9f9a087 100644 --- a/src/Obj/Base/BaseSource/BaseTerrain/index.js +++ b/src/Obj/Base/BaseSource/BaseTerrain/index.js @@ -8,7 +8,7 @@ import Dialog from '../../../Element/Dialog'; import { getHost } from "../../../../on"; import BaseSource from "../index"; -import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' +import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global' import { setSplitDirection, syncSplitData } from '../../../../Global/SplitScreen' class BaseTerrain extends BaseSource { @@ -78,6 +78,11 @@ class BaseTerrain extends BaseSource { close() { this.sdk.viewer.scene.terrainProvider = new Cesium.EllipsoidTerrainProvider({}) + for (let i = 0; i < YJ.Analysis.AnalysesResults.length; i++) { + if (YJ.Analysis.AnalysesResults[i].type === 'ContourAnalysis') { + YJ.Analysis.AnalysesResults[i].destroy() + } + } syncSplitData(this.sdk, this.options.id) clearTimeout(this.#updateModelTimeout) @@ -156,7 +161,7 @@ class BaseTerrain extends BaseSource { } setActiveViewer(0) closeRotateAround(this.sdk) - closeViewFollow(this.sdk) + closeViewFollow(this.sdk) if (this.options.customView && this.options.customView.relativePosition && this.options.customView.orientation) { let orientation = { diff --git a/src/Obj/Base/TextObject/StandText/index.js b/src/Obj/Base/TextObject/StandText/index.js index ed1ad98..6e2a173 100644 --- a/src/Obj/Base/TextObject/StandText/index.js +++ b/src/Obj/Base/TextObject/StandText/index.js @@ -417,71 +417,11 @@ class StandText extends Base { this.color = 'rgba(255,255,255,1)' },//点击清空按钮事件回调 }) - let labelColorPicker = new YJColorPicker({ - el: contentElm.getElementsByClassName("labelColor")[0], - size: 'mini',//颜色box类型 - alpha: true,//是否开启透明度 - defaultColor: this.labelColor, - disabled: false,//是否禁止打开颜色选择器 - openPickerAni: 'opacity',//打开颜色选择器动画 - sure: (color) => { - this.labelColor = color - },//点击确认按钮事件回调 - clear: () => { - this.labelColor = 'rgba(255,255,255,1)' - },//点击清空按钮事件回调 - }) - let lineColorPicker = new YJColorPicker({ - el: contentElm.getElementsByClassName("labelLineColor")[0], - size: 'mini',//颜色box类型 - alpha: true,//是否开启透明度 - defaultColor: this.labelLineColor, - disabled: false,//是否禁止打开颜色选择器 - openPickerAni: 'opacity',//打开颜色选择器动画 - sure: (color) => { - this.labelLineColor = color - },//点击确认按钮事件回调 - clear: () => { - this.labelLineColor = 'rgba(255,255,255,1)' - },//点击清空按钮事件回调 - }) - let labelBackgroundColorStartPicker = new YJColorPicker({ - el: contentElm.getElementsByClassName("labelBackgroundColorStart")[0], - size: 'mini', - alpha: true, - defaultColor: this.labelBackgroundColorStart, - disabled: false, - openPickerAni: 'opacity', - sure: (color) => { - this.labelBackgroundColorStart = color - }, - clear: () => { - this.labelBackgroundColorStart = 'rgba(255,255,255,1)' - }, - }) - let labelBackgroundColorEndPicker = new YJColorPicker({ - el: contentElm.getElementsByClassName("labelBackgroundColorEnd")[0], - size: 'mini', - alpha: true, - defaultColor: this.labelBackgroundColorEnd, - disabled: false, - openPickerAni: 'opacity', - sure: (color) => { - this.labelBackgroundColorEnd = color - }, - clear: () => { - this.labelBackgroundColorEnd = 'rgba(255,255,255,1)' - }, - }) let all_elm = contentElm.getElementsByTagName("*") this._EventBinding.on(this, all_elm) this._elms = this._EventBinding.element this._elms.color = [colorPicker] - this._elms.labelColor = [labelColorPicker] - this._elms.labelLineColor = [lineColorPicker] - this._elms.labelBackgroundColorStart = [labelBackgroundColorStartPicker] - this._elms.labelBackgroundColorEnd = [labelBackgroundColorEndPicker] } else { if (this._DialogObject && this._DialogObject.remove) { this._DialogObject.remove() diff --git a/src/Obj/Base/TrajectoryMotion/index.js b/src/Obj/Base/TrajectoryMotion/index.js index 888996a..0783b99 100644 --- a/src/Obj/Base/TrajectoryMotion/index.js +++ b/src/Obj/Base/TrajectoryMotion/index.js @@ -99,7 +99,7 @@ class TrajectoryMotion extends Base { color: options.label.color || '#ffffff', lineWidth: (options.label.lineWidth || options.label.lineWidth === 0) ? options.label.lineWidth : 4, pixelOffset: (options.label.pixelOffset || options.label.pixelOffset === 0) ? options.label.pixelOffset : 20, - backgroundColor: options.label.backgroundColor || ['#42c6ef', '#42c6ef'], + backgroundColor: options.label.backgroundColor || ['#00ffff80', '#00ffff80'], lineColor: options.label.lineColor || '#00ffff80', scaleByDistance: options.label.scaleByDistance || false, near: (options.label.near || options.label.near === 0) ? options.label.near : 2000, From 829d1a59f7442fea000ad9e0280394fb7c34252c Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 25 Jul 2025 09:18:28 +0800 Subject: [PATCH 05/53] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8=E6=A0=B7=E5=BC=8F=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BArgba=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Element/svg.js | 2 +- src/Obj/Element/yj-color-picker.js | 159 +++++++++++++++++++++++------ static/3rdparty/ewPlugins.min.js | 5 + static/custom/css/index.css | 28 ++++- static/custom/img/icom-confirm.svg | 4 + 5 files changed, 163 insertions(+), 35 deletions(-) create mode 100644 static/custom/img/icom-confirm.svg diff --git a/src/Obj/Element/svg.js b/src/Obj/Element/svg.js index 58bbc1e..3580739 100644 --- a/src/Obj/Element/svg.js +++ b/src/Obj/Element/svg.js @@ -1,4 +1,4 @@ -let list = ['icon-py', 'icon-edit', 'icon-add', 'icon-add2', 'icon-minus', 'icon-play', 'icon-pause', 'icon-updateheight', 'icon-draw', 'icon-positions', 'icon-reset', 'icon-xj', 'icon-yj', 'icon-zj', 'icon-close', 'icon-query', 'icon-route', 'icon-copy', 'icon-load', 'icon-rubric', 'icon-pen', 'icon-cross'] +let list = ['icon-py', 'icon-edit', 'icon-add', 'icon-add2', 'icon-minus', 'icon-play', 'icon-pause', 'icon-updateheight', 'icon-draw', 'icon-positions', 'icon-reset', 'icon-xj', 'icon-yj', 'icon-zj', 'icon-close', 'icon-query', 'icon-route', 'icon-copy', 'icon-load', 'icon-rubric', 'icon-pen', 'icon-cross', 'icom-confirm'] function setSvg() { let svgElm = document.createElement('svg'); svgElm.xmlns = 'http://www.w3.org/2000/svg' diff --git a/src/Obj/Element/yj-color-picker.js b/src/Obj/Element/yj-color-picker.js index 3495428..fb45f6d 100644 --- a/src/Obj/Element/yj-color-picker.js +++ b/src/Obj/Element/yj-color-picker.js @@ -1,7 +1,11 @@ class YJColorPicker { constructor(options = {}) { let _this = this - let pickAlphaInput + let RInput + let GInput + let BInput + let AInput + let config = { el: options.el, size: "mini", @@ -12,6 +16,7 @@ class YJColorPicker { hasClear: true, openPickerAni: 'opacity', defaultColor: options.defaultColor, + pickerInputChange: pickerInputChange, startMainCallback: (t) => { _this.colorPicker && (_this.colorPicker.picker.style.opacity = 0) setTimeout(() => { @@ -24,9 +29,9 @@ class YJColorPicker { config.sure = (color) => { // this.colorPicker.config.defaultColor = this.colorPicker.pickerInput.value let c = Cesium.Color.fromCssColorString(color) - if (pickAlphaInput) { - c = c.withAlpha(pickAlphaInput.value / 100) - this.pickAlphaInputValue = pickAlphaInput.value + if (AInput) { + c = c.withAlpha(AInput.value) + this.pickAlphaInputValue = AInput.value } color = c.toCssHexString() if (typeof options.sure == 'function') { @@ -37,8 +42,8 @@ class YJColorPicker { } if (options.clear) { config.clear = () => { - if (pickAlphaInput) { - pickAlphaInput.value = this.pickAlphaInputValue = 100 + if (AInput) { + AInput.value = this.pickAlphaInputValue = 1 } this.colorPicker.config.defaultColor = '' customizeStyle() @@ -64,7 +69,7 @@ class YJColorPicker { // } config.predefineColor = ['rgba(255, 255, 255, 1)', 'rgba(255, 0, 0, 1)', 'rgba(208, 132, 209, 1)', 'rgba(100, 182, 217, 1)', 'rgba(42, 130, 228, 1)', 'rgba(214, 36, 36, 1)', 'rgba(252, 222, 111, 1)', 'rgba(67, 207, 124, 1)', 'rgba(176, 243, 143, 1)', 'rgba(121, 72, 234, 1)', 'rgba(255, 195, 0, 1)', 'rgba(0, 186, 173, 1)', 'rgba(165, 214, 63, 1)', 'rgba(0, 0, 0, 1)', 'rgba(46, 47, 51, 1)', 'rgba(172, 51, 193, 1)', 'rgba(130, 21, 21, 1)', 'rgba(255, 87, 51, 1)', 'rgba(255, 140, 0, 1)', 'rgba(125, 191, 255, 1)'] this.colorPicker = new ewPlugins('colorpicker', config) - window.colorPicker = this.colorPicker + // window.colorPicker = this.colorPicker customizeStyle() @@ -78,7 +83,7 @@ class YJColorPicker { let x = box.getBoundingClientRect().x let y = box.getBoundingClientRect().y let height = 0 - + // if (picker.style.display === 'none') { // picker.style.display = 'block' // height = picker.offsetHeight @@ -103,16 +108,13 @@ class YJColorPicker { pickAlphaSliderBar.parentNode.style.width = '16px' pickAlphaSliderBar.parentNode.removeChild(pickAlphaSliderBar) } - // let customDivider = document.createElement('span') - // customDivider.className = 'custom-divider' - // customDivider.style.margin = '10px 0' - // pickerContent.parentNode.insertBefore(customDivider, pickerContent.nextSibling) + let pickPen = document.createElement('div') pickPen.className = 'icon-pen-box' pickPen.innerHTML = '' /** 为完成、暂时隐藏 */////// - pickPen.style.opacity = '0' + pickPen.style.display = 'none' pickPen.style.cursor = 'unset' @@ -120,19 +122,67 @@ class YJColorPicker { let pickerInput = _this.colorPicker.pickerInput pickerInput.parentNode.insertBefore(pickPen, pickerInput) pickerInput.style.width = '188px' + pickerInput.style.display = 'none' + + let colorInputBox = document.createElement('div') + let row1Elm = document.createElement('div') + row1Elm.className = 'row' + row1Elm.style.margin = '6px 0 0 0' + row1Elm.innerHTML = ` +
R
+
G
+
B
+
+ ` + let row2Elm = document.createElement('div') + row2Elm.className = 'row' + row2Elm.innerHTML = ` +
+ +
+
+ +
+
+ +
+ ` + colorInputBox.appendChild(row1Elm) + colorInputBox.appendChild(row2Elm) + let Inputs = row2Elm.getElementsByTagName('input') + Inputs[0].style.width = '72px' + Inputs[1].style.width = '72px' + Inputs[2].style.width = '72px' + RInput = Inputs[0] + GInput = Inputs[1] + BInput = Inputs[2] + + let dropbtns = picker.getElementsByClassName('ew-color-dropbtns')[0] + picker.insertBefore(colorInputBox, dropbtns) if (options.alpha) { + Inputs[0].style.width = '52px' + Inputs[1].style.width = '52px' + Inputs[2].style.width = '52px' let pickAlpha = document.createElement('div') - pickAlpha.className = 'input-number input-number-unit-1 color-alpha' + pickAlpha.className = 'input-number input-number-unit color-alpha' pickAlpha.innerHTML = ` - - % + ` pickerInput.parentNode.insertBefore(pickAlpha, pickerInput.nextSibling) pickerInput.style.width = '106px' - pickAlpha.style.width = '80px' - pickAlphaInput = pickAlpha.getElementsByClassName('input')[0] - pickAlphaInput.addEventListener('blur', (e) => { + pickAlpha.style.width = '66px' + pickAlpha.style.margin = '0 6px 0 0' + AInput = pickAlpha.getElementsByClassName('input')[0] + row1Elm.innerHTML = ` +
R
+
G
+
B
+
A
+
+ ` + row2Elm.appendChild(pickAlpha) + AInput.addEventListener('blur', (e) => { let value = e.target.value if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) { value = Number(value) @@ -145,23 +195,26 @@ class YJColorPicker { if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { value = Number(e.target.dataset.min) } - pickAlphaInput.value = Number(value.toFixed(0)) + AInput.value = parseInt(value * 100) / 100 } }) if (_this.pickAlphaInputValue || _this.pickAlphaInputValue === 0 || _this.pickAlphaInputValue === '0') { - pickAlphaInput.value = Number(Number(_this.pickAlphaInputValue).toFixed(0)) + AInput.value = parseInt(_this.pickAlphaInputValue * 100) / 100 } else { - pickAlphaInput.value = CesiumColor ? Number((CesiumColor.alpha * 100).toFixed(0)) : 100 + AInput.value = CesiumColor ? parseInt(CesiumColor.alpha * 100) / 100 : 1 } - _this.pickAlphaInputValue = pickAlphaInput.value - box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').withAlpha(pickAlphaInput.value / 100).toCssColorString() + _this.pickAlphaInputValue = AInput.value + box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').withAlpha(AInput.value).toCssColorString() } else { CesiumColor = CesiumColor ? CesiumColor.withAlpha(1) : '' box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').toCssColorString() } + let btngroup = picker.getElementsByClassName('ew-color-dropbtngroup')[0] + row2Elm.appendChild(btngroup) + let defineColorContainer = picker.getElementsByClassName('ew-pre-define-color-container')[0] if (defineColorContainer) { let colorList = localStorage.getItem('custom-color') @@ -188,8 +241,10 @@ class YJColorPicker { addColorBtn.className = 'yj-pre-collect-color add' let subtractColorBtn = document.createElement('div') - subtractColorBtn.innerHTML = '' + subtractColorBtn.innerHTML = '' subtractColorBtn.className = 'yj-pre-collect-color subtract' + let minusIcon = subtractColorBtn.getElementsByClassName('icon-minus')[0] + let confirmIcon = subtractColorBtn.getElementsByClassName('icon-confirm')[0] collectColorContainer.appendChild(addColorBtn) collectColorContainer.appendChild(subtractColorBtn) @@ -248,8 +303,8 @@ class YJColorPicker { let color = colorRgbaToHex(colorHsbaToRgba(_this.colorPicker.hsba)) let c = Cesium.Color.fromCssColorString(color || '#ffffff') - if (pickAlphaInput) { - c = c.withAlpha(pickAlphaInput.value / 100) + if (AInput) { + c = c.withAlpha(AInput.value) } let colorString = c.toCssHexString() colorItemElm.style.backgroundColor = colorString @@ -283,11 +338,15 @@ class YJColorPicker { subtractColorBtn.addEventListener('click', () => { isSubtract = !isSubtract if (isSubtract) { + minusIcon.style.display = 'none' + confirmIcon.style.display = 'unset' for (let i = 0; i < subtractElmList.length; i++) { subtractElmList[i].style.display = 'block' } } else { + minusIcon.style.display = 'unset' + confirmIcon.style.display = 'none' for (let i = 0; i < subtractElmList.length; i++) { subtractElmList[i].style.display = 'none' } @@ -308,12 +367,14 @@ class YJColorPicker { picker.style.top = (y + box.offsetHeight + 4) + 'px' } _this.colorPicker.pancelTop = parseFloat(picker.style.top) - 2 + + pickerInputChange(Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').toCssHexString()) } function clickDefineColor(color) { - if (pickAlphaInput) { + if (AInput) { let c = Cesium.Color.fromCssColorString(color) - pickAlphaInput.value = Number((c.alpha * 100).toFixed(0)) + AInput.value = parseInt(c.alpha * 100) / 100 } } @@ -366,6 +427,46 @@ class YJColorPicker { "#" + n } } + + function colorHexToRgba(hex, alpha) { + let a = alpha || 1, + hColor = hex.toLowerCase(), + hLen = hex.length, + rgbaColor = []; + hColor = Cesium.Color.fromCssColorString(hColor).toCssHexString().substring(0, 7) + const colorRegExp = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + if (hex && colorRegExp.test(hColor)) { + //the hex length may be 4 or 7,contained the symbol of # + if (hLen === 4) { + let hSixColor = '#'; + + for (let i = 1; i < hLen; i++) { + let sColor = hColor.slice(i, i + 1); + hSixColor += sColor.concat(sColor); + } + + hColor = hSixColor; + } + + for (let j = 1, len = hColor.length; j < len; j += 2) { + rgbaColor.push(parseInt('0X' + hColor.slice(j, j + 2), 16)); + } + + // return "rgba(" + rgbaColor.join(",") + ',' + a + ")"; + return rgbaColor; + } else { + return; + } + } + + function pickerInputChange(v) { + if (_this.colorPicker && _this.colorPicker.pickerInput) { + let rgbaColor = colorHexToRgba(v || _this.colorPicker.pickerInput.value) + RInput.value = rgbaColor[0] + GInput.value = rgbaColor[1] + BInput.value = rgbaColor[2] + } + } } } diff --git a/static/3rdparty/ewPlugins.min.js b/static/3rdparty/ewPlugins.min.js index 8f9a006..ffd594b 100644 --- a/static/3rdparty/ewPlugins.min.js +++ b/static/3rdparty/ewPlugins.min.js @@ -746,6 +746,7 @@ o.colorHsbaToRgba)(e.hsba) : e.pickerInput.value = (0, o.colorRgbaToHex)((0, o.colorHsbaToRgba)(e.hsba)) + e.config.pickerInputChange && e.config.pickerInputChange() } function f(e) { if (this.pickerFlag = !1, @@ -795,6 +796,8 @@ n.isFunction)(e.sure) ? e.sure : null, clear: (0, n.isFunction)(e.clear) ? e.clear : null, + pickerInputChange: (0, + n.isFunction)(e.pickerInputChange) ? e.pickerInputChange : null, startMainCallback: (0, n.isFunction)(e.startMainCallback) ? e.startMainCallback : null, clickDefineColor: (0, @@ -891,6 +894,7 @@ var u = i - e.hsba.a * i; c(e.alphaBarThumb, "top", u + "px") } + e.config.pickerInputChange && e.config.pickerInputChange() } function b(e, t) { var r = e.hueBar.offsetHeight @@ -1086,6 +1090,7 @@ o.colorRgbaToHex)((0, o.colorHsbaToRgba)(e.hsba)); e.config.defaultColor = e.pickerInput.value + e.config.pickerInputChange && e.config.pickerInputChange() e.render(e.box.parentNode, e.config), e.config.sure(t, e) }(r) diff --git a/static/custom/css/index.css b/static/custom/css/index.css index 87032c8..ec8178e 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -1034,8 +1034,19 @@ padding: 5px; position: fixed !important; } +.YJ-custom-base-dialog>.content .ew-color-picker input { + font-size: 14px; + line-height: 28px; + height: 28px; + padding: 0 8px; + font-weight: 400; +} +.YJ-custom-base-dialog>.content .ew-color-picker .input-number-unit input[type=number] { + padding: 0 20px 0 8px; + width: 66px; +} -.YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content { +.YJ-custom-base-dialog.ew-color-picker>.ew-color-picker-content { margin-bottom: 10px; } .YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content>.ew-color-panel { @@ -1064,6 +1075,10 @@ line-height: 24px; } +.YJ-custom-base-dialog>.content>div .ew-color-picker .row>.col { + margin: 0 !important; +} + .YJ-custom-base-dialog .ew-color-picker .icon-pen-box .icon-pen { margin: 0; } @@ -1079,9 +1094,9 @@ } .YJ-custom-base-dialog .ew-color-picker .color-alpha>input { - font-weight: 400; - font-family: Arial; - font-size: 14px; + font-weight: 400 !important; + font-family: Arial !important; + font-size: 14px !important; } .YJ-custom-base-dialog .ew-color-picker>.ew-pre-define-color-container { @@ -1169,10 +1184,13 @@ .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup { display: flex; + position: unset; } .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button { - padding: 5px 10px 4px 10px; + padding: 0 8px; + height: 28px; + line-height: 28px; } .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button.ew-color-clear { margin-right: 8px; diff --git a/static/custom/img/icom-confirm.svg b/static/custom/img/icom-confirm.svg new file mode 100644 index 0000000..6ba0d24 --- /dev/null +++ b/static/custom/img/icom-confirm.svg @@ -0,0 +1,4 @@ + + + + From 53ba8cb0148aaf897c9378a2875d18e1f6d644f9 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 25 Jul 2025 12:01:45 +0800 Subject: [PATCH 06/53] =?UTF-8?q?=E8=B7=9D=E7=A6=BB=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/PolylineObject/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Obj/Base/PolylineObject/index.js b/src/Obj/Base/PolylineObject/index.js index bdc778e..ff70456 100644 --- a/src/Obj/Base/PolylineObject/index.js +++ b/src/Obj/Base/PolylineObject/index.js @@ -18,6 +18,7 @@ import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/S import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' class PolylineObject extends Base { + #unitDataLegpObject /** * @constructor * @param sdk @@ -253,6 +254,7 @@ class PolylineObject extends Base { this._elms.lengthUnit.forEach(item => { item.value = v }) + this.#unitDataLegpObject && this.#unitDataLegpObject.legp_searchActive(v) if (this.options.lengthByMeter) { if (this.unitNum > 2) { switch (v) { @@ -1743,6 +1745,7 @@ class PolylineObject extends Base { '.input-select-unit', 1 ) + this.#unitDataLegpObject = unitDataLegpObject if (unitDataLegpObject) { unitDataLegpObject.legp_search(unitData) let unitDataLegpElm = this._DialogObject._element.content From 3bbc71065ad574b96070a0b8b0066bd706eb6b82 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Mon, 28 Jul 2025 10:33:13 +0800 Subject: [PATCH 07/53] =?UTF-8?q?=E9=9D=A2=E6=8F=8F=E8=BE=B9=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=BB=98=E8=AE=A4=E5=80=BC=E6=94=B9=E4=B8=BArgba(255,?= =?UTF-8?q?=200,=200,=201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/AssembleObject/index.js | 2 +- src/Obj/Base/AttackArrowObject/index.js | 2 +- src/Obj/Base/CircleObject/index.js | 2 +- src/Obj/Base/EllipseObject/index.js | 4 ++-- src/Obj/Base/PincerArrowObject/index.js | 2 +- src/Obj/Base/PolygonObject/index.js | 2 +- src/Obj/Base/SectorObject/index.js | 2 +- src/Obj/Base/StraightArrowObject/index.js | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Obj/Base/AssembleObject/index.js b/src/Obj/Base/AssembleObject/index.js index e04f065..3ee6ba0 100644 --- a/src/Obj/Base/AssembleObject/index.js +++ b/src/Obj/Base/AssembleObject/index.js @@ -40,7 +40,7 @@ class AssembleObject extends Base { this.options.positions = options.positions || [] this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) - this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' this.entity this.event = new MouseEvent(this.sdk) diff --git a/src/Obj/Base/AttackArrowObject/index.js b/src/Obj/Base/AttackArrowObject/index.js index c3aaaac..ec83033 100644 --- a/src/Obj/Base/AttackArrowObject/index.js +++ b/src/Obj/Base/AttackArrowObject/index.js @@ -40,7 +40,7 @@ class AttackArrowObject extends Base { this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) - this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' this.entity this.event = new MouseEvent(this.sdk) diff --git a/src/Obj/Base/CircleObject/index.js b/src/Obj/Base/CircleObject/index.js index a6e88d1..4126eff 100644 --- a/src/Obj/Base/CircleObject/index.js +++ b/src/Obj/Base/CircleObject/index.js @@ -45,7 +45,7 @@ class CircleObject extends Base { this.options.center = options.center || {} this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) - this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' options.label = options.label || {} this._elms = {}; diff --git a/src/Obj/Base/EllipseObject/index.js b/src/Obj/Base/EllipseObject/index.js index 1ad1c75..f9dedbd 100644 --- a/src/Obj/Base/EllipseObject/index.js +++ b/src/Obj/Base/EllipseObject/index.js @@ -32,7 +32,7 @@ class EllipseObject extends Base { * @param options.bearing=0 {number} 旋转角度 * @param options.line {object} 边框 * @param options.line.width=2 {string} 边框宽 - * @param options.line.color="#ff000080" {string} 边框颜色 + * @param options.line.color="rgba(255, 0, 0, 1)" {string} 边框颜色 * @param options.label {object} 标注 * @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式) */ @@ -47,7 +47,7 @@ class EllipseObject extends Base { this.options.center = options.center || {} this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) - this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' options.label = options.label || {} this._elms = {}; diff --git a/src/Obj/Base/PincerArrowObject/index.js b/src/Obj/Base/PincerArrowObject/index.js index b293441..5788789 100644 --- a/src/Obj/Base/PincerArrowObject/index.js +++ b/src/Obj/Base/PincerArrowObject/index.js @@ -40,7 +40,7 @@ class PincerArrowObject extends Base { this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) - this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' this.options.height = options.height this.options.loop = options.loop || false diff --git a/src/Obj/Base/PolygonObject/index.js b/src/Obj/Base/PolygonObject/index.js index 738cf61..dbaafdf 100644 --- a/src/Obj/Base/PolygonObject/index.js +++ b/src/Obj/Base/PolygonObject/index.js @@ -47,7 +47,7 @@ class PolygonObject extends Base { this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) this.options.line.color = - this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' this.entity this.event = new MouseEvent(this.sdk) diff --git a/src/Obj/Base/SectorObject/index.js b/src/Obj/Base/SectorObject/index.js index 8f7a317..9ddbeb4 100644 --- a/src/Obj/Base/SectorObject/index.js +++ b/src/Obj/Base/SectorObject/index.js @@ -47,7 +47,7 @@ class SectorObject extends Base { this.options.center = options.center || {} this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) - this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' options.label = options.label || {} this._elms = {}; diff --git a/src/Obj/Base/StraightArrowObject/index.js b/src/Obj/Base/StraightArrowObject/index.js index f1c26aa..f4037ef 100644 --- a/src/Obj/Base/StraightArrowObject/index.js +++ b/src/Obj/Base/StraightArrowObject/index.js @@ -40,7 +40,7 @@ class StraightArrowObject extends Base { this.options.positions = options.positions || [] this.options.line = options.line || {} this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) - this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' + this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' this.options['area-unit'] = options['area-unit'] || '平方米' this.entity this.event = new MouseEvent(this.sdk) From 8afd3138f4242424116fa79cf6e4b85a634c83ba Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Mon, 28 Jul 2025 10:36:24 +0800 Subject: [PATCH 08/53] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E6=AE=B5?= =?UTF-8?q?=E7=BC=93=E5=86=B2=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/CurvelineObject/index.js | 6 +++--- src/Obj/Base/PolylineObject/index.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Obj/Base/CurvelineObject/index.js b/src/Obj/Base/CurvelineObject/index.js index 8b946e1..0c8bf41 100644 --- a/src/Obj/Base/CurvelineObject/index.js +++ b/src/Obj/Base/CurvelineObject/index.js @@ -30,7 +30,7 @@ class CurvelineObject extends Base { * @param options.heightMode{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式) * @param options['nose-to-tail']=false {boolean} 首尾相连 * @param options.extend=false {boolean} 线缓冲 - * @param options['extend-width']=1 {number} 线缓冲宽度 + * @param options['extend-width']=10 {number} 线缓冲宽度 * @param options['extend-color']=#ffde00 {number} 线缓冲颜色 * @param options.show=true {boolean} 显隐 * @param {Array.} options.positions 坐标数组 [{lng,lat},...] @@ -61,8 +61,8 @@ class CurvelineObject extends Base { this.options['extend-width'] = options['extend-width'] || options['extend-width'] === 0 ? options['extend-width'] - : 1 - this.options['extend-color'] = options['extend-color'] || '#ffde00' + : 10 + this.options['extend-color'] = options['extend-color'] || 'rgba(255,222,0,0.3)' this.options.show = options.show || options.show === false ? options.show : true this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 diff --git a/src/Obj/Base/PolylineObject/index.js b/src/Obj/Base/PolylineObject/index.js index ff70456..51d022f 100644 --- a/src/Obj/Base/PolylineObject/index.js +++ b/src/Obj/Base/PolylineObject/index.js @@ -32,8 +32,8 @@ class PolylineObject extends Base { * @param options['nose-to-tail']=false {boolean} 首尾相连 * @param options.smooth=false {boolean} 线段圆滑 * @param options.extend=false {boolean} 线缓冲 - * @param options['extend-width']=1 {number} 线缓冲宽度 - * @param options['extend-color']=#ffde00 {number} 线缓冲颜色 + * @param options['extend-width']=10 {number} 线缓冲宽度 + * @param options['extend-color']=rgba(255,222,0,0.5) {number} 线缓冲颜色 * @param options.show=true {boolean} 显隐 * @param {Array.} options.positions 坐标数组 [{lng,lat},...] * @param options.label {object} 标注 @@ -69,8 +69,8 @@ class PolylineObject extends Base { this.options['extend-width'] = options['extend-width'] || options['extend-width'] === 0 ? options['extend-width'] - : 1 - this.options['extend-color'] = options['extend-color'] || '#ffde00' + : 10 + this.options['extend-color'] = options['extend-color'] || 'rgba(255,222,0,0.3)' this.options.show = options.show || options.show === false ? options.show : true this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 From 7a00e781451c10d00b1bc5beca2d37a123d5a40d Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 6 Aug 2025 14:19:09 +0800 Subject: [PATCH 09/53] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Draw/drawPolygon.js | 5 +++-- src/Obj/Base/CircleDiffuse/index.js | 3 ++- src/Obj/Base/CurvelineObject/index.js | 2 +- src/Obj/Base/PolylineObject/index.js | 4 ++-- static/custom/css/index.css | 3 +++ 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Draw/drawPolygon.js b/src/Draw/drawPolygon.js index 84cbb9f..af9780a 100644 --- a/src/Draw/drawPolygon.js +++ b/src/Draw/drawPolygon.js @@ -13,6 +13,7 @@ class DrawPolygon extends Draw { * */ constructor(sdk, options = {}) { super(sdk, options) + this.color = options.color || 'rgba(255,0,0,0.5)' this.polygonHasCreated = false } @@ -34,8 +35,8 @@ class DrawPolygon extends Draw { positions: new Cesium.CallbackProperty((e) => { return that.positions.concat(that.positions[0]) }), - width: 2, - material: Cesium.Color.fromCssColorString('#c1c505').withAlpha(0.5), + width: 3, + material: Cesium.Color.fromCssColorString(that.color).withAlpha(1), clampToGround: true, zIndex: 99999999 }, diff --git a/src/Obj/Base/CircleDiffuse/index.js b/src/Obj/Base/CircleDiffuse/index.js index be4646d..92b2cfd 100644 --- a/src/Obj/Base/CircleDiffuse/index.js +++ b/src/Obj/Base/CircleDiffuse/index.js @@ -362,6 +362,7 @@ class CircleDiffuse extends Base { return this.options.circle } set circle(v) { + console.log(v) this.options.circle = v || [{ radius: 10 }] for (let i = 0; i < this.options.circle.length; i++) { if(this.options.circle[i].radius>999999) { @@ -1405,7 +1406,7 @@ class CircleDiffuse extends Base { } } this._radius = radius - inputElm.value = value + // inputElm.value = value CircleDiffuse.create(this) } } diff --git a/src/Obj/Base/CurvelineObject/index.js b/src/Obj/Base/CurvelineObject/index.js index 0c8bf41..df5c8e3 100644 --- a/src/Obj/Base/CurvelineObject/index.js +++ b/src/Obj/Base/CurvelineObject/index.js @@ -62,7 +62,7 @@ class CurvelineObject extends Base { options['extend-width'] || options['extend-width'] === 0 ? options['extend-width'] : 10 - this.options['extend-color'] = options['extend-color'] || 'rgba(255,222,0,0.3)' + this.options['extend-color'] = options['extend-color'] || 'rgba(255,255,80,0.3)' this.options.show = options.show || options.show === false ? options.show : true this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 diff --git a/src/Obj/Base/PolylineObject/index.js b/src/Obj/Base/PolylineObject/index.js index 51d022f..092b41b 100644 --- a/src/Obj/Base/PolylineObject/index.js +++ b/src/Obj/Base/PolylineObject/index.js @@ -33,7 +33,7 @@ class PolylineObject extends Base { * @param options.smooth=false {boolean} 线段圆滑 * @param options.extend=false {boolean} 线缓冲 * @param options['extend-width']=10 {number} 线缓冲宽度 - * @param options['extend-color']=rgba(255,222,0,0.5) {number} 线缓冲颜色 + * @param options['extend-color']=rgba(255,255,80,0.3) {number} 线缓冲颜色 * @param options.show=true {boolean} 显隐 * @param {Array.} options.positions 坐标数组 [{lng,lat},...] * @param options.label {object} 标注 @@ -70,7 +70,7 @@ class PolylineObject extends Base { options['extend-width'] || options['extend-width'] === 0 ? options['extend-width'] : 10 - this.options['extend-color'] = options['extend-color'] || 'rgba(255,222,0,0.3)' + this.options['extend-color'] = options['extend-color'] || 'rgba(255,255,80,0.3)' this.options.show = options.show || options.show === false ? options.show : true this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 diff --git a/static/custom/css/index.css b/static/custom/css/index.css index ec8178e..193d824 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -2123,6 +2123,9 @@ .YJ-custom-base-dialog.particle-effects>.content .row>.col { width: 200px; } +.YJ-custom-base-dialog.particle-effects>.content .ew-color-picker .row>.col { + width: auto; +} .YJ-custom-base-dialog.particle-effects>.content [type="range"] { margin-top: 10px; From 01e2422444c30dfd2055f85e1421ca4ad41649ca Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 8 Aug 2025 10:03:42 +0800 Subject: [PATCH 10/53] 25-8-8 --- src/Global/MapPrint/index.js | 4 ++-- src/Obj/Base/EllipseObject/index.js | 4 ++-- src/Obj/Base/SectorObject/index.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Global/MapPrint/index.js b/src/Global/MapPrint/index.js index dd16630..43ba23c 100644 --- a/src/Global/MapPrint/index.js +++ b/src/Global/MapPrint/index.js @@ -1420,11 +1420,11 @@ async function MapPrint(sdk, thumbnailImg, rectangle, originalImg) { const url = URL.createObjectURL(blob); let downloadElement = document.createElement('a'); downloadElement.href = url; - downloadElement.download = `高清出图-${getDateTimeString()}.jpg`; + downloadElement.download = `高清出图-${getDateTimeString()}.png`; document.body.appendChild(downloadElement); downloadElement.click(); document.body.removeChild(downloadElement); - }, 'image/jpeg', 0.95); + }, 'image/png', 0.95); exporting = false; exportBtn.innerHTML = '打印'; // canvas2.toBlob(function (blob) { diff --git a/src/Obj/Base/EllipseObject/index.js b/src/Obj/Base/EllipseObject/index.js index f9dedbd..7b4631c 100644 --- a/src/Obj/Base/EllipseObject/index.js +++ b/src/Obj/Base/EllipseObject/index.js @@ -24,7 +24,7 @@ class EllipseObject extends Base { * @param options.name {string} 名称 * @param options.show=true {boolean} 显示/隐藏 * @param options.center {object} 位置 - * @param options.color="#ff000080" {string} 颜色 + * @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色 * @param options.center.lng {object} 经度 * @param options.center.lat {object} 维度 * @param options.semiMinorAxis=10 {number} 短半轴长度 @@ -39,7 +39,7 @@ class EllipseObject extends Base { constructor(sdk, options = {}) { super(sdk, options); this.options.name = options.name || '未命名对象' - this.options.color = options.color || "#ff000080" + this.options.color = options.color || "rgba(255, 0, 0, 0.5)" this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10 this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20 diff --git a/src/Obj/Base/SectorObject/index.js b/src/Obj/Base/SectorObject/index.js index 9ddbeb4..6d306bc 100644 --- a/src/Obj/Base/SectorObject/index.js +++ b/src/Obj/Base/SectorObject/index.js @@ -23,7 +23,7 @@ class SectorObject extends Base { * @param options.id {string} 标注id * @param options.name {string} 名称 * @param options.show=true {boolean} 显示/隐藏 - * @param options.color="#ff000080" {string} 颜色 + * @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色 * @param options.center {object} 位置 * @param options.center.lng {object} 经度 * @param options.center.lat {object} 维度 @@ -39,7 +39,7 @@ class SectorObject extends Base { constructor(sdk, options = {}) { super(sdk, options); this.options.name = options.name || '未命名对象' - this.options.color = options.color || "#ff000080" + this.options.color = options.color || "rgba(255, 0, 0, 0.5)" this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10 this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20 From ef3a6827248f7bc8e23d18cb35e8a0f06b10c392 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 8 Aug 2025 11:28:51 +0800 Subject: [PATCH 11/53] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/PolylineObject/_element.js | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Obj/Base/PolylineObject/_element.js b/src/Obj/Base/PolylineObject/_element.js index 17c8b9e..7f59d0d 100644 --- a/src/Obj/Base/PolylineObject/_element.js +++ b/src/Obj/Base/PolylineObject/_element.js @@ -90,27 +90,6 @@ function html(that) {
-
-
- 动画顺向 - -
-
- 流动速率 -
- - -
-
-
- 间距 -
- - - -
-
-
线段缓冲 @@ -129,6 +108,27 @@ function html(that) {
+
+
+ 首尾反向 + +
+
+ 流动速率 +
+ + +
+
+
+ 线条间距 +
+ + + +
+
+
${labelStyleElm1()} From bdc7e58263cdd518ecbb3b906b4d1425123a1c3d Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Sat, 9 Aug 2025 09:33:14 +0800 Subject: [PATCH 12/53] 25-8-9 --- src/Obj/Base/BillboardObject/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Obj/Base/BillboardObject/index.js b/src/Obj/Base/BillboardObject/index.js index 968d751..dafb8c8 100644 --- a/src/Obj/Base/BillboardObject/index.js +++ b/src/Obj/Base/BillboardObject/index.js @@ -273,7 +273,7 @@ class BillboardObject extends Base { else { let image = new Image() image.src = - url || + url || that.getSourceRootPath() + '/img/A-ablu-blank.png' switch (that.options.heightMode) { case 2: @@ -766,6 +766,8 @@ class BillboardObject extends Base { _this._frameImages = [] superGif.load(function (status) { if (status == 404) { + let width = 31 + let height = 36 canvas = document.createElement('canvas') canvas.width = 0 canvas.height = 0 @@ -855,6 +857,8 @@ class BillboardObject extends Base { billboardH = height * (31 / width) } image.onerror = function (err) { + let width = 31 + let height = 36 canvas.width = 0 canvas.height = 0 billboardH = 0 @@ -2344,7 +2348,7 @@ class BillboardObject extends Base { } async updateHeight() { - if(!this.sdk || !this.sdk.viewer || !this.sdk.viewer.scene) { + if (!this.sdk || !this.sdk.viewer || !this.sdk.viewer.scene) { return } let height From e38dd4d029b0c14de223862affd2f7a81544abeb Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Sat, 9 Aug 2025 18:20:02 +0800 Subject: [PATCH 13/53] =?UTF-8?q?=E4=BA=8C=E4=B8=89=E7=BB=B4=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E7=8B=AC=E5=B1=95=E7=A4=BA=E5=9C=A8=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E6=88=96=E8=80=85=E4=B8=89=E7=BB=B4=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E8=B4=B4=E5=9C=B0=E5=9B=BE=E7=89=87=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=AE=BE=E7=BD=AE=E9=94=9A=E7=82=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BaseDialog/index.js | 7 +- src/Global/MultiViewportMode/index.js | 8 + src/Obj/Base/BillboardObject/index.js | 48 +++-- src/Obj/Base/CircleDiffuse/index.js | 26 ++- src/Obj/Base/CircleObject/index.js | 2 +- src/Obj/Base/GroundImage/_element.js | 5 +- src/Obj/Base/GroundImage/index.js | 174 ++++++++++++++++-- src/Obj/Base/GroundSvg/index.js | 21 ++- src/Obj/Base/ParticleEffects/Flame/index.js | 27 ++- .../Base/ParticleEffects/Fountain/index.js | 25 ++- src/Obj/Base/ParticleEffects/Smoke/index.js | 25 ++- src/Obj/Base/ParticleEffects/Spout/index.js | 27 ++- src/Obj/Base/RadarScan/index.js | 24 ++- src/Obj/Base/TrajectoryMotion/index.js | 99 +++++++--- src/Obj/Base/index.js | 83 +++++++-- src/Obj/Element/Dialog/index.js | 5 +- static/custom/css/index.css | 24 +++ 17 files changed, 510 insertions(+), 120 deletions(-) diff --git a/src/BaseDialog/index.js b/src/BaseDialog/index.js index de36a50..18b3f3c 100644 --- a/src/BaseDialog/index.js +++ b/src/BaseDialog/index.js @@ -1,5 +1,5 @@ class BaseDialog { - constructor(container, options = {}) { + constructor(container, options = {}, only = true) { this.container = container this.options = { ...options } this.options.ismove = true @@ -9,10 +9,13 @@ class BaseDialog { this.closeCallBack = options.closeCallBack this._element = {} this._element_style = undefined + this.only = only } async init() { - this.closeAll() + if (this.only) { + this.closeAll() + } DialogAll.push(this) this.isDestroy = false // body diff --git a/src/Global/MultiViewportMode/index.js b/src/Global/MultiViewportMode/index.js index 0d63e89..5d3c600 100644 --- a/src/Global/MultiViewportMode/index.js +++ b/src/Global/MultiViewportMode/index.js @@ -94,6 +94,10 @@ function off(sdk) { activeViewer = null syncObject = {} } + sdk.entityMap.forEach((item, key) => { + item.showView = undefined + }) + } async function syncData2(sdk, id, entityId) { @@ -119,7 +123,11 @@ 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 + } let newObject = await new that.constructor(sdk2D, options) newObject.onClick = that.onClick newObject.onRightClick = that.onRightClick diff --git a/src/Obj/Base/BillboardObject/index.js b/src/Obj/Base/BillboardObject/index.js index dafb8c8..3bd6bfc 100644 --- a/src/Obj/Base/BillboardObject/index.js +++ b/src/Obj/Base/BillboardObject/index.js @@ -433,11 +433,11 @@ class BillboardObject extends Base { value: '链接', key: 'link' }, - { - name: 'IP摄像头', - value: 'IP摄像头', - key: 'camera' - }, + // { + // name: 'IP摄像头', + // value: 'IP摄像头', + // key: 'camera' + // }, // { // name: 'ISC摄像头', // value: 'ISC摄像头', @@ -448,16 +448,16 @@ class BillboardObject extends Base { // value: '传感器', // key: 'sensor' // }, - { - name: '全景图', - value: '全景图', - key: 'vr' - }, - { - name: '物资', - value: '物资', - key: 'goods' - } + // { + // name: '全景图', + // value: '全景图', + // key: 'vr' + // }, + // { + // name: '物资', + // value: '物资', + // key: 'goods' + // } ] } @@ -465,14 +465,24 @@ class BillboardObject extends Base { return this.options.show } set show(v) { - this.options.show = v - this.originalOptions.show = v - this.entity && (this.entity.show = v) + if(!this.isShowView) { + this.options.show = v + this.originalOptions.show = v + } + if(!this.showView || this.showView == 3) { + this.entity && (this.entity.show = this.options.show) + } + else { + this.entity && (this.entity.show = false) + } syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + if (this._DialogObject && this._DialogObject.showBtn) { - this._DialogObject.showBtn.checked = v + this._DialogObject.showBtn.checked = this.options.show } + + this.isShowView = false // if (v) { // if (this.diffuseShow) { // this.diffuseShow = true diff --git a/src/Obj/Base/CircleDiffuse/index.js b/src/Obj/Base/CircleDiffuse/index.js index 92b2cfd..d7fe430 100644 --- a/src/Obj/Base/CircleDiffuse/index.js +++ b/src/Obj/Base/CircleDiffuse/index.js @@ -223,16 +223,30 @@ class CircleDiffuse extends Base { set show(v) { if (typeof v === "boolean") { - this.options.show = v - this.entity.show = v + if (!this.isShowView) { + this.options.show = v + } + if (!this.showView || this.showView == 3) { + this.entity.show = this.options.show + if (this.options.label.show) { + this.label.show = this.options.show + } + } + else { + this.entity.show = false + if (this.options.label.show) { + this.label.show = false + } + } + + this.isShowView = false + syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) if (this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } - if (this.options.label.show) { - this.label.show = v - } + } else { console.error("参数必须为boolean") } @@ -429,7 +443,7 @@ class CircleDiffuse extends Base { } set labelShow(v) { this.options.label.show = v - if (this.show) { + if (this.show && (!this.showView || this.showView == 3)) { this.label.show = v } else { diff --git a/src/Obj/Base/CircleObject/index.js b/src/Obj/Base/CircleObject/index.js index 4126eff..d85022b 100644 --- a/src/Obj/Base/CircleObject/index.js +++ b/src/Obj/Base/CircleObject/index.js @@ -333,7 +333,7 @@ class CircleObject extends Base { } set labelShow(v) { this.options.label.show = v - if (this.show) { + if (this.show && (!this.showView || this.showView == 3)) { this.label.show = v } else { diff --git a/src/Obj/Base/GroundImage/_element.js b/src/Obj/Base/GroundImage/_element.js index 4f477d7..7ca2e92 100644 --- a/src/Obj/Base/GroundImage/_element.js +++ b/src/Obj/Base/GroundImage/_element.js @@ -8,6 +8,7 @@ function html() {
+
@@ -27,9 +28,9 @@ function html() {
调整大小 - +
- +
diff --git a/src/Obj/Base/GroundImage/index.js b/src/Obj/Base/GroundImage/index.js index ea98a52..6cff1c7 100644 --- a/src/Obj/Base/GroundImage/index.js +++ b/src/Obj/Base/GroundImage/index.js @@ -7,7 +7,7 @@ import MouseEvent from '../../../Event/index' import { syncData } from '../../../Global/MultiViewportMode' import MouseTip from '../../../MouseTip' import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' -import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Global/global' +import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' class GroundImage extends Base { /** @@ -36,6 +36,7 @@ class GroundImage extends Base { this.options.angle = options.angle || 0 this.options.scale = (options.scale || options.scale === 0) ? options.scale : 1 this.options.positions = options.positions + this.options.offset = { x: 0.5, y: 0.5 } this.options.flipe = options.flipe || {} this.options.flipe.x = this.options.flipe.x || false @@ -56,6 +57,13 @@ class GroundImage extends Base { this.create() } + get offset() { + return this.options.offset + } + set offset(v) { + this.options.offset = v + } + get angle() { return this.options.angle } @@ -87,8 +95,9 @@ class GroundImage extends Base { if (!this.entity) { return } + const img = new Image(); - img.src = this.options.url; + img.src = this.replaceHost(this.options.url, this.options.host); img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); @@ -111,6 +120,10 @@ class GroundImage extends Base { image: canvas, transparent: true })) + // this.offset = { + // x: Math.abs(this.offset.x - 1), + // y: this.offset.y, + // } } } else { console.error("参数必须为boolean") @@ -125,8 +138,9 @@ class GroundImage extends Base { if (!this.entity) { return } + const img = new Image(); - img.src = this.options.url; + img.src = this.replaceHost(this.options.url, this.options.host); img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); @@ -149,6 +163,10 @@ class GroundImage extends Base { image: canvas, transparent: true }) + // this.offset = { + // x: this.offset.x, + // y: Math.abs(this.offset.y - 1), + // } } } else { console.error("参数必须为boolean") @@ -163,7 +181,7 @@ class GroundImage extends Base { // this.options.positions.lng + 0.05, this.options.positions.lat + 0.05, // this.options.positions.lng - 0.05, this.options.positions.lat + 0.05, // ] - let response = await fetch(this.options.url, { + let response = await fetch(this.replaceHost(this.options.url, this.options.host), { method: 'get', headers: { 'Content-Type': 'application/json', @@ -174,7 +192,7 @@ class GroundImage extends Base { // let arrayBuffer = await data.arrayBuffer() // const str = String.fromCharCode(...new Uint8Array(arrayBuffer)); const img = new Image(); - img.src = this.options.url; + img.src = this.replaceHost(this.options.url, this.options.host); img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); @@ -199,11 +217,27 @@ class GroundImage extends Base { rectangle: { coordinates: new Cesium.CallbackProperty(() => { let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.positions.lat)) * (0.0001 * this.options.scale) + let offset = { + x: this.flipeY ? Math.abs(this.options.offset.x - 1) : this.options.offset.x, + y: this.flipeX ? Math.abs(this.options.offset.y - 1) : this.options.offset.y, + } + offset = { + lng: offset.x * ((0.0001 * this.options.scale) * 2), + lat: Math.abs(offset.y-1) * (gap * 2) + } let fromDegreesArray = [ - this.options.positions.lng - (0.0001 * this.options.scale), this.options.positions.lat - gap, - // this.options.positions.lng + 0.05, this.options.positions.lat - 0.05, - this.options.positions.lng + (0.0001 * this.options.scale), this.options.positions.lat + gap, - // this.options.positions.lng - 0.05, this.options.positions.lat + 0.05, + this.options.positions.lng - offset.lng, this.options.positions.lat - offset.lat, + (this.options.positions.lng - offset.lng) + ((0.0001 * this.options.scale) * 2), (this.options.positions.lat - offset.lat) + (gap * 2), + + + + + + + // this.options.positions.lng - (0.0001 * this.options.scale), this.options.positions.lat - gap, + // // this.options.positions.lng + 0.05, this.options.positions.lat - 0.05, + // this.options.positions.lng + (0.0001 * this.options.scale), this.options.positions.lat + gap, + // // this.options.positions.lng - 0.05, this.options.positions.lat + 0.05, ] return Cesium.Rectangle.fromDegrees(...fromDegreesArray) @@ -224,8 +258,8 @@ class GroundImage extends Base { this.entity.rectangle.height = 0 } syncData(this.sdk, this.options.id) - if(this.options.show) { - + if (this.options.show) { + setSplitDirection(0, this.options.id) } } @@ -253,6 +287,10 @@ class GroundImage extends Base { this._DialogObject = null } if (state) { + let anchorSetDialogObject + let canvas + let point + let billboardAnchorPosition this._DialogObject = await new Dialog(this.sdk, this.originalOptions, { title: '军标属性', left: '180px', top: '100px', confirmCallBack: (options) => { @@ -280,6 +318,9 @@ class GroundImage extends Base { // show: true, // }); this.positionEditing = false + if (anchorSetDialogObject && anchorSetDialogObject.close) { + anchorSetDialogObject.close() + } this.Dialog.closeCallBack && this.Dialog.closeCallBack() }, showCallBack: (show) => { @@ -315,6 +356,7 @@ class GroundImage extends Base { ] }, true) this._DialogObject._element.body.className = this._DialogObject._element.body.className + ' ground-image' + let contentElm = document.createElement('div'); contentElm.innerHTML = html() this._DialogObject.contentAppChild(contentElm) @@ -322,6 +364,114 @@ class GroundImage extends Base { this._EventBinding.on(this, all_elm) this._elms = this._EventBinding.element + let anchorBtn = contentElm.getElementsByClassName('anchor')[0] + anchorBtn.addEventListener('click', async () => { + if (anchorSetDialogObject && anchorSetDialogObject.close) { + anchorSetDialogObject.close() + } + document.body.addEventListener('mouseup', mouseupEvent) + let DialogClientRect = _this._DialogObject._element.body.getBoundingClientRect() + let _DialogObject = await new Dialog(this.sdk, this.originalOptions, { + title: '锚点设置', left: (DialogClientRect.left + 80) + 'px', top: (DialogClientRect.top + 200) + 'px', + confirmCallBack: (options) => { + _this.offset = { x: billboardAnchorPosition.x, y: billboardAnchorPosition.y } + _DialogObject.close() + }, + closeCallBack: () => { + document.body.removeEventListener('mouseup', mouseupEvent) + }, + }, false) + anchorSetDialogObject = _DialogObject + _DialogObject._element.body.className = _DialogObject._element.body.className + ' anchor-point' + let contentElm = document.createElement('div'); + let image = new Image() + image.src = this.replaceHost(this.options.url, this.options.host) + image.onload = function () { + let ratio = image.width / image.height + canvas = document.createElement('canvas') + let width = 150 + let height = 150 / ratio + const ctx = canvas.getContext('2d', { willReadFrequently: true }) + canvas.width = width + canvas.height = height; + canvas.style.display = 'block'; + ctx.drawImage(image, 0, 0, width, height) + contentElm.appendChild(canvas) + _DialogObject.contentAppChild(contentElm) + + point = document.createElement('span') + point.className = 'point' + contentElm.appendChild(point) + billboardAnchorPosition = { x: _this.offset.x, y: _this.offset.y } + point.style.top = `calc(${Number(billboardAnchorPosition.y) * 100}% - 6px)` + point.style.left = `calc(${Number(billboardAnchorPosition.x) * 100}% - 6px)` + + canvas.addEventListener('click', (e) => { + let x = e.offsetX + let y = e.offsetY + let anchor = { x: Number((x / canvas.width).toFixed(2)), y: Number((y / canvas.height).toFixed(2)) } + if (anchor.x < 0) { + anchor.x = 0 + } + if (anchor.x > 1) { + anchor.x = 1 + } + if (anchor.y < 0) { + anchor.y = 0 + } + if (anchor.y > 1) { + anchor.y = 1 + } + billboardAnchorPosition = { x: anchor.x, y: anchor.y } + + point.style.top = `calc(${billboardAnchorPosition.y * 100}% - 5px)` + point.style.left = `calc(${billboardAnchorPosition.x * 100}% - 5px)` + }) + + point.addEventListener('mousedown', (e) => { + _DialogObject._element.body.addEventListener('mousemove', mousemoveEvent) + }) + } + }) + function mousemoveEvent(e) { + getDialogBodyElm(e.target) + function getDialogBodyElm(elm) { + if (!elm) { + return + } + else if (elm === anchorSetDialogObject._element.body) { + let x = e.x - elm.getBoundingClientRect().left + let y = e.y - elm.getBoundingClientRect().top + let anchor = { x: Number(((x - 42) / canvas.width).toFixed(2)), y: Number(((y - 71) / canvas.height).toFixed(2)) } + if (anchor.x < 0) { + anchor.x = 0 + } + if (anchor.x > 1) { + anchor.x = 1 + } + if (anchor.y < 0) { + anchor.y = 0 + } + if (anchor.y > 1) { + anchor.y = 1 + } + billboardAnchorPosition = { x: anchor.x, y: anchor.y } + + point.style.top = `calc(${billboardAnchorPosition.y * 100}% - 5px)` + point.style.left = `calc(${billboardAnchorPosition.x * 100}% - 5px)` + } + else { + getDialogBodyElm(elm.offsetParent) + } + } + } + function mouseupEvent() { + if (anchorSetDialogObject) { + anchorSetDialogObject._element.body.removeEventListener('mousemove', mousemoveEvent) + } + } + + } else { if (this._DialogObject && this._DialogObject.remove) { this._DialogObject.remove() @@ -428,7 +578,7 @@ class GroundImage extends Base { async flyTo(options = {}) { setActiveViewer(0) closeRotateAround(this.sdk) - closeViewFollow(this.sdk) + closeViewFollow(this.sdk) if (this.options.customView && this.options.customView.relativePosition && this.options.customView.orientation) { let orientation = { diff --git a/src/Obj/Base/GroundSvg/index.js b/src/Obj/Base/GroundSvg/index.js index d738ae7..d94cce8 100644 --- a/src/Obj/Base/GroundSvg/index.js +++ b/src/Obj/Base/GroundSvg/index.js @@ -159,10 +159,18 @@ class GroundSvg extends Base { set show(v) { if (typeof v === "boolean") { - super.show = v - if (this.options.text && this.options.text.show && this.text) { - this.text.show = v + if (this.options.text && this.options.text.show) { + if(this.text) { + if((!this.showView || this.showView == 3)) { + this.text.show = v + } + else { + this.text.show = false + } + } + } + super.show = v } else { console.error("参数必须为boolean") } @@ -308,7 +316,12 @@ class GroundSvg extends Base { set textShow(v) { this.options.text.show = v if (this.show) { - this.text && (this.text.show = v) + if((!this.showView || this.showView == 3)) { + this.text && (this.text.show = v) + } + else { + this.text && (this.text.show = false) + } if (this.options.text.position) { setTimeout(() => { if (this.options.text.position.alt) { diff --git a/src/Obj/Base/ParticleEffects/Flame/index.js b/src/Obj/Base/ParticleEffects/Flame/index.js index 15a541b..77b66b8 100644 --- a/src/Obj/Base/ParticleEffects/Flame/index.js +++ b/src/Obj/Base/ParticleEffects/Flame/index.js @@ -82,18 +82,33 @@ class Flame extends Base { set show(v) { if (typeof v === "boolean") { - this.options.show = v - if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { - this.entity.show = v + if (!this.isShowView) { + this.options.show = v } + if (!this.showView || this.showView == 3) { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = this.options.show + } + if (this.options.label && this.options.label.show) { + this.label.show = this.options.show + } + } + else { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = false + } + if (this.options.label && this.options.label.show) { + this.label.show = false + } + } + if (this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } - if (this.options.label && this.options.label.show) { - this.label.show = v - } + syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + this.isShowView = false } else { console.error("参数必须为boolean") } diff --git a/src/Obj/Base/ParticleEffects/Fountain/index.js b/src/Obj/Base/ParticleEffects/Fountain/index.js index d14be27..7b2a2a0 100644 --- a/src/Obj/Base/ParticleEffects/Fountain/index.js +++ b/src/Obj/Base/ParticleEffects/Fountain/index.js @@ -83,18 +83,31 @@ class Fountain extends Base { set show(v) { if (typeof v === "boolean") { - this.options.show = v - if(this.entity && this.sdk.viewer.camera.positionCartographic.height <10000000) { - this.entity.show = v + if (!this.isShowView) { + this.options.show = v + } + if (!this.showView || this.showView == 3) { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = this.options.show + } + if (this.options.label && this.options.label.show) { + this.label.show = this.options.show + } + } + else { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = false + } + if (this.options.label && this.options.label.show) { + this.label.show = false + } } if(this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } - if (this.options.label && this.options.label.show) { - this.label.show = v - } syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + this.isShowView = false } else { console.error("参数必须为boolean") } diff --git a/src/Obj/Base/ParticleEffects/Smoke/index.js b/src/Obj/Base/ParticleEffects/Smoke/index.js index f70311d..f457661 100644 --- a/src/Obj/Base/ParticleEffects/Smoke/index.js +++ b/src/Obj/Base/ParticleEffects/Smoke/index.js @@ -81,18 +81,31 @@ class Smoke extends Base { set show(v) { if (typeof v === "boolean") { - this.options.show = v - if(this.entity && this.sdk.viewer.camera.positionCartographic.height <10000000) { - this.entity.show = v + if (!this.isShowView) { + this.options.show = v + } + if (!this.showView || this.showView == 3) { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = this.options.show + } + if (this.options.label && this.options.label.show) { + this.label.show = this.options.show + } + } + else { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = false + } + if (this.options.label && this.options.label.show) { + this.label.show = false + } } if(this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } - if (this.options.label && this.options.label.show) { - this.label.show = v - } syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + this.isShowView = false } else { console.error("参数必须为boolean") } diff --git a/src/Obj/Base/ParticleEffects/Spout/index.js b/src/Obj/Base/ParticleEffects/Spout/index.js index e36a639..9e78cd5 100644 --- a/src/Obj/Base/ParticleEffects/Spout/index.js +++ b/src/Obj/Base/ParticleEffects/Spout/index.js @@ -84,18 +84,31 @@ class Spout extends Base { set show(v) { if (typeof v === "boolean") { - this.options.show = v - if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { - this.entity.show = v + if (!this.isShowView) { + this.options.show = v } - if (this._DialogObject && this._DialogObject.showBtn) { + if (!this.showView || this.showView == 3) { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = this.options.show + } + if (this.options.label && this.options.label.show) { + this.label.show = this.options.show + } + } + else { + if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { + this.entity.show = false + } + if (this.options.label && this.options.label.show) { + this.label.show = false + } + } + if(this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } - if (this.options.label && this.options.label.show) { - this.label.show = v - } syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + this.isShowView = false } else { console.error("参数必须为boolean") } diff --git a/src/Obj/Base/RadarScan/index.js b/src/Obj/Base/RadarScan/index.js index bd7101c..dd3ec65 100644 --- a/src/Obj/Base/RadarScan/index.js +++ b/src/Obj/Base/RadarScan/index.js @@ -246,16 +246,28 @@ class RadarScan extends Base { set show(v) { if (typeof v === "boolean") { - this.options.show = v - this.entity.show = v + if (!this.isShowView) { + this.options.show = v + } + if (!this.showView || this.showView == 3) { + this.entity.show = this.options.show + if (this.options.label.show && this.label) { + this.label.show = this.options.show + } + } + else { + this.entity.show = false + if (this.options.label.show && this.label) { + this.label.show = false + } + } if (this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } - if (this.options.label.show && this.label) { - this.label.show = v - } + syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + this.isShowView = false } else { console.error("参数必须为boolean") } @@ -449,7 +461,7 @@ class RadarScan extends Base { } set labelShow(v) { this.options.label.show = v - if (this.show) { + if (this.show && (!this.showView || this.showView == 3)) { this.label.show = v } else { diff --git a/src/Obj/Base/TrajectoryMotion/index.js b/src/Obj/Base/TrajectoryMotion/index.js index 0783b99..56a8c6e 100644 --- a/src/Obj/Base/TrajectoryMotion/index.js +++ b/src/Obj/Base/TrajectoryMotion/index.js @@ -144,37 +144,54 @@ class TrajectoryMotion extends Base { set show(v) { if (typeof v === "boolean") { - this.options.show = v - if (this.originalOptions) { - this.originalOptions.show = v + if (!this.isShowView) { + this.options.show = v + if (this.originalOptions) { + this.originalOptions.show = v + } } - if (v) { + if (this.options.show) { if (this.firstPersonView) { this.model.show = false } else { - this.model.show = this.modelShow + this.model.show = (!this.showView || this.showView == 3) ? this.modelShow : false } - this.line.polyline.material = this.lineShow ? new Cesium.PolylineDashMaterialProperty({ - color: new Cesium.Color.fromCssColorString('#00ffff'), - dashLength: 20, - }) : new Cesium.PolylineDashMaterialProperty({ - color: new Cesium.Color.fromCssColorString('#00ffff00'), - dashLength: 20, - }) + if ((!this.showView || this.showView == 3)) { + this.line.polyline.material = this.lineShow ? new Cesium.PolylineDashMaterialProperty({ + color: new Cesium.Color.fromCssColorString('#00ffff'), + dashLength: 20, + }) : new Cesium.PolylineDashMaterialProperty({ + color: new Cesium.Color.fromCssColorString('#00ffff00'), + dashLength: 20, + }) + } + else { + this.line.polyline.material = new Cesium.PolylineDashMaterialProperty({ + color: new Cesium.Color.fromCssColorString('#00ffff00'), + dashLength: 20, + }) + } for (let i = 0; i < this.keyPoints.length; i++) { - this.keyPoints[i].show = this.keyPointShow + this.keyPoints[i].show = (!this.showView || this.showView == 3) ? this.keyPointShow : false } if (this.realTimeRoute) { - this.realTimeLine && (this.realTimeLine.show = true) + this.realTimeLine && (this.realTimeLine.show = (!this.showView || this.showView == 3) ? true : false) } - this.label && (this.label.show = this.options.label.show) + this.label && (this.label.show = (!this.showView || this.showView == 3) ? this.options.label.show : false) } else { - this.model.show = v + this.model.show = (!this.showView || this.showView == 3) ? this.options.show : false + let show = this.options.show + if ((!this.showView || this.showView == 3)) { + show = this.options.show + } + else { + show = false + } this.realTimeLine && (this.realTimeLine.show = false) - this.line.polyline.material = v ? new Cesium.PolylineDashMaterialProperty({ + this.line.polyline.material = show ? new Cesium.PolylineDashMaterialProperty({ color: new Cesium.Color.fromCssColorString('#00ffff'), dashLength: 20, }) : new Cesium.PolylineDashMaterialProperty({ @@ -182,7 +199,7 @@ class TrajectoryMotion extends Base { dashLength: 20, }) for (let i = 0; i < this.keyPoints.length; i++) { - this.keyPoints[i].show = v + this.keyPoints[i].show = (!this.showView || this.showView == 3) ? show : false } this.label && (this.label.show = false) this.viewFollow = false @@ -193,6 +210,7 @@ class TrajectoryMotion extends Base { } syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + this.isShowView = false } else { console.error("参数必须为boolean") } @@ -656,8 +674,15 @@ class TrajectoryMotion extends Base { } set modelShow(v) { this.options.model.show = v + let show = v + if (this.show && (!this.showView || this.showView == 3)) { + show = v + } + else { + show = false + } if (this.model && this.show) { - this.model.show = v + this.model.show = show } this._elms.modelShow && this._elms.modelShow.forEach((item) => { item.checked = v @@ -723,8 +748,15 @@ class TrajectoryMotion extends Base { this.realTimeRoute = false } this.options.line.show = v + let show = v + if ((!this.showView || this.showView == 3)) { + show = v + } + else { + show = false + } if (this.line && this.show) { - this.line.polyline.material = v ? new Cesium.PolylineDashMaterialProperty({ + this.line.polyline.material = show ? new Cesium.PolylineDashMaterialProperty({ color: new Cesium.Color.fromCssColorString('#00ffff'), dashLength: 20, //短划线长度 }) : new Cesium.PolylineDashMaterialProperty({ @@ -994,7 +1026,14 @@ class TrajectoryMotion extends Base { else { CameraController(this.sdk, true) if (this.model && this.modelShow && this.show) { - this.model.show = true + let show = true + if (this.show && (!this.showView || this.showView == 3)) { + show = true + } + else { + show = false + } + this.model.show = show } if (this._DialogObject && this._DialogObject._element.content) { let e_firstPerson = this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']") @@ -1116,8 +1155,15 @@ class TrajectoryMotion extends Base { } set labelShow(v) { this.options.label.show = v + let show = v + if (this.show && (!this.showView || this.showView == 3)) { + show = v + } + else { + show = false + } if (this.show) { - this.label && (this.label.show = v) + this.label && (this.label.show = show) if (this.options.label.position) { setTimeout(() => { if (this.options.label.position.alt) { @@ -1888,10 +1934,10 @@ class TrajectoryMotion extends Base { this.tip && this.tip.destroy() this.tip = null this.ControllerObject.destroy() - if(this.firstPersonView !== this.originalOptions.firstPersonView) { + if (this.firstPersonView !== this.originalOptions.firstPersonView) { this.firstPersonView = this.originalOptions.firstPersonView; } - if(this.firstPersonView && this.modelShow) { + if (this.firstPersonView && this.modelShow) { this.model && (this.model.show = false) } }, @@ -2164,10 +2210,10 @@ class TrajectoryMotion extends Base { this.modelAnimate = this.originalOptions.model.animate; this.delay = this.originalOptions.delay; (this.ground !== this.originalOptions.ground) && (this.ground = this.originalOptions.ground); - if(this.firstPersonView !== this.originalOptions.firstPersonView) { + if (this.firstPersonView !== this.originalOptions.firstPersonView) { this.firstPersonView = this.originalOptions.firstPersonView; } - if(this.firstPersonView && this.modelShow) { + if (this.firstPersonView && this.modelShow) { this.model && (this.model.show = false) } this.labelShow = this.originalOptions.label.show @@ -2229,7 +2275,6 @@ class TrajectoryMotion extends Base { this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].innerHTML = '结束调整' this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].className = 'btn model-rotate-btn is-active' } - console.log(this._DialogObject._element.content, this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0]) this.state = false this.editObj = new EditGltf(this.sdk, this.model) this.editObj.editRtation() diff --git a/src/Obj/Base/index.js b/src/Obj/Base/index.js index 319800a..28a6fcb 100644 --- a/src/Obj/Base/index.js +++ b/src/Obj/Base/index.js @@ -10,10 +10,12 @@ import { getHost, getToken } from "../../on"; import { regLeftClickCallback, regRightClickCallback, regMoveCallback } from "../../Global/ClickCallback"; import { regLeftClickCallback as regLeftClickCallback2, regRightClickCallback as regRightClickCallback2, regMoveCallback as regMoveCallback2 } from "../../Global/SplitScreen/ClickCallback"; import { setSplitDirection, syncSplitData, getSdk } from "../../Global/SplitScreen"; -import { syncData } from '../../Global/MultiViewportMode' +import { syncData, getSdk as get2DSdk } from '../../Global/MultiViewportMode' import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../Global/global' class Base extends Tools { + #_showView + #_isShowView constructor(sdk, options = {}) { super(sdk, options); if (!sdk || !sdk.viewer) { @@ -55,6 +57,50 @@ class Base extends Tools { // setSplitDirection(this._splitDirection, this.options.id) // } + get showView() { + return this.#_showView + } + + set showView(v) { + let sdk2D = get2DSdk().sdkD + if(!sdk2D) { + v=0 + } + if (!this.#_showView && !this.show) { + return + } + if (this.sdk === sdk2D) { + this.#_showView = 0 + return + } + if (v != 2 && v != 3) { + this.#_showView = 0 + } + else { + this.#_showView = v + } + + this.isShowView = true + + // if(!this.show) { + // return + // } + + if (!this.#_showView) { + this.show = true + } + else { + if (v == 2) { + this.show = false + } + else { + this.show = true + } + } + } + + + get name() { return this.options.name } @@ -72,19 +118,32 @@ class Base extends Tools { set show(v) { if (typeof v === "boolean") { - this.options.show = v - if (this.originalOptions) { - this.originalOptions.show = v + if (!this.isShowView) { + this.options.show = v + if (this.originalOptions) { + this.originalOptions.show = v + } } - this.entity && (this.entity.show = v) + if (!this.showView || this.showView == 3) { + this.entity && (this.entity.show = this.options.show) + if (this.options.label && this.options.label.show && this.label) { + this.label.show = this.options.show + } + } + else { + this.entity && (this.entity.show = false) + if (this.options.label && this.options.label.show && this.label) { + this.label.show = false + } + } + if (this._DialogObject && this._DialogObject.showBtn) { - this._DialogObject.showBtn.checked = v - } - if (this.options.label && this.options.label.show && this.label) { - this.label.show = v + this._DialogObject.showBtn.checked = this.options.show } + syncData(this.sdk, this.options.id) syncSplitData(this.sdk, this.options.id) + this.isShowView = false } else { console.error("参数必须为boolean") } @@ -263,7 +322,7 @@ class Base extends Tools { console.error('val:', val, '不是一个function') } else { let sdkD = getSdk().sdkD - if(sdkD && this.sdk === sdkD) { + if (sdkD && this.sdk === sdkD) { if (this.clickCallBack == null && this.options && this.options.id) { regLeftClickCallback2(this.options.id, this.leftClickCB, this) } @@ -286,7 +345,7 @@ class Base extends Tools { console.error('val:', val, '不是一个function') } else { let sdkD = getSdk().sdkD - if(sdkD && this.sdk === sdkD) { + if (sdkD && this.sdk === sdkD) { if (this.rightClickCallBack == null && this.entity && this.entity.id) { regRightClickCallback2(this.entity.id, this.rightClickCB, this) } @@ -309,7 +368,7 @@ class Base extends Tools { console.error('val:', val, '不是一个function') } else { let sdkD = getSdk().sdkD - if(sdkD && this.sdk === sdkD) { + if (sdkD && this.sdk === sdkD) { if (this.mouseMoveCallBack == null && this.entity && this.entity.id) { regMoveCallback2(this.entity.id, this.mouseMoveCB, this) } diff --git a/src/Obj/Element/Dialog/index.js b/src/Obj/Element/Dialog/index.js index ab815f6..aecd327 100644 --- a/src/Obj/Element/Dialog/index.js +++ b/src/Obj/Element/Dialog/index.js @@ -2,13 +2,10 @@ import BaseDialog from '../../../BaseDialog'; class Dialog extends BaseDialog { constructor(sdk, info, options, only) { - super(sdk.viewer._container, options); + super(sdk.viewer._container, options, only); this.sdk = sdk this.viewer = sdk.viewer this.info = info - if (only) { - this.closeAll() - } this._init() } diff --git a/static/custom/css/index.css b/static/custom/css/index.css index 193d824..32cb742 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -3490,3 +3490,27 @@ .YJ-custom-base-dialog.contour>.content .label { flex: unset; } + +/* 锚点设置 */ +.YJ-custom-base-dialog.anchor-point { + user-select: none; +} + +.YJ-custom-base-dialog.anchor-point>.content { + padding: 14px 40px; +} + +.YJ-custom-base-dialog.anchor-point>.content>div { + border: 1px solid #757575; + position: relative; +} + +.YJ-custom-base-dialog.anchor-point>.content>div>.point { + width: 10px; + height: 10px; + position: absolute; + background: #FFDF53; + border-radius: 50%; + border: 1px solid #ff7300; + cursor: pointer; +} From 00f1a40e2a53e9c8135c366e6e07b4ad11288a82 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Mon, 11 Aug 2025 09:23:54 +0800 Subject: [PATCH 14/53] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E6=97=B6=E5=85=B3=E9=97=AD=E4=BA=8C=E6=AC=A1=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/PolylineObject/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Obj/Base/PolylineObject/index.js b/src/Obj/Base/PolylineObject/index.js index ac0eea8..aa29049 100644 --- a/src/Obj/Base/PolylineObject/index.js +++ b/src/Obj/Base/PolylineObject/index.js @@ -1529,6 +1529,9 @@ class PolylineObject extends Base { } this.nodePoints = [] this.positionEditing = false + YJ.Measure.SetMeasureStatus(false) + this.event && this.event.destroy() + this.tip && this.tip.destroy() }, showCallBack: show => { this.options.show = show From a888969c5d72c37c658c1fa7911e3fa45e0b25b6 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Tue, 12 Aug 2025 11:50:19 +0800 Subject: [PATCH 15/53] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseSource/BaseModel/Model/_element.js | 2 +- src/Obj/Base/PolyhedronObject/eventBinding.js | 21 +++++++++- .../Base/WallRealStereoscopic/eventBinding.js | 28 +++++++++++-- src/Obj/Base/WallStereoscopic/eventBinding.js | 40 ++++++++++++++----- src/Obj/Base/WaterSurface/eventBinding.js | 3 +- src/Obj/Element/Dialog/eventBinding.js | 10 ++++- 6 files changed, 86 insertions(+), 18 deletions(-) diff --git a/src/Obj/Base/BaseSource/BaseModel/Model/_element.js b/src/Obj/Base/BaseSource/BaseModel/Model/_element.js index 9301b0f..1385d7a 100644 --- a/src/Obj/Base/BaseSource/BaseModel/Model/_element.js +++ b/src/Obj/Base/BaseSource/BaseModel/Model/_element.js @@ -56,7 +56,7 @@ function html(that) {
- 固定大小 + 固定大小
diff --git a/src/Obj/Base/PolyhedronObject/eventBinding.js b/src/Obj/Base/PolyhedronObject/eventBinding.js index e6b547d..6e7380d 100644 --- a/src/Obj/Base/PolyhedronObject/eventBinding.js +++ b/src/Obj/Base/PolyhedronObject/eventBinding.js @@ -21,6 +21,7 @@ class eventBinding { let Event = [] let isEvent = false let removeName = [] + let blurEvent = () => { } if (!elements[i] || !elements[i].attributes) { continue } @@ -36,7 +37,8 @@ class eventBinding { Event.push((e) => { let value = e.target.value if (e.target.type == 'number') { - if (e.data != '.' && (e.data != '-' || e.target.value)) { + let str = e.target.value + '' + if (e.data != '.' && (e.data != '-' || e.target.value) && !(str.charAt(str.length - 1) == '0' && e.target.value.toString().includes('.')) && e.target.value != '0') { value = Number(value) if((e.target.max) && value>Number(e.target.max)) { value = Number(e.target.max) @@ -57,6 +59,22 @@ class eventBinding { that[m.value] = value } }) + 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))) { + value = Number(value) + if ((e.target.max) && value > Number(e.target.max)) { + value = Number(e.target.max) + } + if ((e.target.min) && value < Number(e.target.min)) { + value = Number(e.target.min) + } + if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { + value = Number(e.target.dataset.min) + } + } + that[m.value] = value + } if(elements[i].nodeName=='IMG') { elements[i].src = that[m.value] } @@ -114,6 +132,7 @@ class eventBinding { Event[t](e) } }); + elements[i].addEventListener('blur', blurEvent) } } } diff --git a/src/Obj/Base/WallRealStereoscopic/eventBinding.js b/src/Obj/Base/WallRealStereoscopic/eventBinding.js index 4554edc..60f6829 100644 --- a/src/Obj/Base/WallRealStereoscopic/eventBinding.js +++ b/src/Obj/Base/WallRealStereoscopic/eventBinding.js @@ -21,6 +21,7 @@ class eventBinding { let Event = [] let isEvent = false let removeName = [] + let blurEvent = ()=>{} if (!elements[i] ||!elements[i].attributes) { continue; } @@ -37,14 +38,14 @@ class eventBinding { let value = e.target.value if (e.target.type == 'number') { if (e.data != '.' && (e.data != '-' || e.target.value)) { - value = Number(value) - if((e.target.max) && value>Number(e.target.max)) { + let v = Number(value) + if((e.target.max) && v>Number(e.target.max)) { value = Number(e.target.max) } - if((e.target.min) && value { + let value = e.target.value + if (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) + } + if ((e.target.min) && value < Number(e.target.min)) { + value = Number(e.target.min) + } + if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { + value = Number(e.target.dataset.min) + } + } + that[m.value] = value + } if(elements[i].nodeName=='IMG') { elements[i].src = that[m.value] } @@ -111,6 +128,9 @@ class eventBinding { Event[t](e) } }); + elements[i].addEventListener('blur', (e) => { + blurEvent(e) + }); } } } diff --git a/src/Obj/Base/WallStereoscopic/eventBinding.js b/src/Obj/Base/WallStereoscopic/eventBinding.js index 53d9ed3..52240e6 100644 --- a/src/Obj/Base/WallStereoscopic/eventBinding.js +++ b/src/Obj/Base/WallStereoscopic/eventBinding.js @@ -21,8 +21,9 @@ class eventBinding { let Event = [] let isEvent = false let removeName = [] - if (!elements[i] ||!elements[i].attributes) { - continue; + let blurEvent = () => { } + if (!elements[i] || !elements[i].attributes) { + continue; } for (let m of elements[i].attributes) { switch (m.name) { @@ -37,11 +38,11 @@ class eventBinding { let value = e.target.value if (e.target.type == 'number') { if (e.data != '.' && (e.data != '-' || e.target.value)) { - value = Number(value) - if((e.target.max) && value>Number(e.target.max)) { + let v = Number(value) + if ((e.target.max) && v > Number(e.target.max)) { value = Number(e.target.max) } - if((e.target.min) && value { + let value = e.target.value + if (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) + } + if ((e.target.min) && value < Number(e.target.min)) { + value = Number(e.target.min) + } + if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { + value = Number(e.target.dataset.min) + } + } + that[m.value] = value + } + + + if (elements[i].nodeName == 'IMG') { elements[i].src = that[m.value] } else { elements[i].value = that[m.value] } } - if(this.element[m.value]) { + if (this.element[m.value]) { this.element[m.value].push(elements[i]) } else { @@ -81,7 +100,7 @@ class eventBinding { isEvent = true Event.push((e) => { let value = e.target.value - if(e.target.type == 'number' && value!='') { + if (e.target.type == 'number' && value != '') { value = Number(value) e.target.value = value } @@ -94,7 +113,7 @@ class eventBinding { } // elements[i].attributes[m] = undefined } - for(let n=0;n { + blurEvent(e) + }); } } } diff --git a/src/Obj/Base/WaterSurface/eventBinding.js b/src/Obj/Base/WaterSurface/eventBinding.js index ccbf026..1fe3d17 100644 --- a/src/Obj/Base/WaterSurface/eventBinding.js +++ b/src/Obj/Base/WaterSurface/eventBinding.js @@ -35,7 +35,8 @@ class eventBinding { else { Event.push((e) => { let value = e.target.value - if (e.target.type == 'number') { + let str = e.target.value + '' + if (e.target.type == 'number' && !(str.charAt(str.length - 1) == '0' && e.target.value.toString().includes('.'))) { value = Number(value) } that[m.value] = value diff --git a/src/Obj/Element/Dialog/eventBinding.js b/src/Obj/Element/Dialog/eventBinding.js index 70cecf8..c47327f 100644 --- a/src/Obj/Element/Dialog/eventBinding.js +++ b/src/Obj/Element/Dialog/eventBinding.js @@ -45,8 +45,14 @@ class EventBinding { let value = e.target.value value = Number(value) if (e.data != '.' && (e.data != '-' || e.target.value)) { - if (((!e.target.max) && (!e.target.min)) || ((value <= Number(e.target.max)) && value >= Number(e.target.min))) { - that[m.value] = value + if ((e.target.max) && value > Number(e.target.max)) { + value = Number(e.target.max) + } + if ((e.target.min) && value < Number(e.target.min)) { + value = Number(e.target.min) + } + if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { + value = Number(e.target.dataset.min) } } } From 67540c18087a78da2a228a27e04cd0c7b06d54a6 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Tue, 12 Aug 2025 11:50:47 +0800 Subject: [PATCH 16/53] =?UTF-8?q?=E8=B4=B4=E5=9C=B0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=9A=E7=82=B9=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/SplitScreen/index.js | 2 +- src/Obj/Base/GroundImage/_element.js | 2 +- src/Obj/Base/GroundImage/index.js | 184 +++++++++++++++++---------- 3 files changed, 122 insertions(+), 66 deletions(-) diff --git a/src/Global/SplitScreen/index.js b/src/Global/SplitScreen/index.js index 8df76aa..845b6ee 100644 --- a/src/Global/SplitScreen/index.js +++ b/src/Global/SplitScreen/index.js @@ -517,7 +517,7 @@ async function setSplitDirection(v, id, isoff = false, entityId) { thatD.textShow = thatP.textShow } if (thatP.label && thatP.labelShow) { - thatP.label.entity.show = true + thatP.labelShow = true } if (thatD.label) { thatD.label.options.ground = false diff --git a/src/Obj/Base/GroundImage/_element.js b/src/Obj/Base/GroundImage/_element.js index 7ca2e92..95acf9f 100644 --- a/src/Obj/Base/GroundImage/_element.js +++ b/src/Obj/Base/GroundImage/_element.js @@ -8,7 +8,7 @@ function html() {
- +
diff --git a/src/Obj/Base/GroundImage/index.js b/src/Obj/Base/GroundImage/index.js index 6cff1c7..df7f882 100644 --- a/src/Obj/Base/GroundImage/index.js +++ b/src/Obj/Base/GroundImage/index.js @@ -24,7 +24,7 @@ class GroundImage extends Base { * @param options.flipe.x=false {boolean} 绕X轴翻转 * @param options.flipe.y=false {boolean} 绕Y轴翻转 * @param options.url {string} 图片地址 - * @param {Array.} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...] + * @param {Array.} options.position 经纬度和高度的列表,值交替 [{lon,lat,alt},...] * @param _Dialog {object} 弹框事件 * @param _Dialog.confirmCallBack {function} 弹框确认时的回调 * */ @@ -35,8 +35,8 @@ class GroundImage extends Base { this.options.url = options.url this.options.angle = options.angle || 0 this.options.scale = (options.scale || options.scale === 0) ? options.scale : 1 - this.options.positions = options.positions - this.options.offset = { x: 0.5, y: 0.5 } + this.options.position = options.position + this.options.offset = options.offset || { x: 0.5, y: 0.5 } this.options.flipe = options.flipe || {} this.options.flipe.x = this.options.flipe.x || false @@ -49,7 +49,7 @@ class GroundImage extends Base { this.Dialog = _Dialog this._elms = {}; this.previous = { - positions: { ...this.options.positions } + position: { ...this.options.position } } this._EventBinding = new EventBinding() this.event = new MouseEvent(this.sdk) @@ -62,6 +62,32 @@ class GroundImage extends Base { } set offset(v) { this.options.offset = v + const img = new Image(); + img.crossOrigin = 'Anonymous'; + img.src = this.replaceHost(this.options.url, this.options.host); + img.onload = () => { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + + // 设置画布大小 + canvas.width = img.width * 2; + canvas.height = img.height * 2; + + // 绘制图像 + if (this.flipeX) { + ctx.scale(1, -1); + ctx.translate(0, -canvas.height) + } + if (this.flipeY) { + ctx.scale(-1, 1); + ctx.translate(-canvas.width, 0); + } + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); + this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ + image: canvas, + transparent: true + }) + } } get angle() { @@ -97,14 +123,15 @@ class GroundImage extends Base { } const img = new Image(); + img.crossOrigin = 'Anonymous'; img.src = this.replaceHost(this.options.url, this.options.host); img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); // 设置画布大小 - canvas.width = img.width; - canvas.height = img.height; + canvas.width = img.width * 2; + canvas.height = img.height * 2; // 绘制图像 if (this.flipeX) { @@ -115,7 +142,7 @@ class GroundImage extends Base { ctx.scale(-1, 1); ctx.translate(-canvas.width, 0); } - ctx.drawImage(img, 0, 0); + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); this.entity && (this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ image: canvas, transparent: true @@ -140,14 +167,15 @@ class GroundImage extends Base { } const img = new Image(); + img.crossOrigin = 'Anonymous'; img.src = this.replaceHost(this.options.url, this.options.host); img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); // 设置画布大小 - canvas.width = img.width; - canvas.height = img.height; + canvas.width = img.width * 2; + canvas.height = img.height * 2; // 绘制图像 if (this.flipeX) { @@ -158,7 +186,7 @@ class GroundImage extends Base { ctx.scale(-1, 1); ctx.translate(-canvas.width, 0); } - ctx.drawImage(img, 0, 0); + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ image: canvas, transparent: true @@ -174,12 +202,12 @@ class GroundImage extends Base { } async create() { - // let gap = Math.abs(Math.cos(Math.PI/180 * this.options.positions.lat)) * (0.0001*this.options.scale) + // let gap = Math.abs(Math.cos(Math.PI/180 * this.options.position.lat)) * (0.0001*this.options.scale) // let fromDegreesArray = [ - // this.options.positions.lng - 0.05, this.options.positions.lat - 0.05, - // this.options.positions.lng + 0.05, this.options.positions.lat - 0.05, - // this.options.positions.lng + 0.05, this.options.positions.lat + 0.05, - // this.options.positions.lng - 0.05, this.options.positions.lat + 0.05, + // this.options.position.lng - 0.05, this.options.position.lat - 0.05, + // this.options.position.lng + 0.05, this.options.position.lat - 0.05, + // this.options.position.lng + 0.05, this.options.position.lat + 0.05, + // this.options.position.lng - 0.05, this.options.position.lat + 0.05, // ] let response = await fetch(this.replaceHost(this.options.url, this.options.host), { method: 'get', @@ -192,14 +220,15 @@ class GroundImage extends Base { // let arrayBuffer = await data.arrayBuffer() // const str = String.fromCharCode(...new Uint8Array(arrayBuffer)); const img = new Image(); + img.crossOrigin = 'Anonymous'; img.src = this.replaceHost(this.options.url, this.options.host); img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); // 设置画布大小 - canvas.width = img.width; - canvas.height = img.height; + canvas.width = img.width * 2; + canvas.height = img.height * 2; // 绘制图像 if (this.flipeX) { ctx.scale(1, -1); @@ -209,35 +238,45 @@ class GroundImage extends Base { ctx.scale(-1, 1); ctx.translate(-canvas.width, 0); } - ctx.drawImage(img, 0, 0); + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); this.entity = this.sdk.viewer.entities.add({ id: this.options.id, show: this.options.show, rectangle: { coordinates: new Cesium.CallbackProperty(() => { - let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.positions.lat)) * (0.0001 * this.options.scale) + let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.position.lat)) * (0.0001 * this.options.scale) let offset = { x: this.flipeY ? Math.abs(this.options.offset.x - 1) : this.options.offset.x, y: this.flipeX ? Math.abs(this.options.offset.y - 1) : this.options.offset.y, } offset = { lng: offset.x * ((0.0001 * this.options.scale) * 2), - lat: Math.abs(offset.y-1) * (gap * 2) + lat: Math.abs(offset.y - 1) * (gap * 2) } + // let point1 = [this.options.position.lng - offset.lng + 360, this.options.position.lat - offset.lat]; + // let point2 = [(this.options.position.lng - offset.lng) + ((0.0001 * this.options.scale) * 2) + 360, (this.options.position.lat - offset.lat) + (gap * 2)]; + // let midpoint = turf.point([point1[0]+point2[0]/2, point1[1]+point2[1]/2]); + // let rotatedPot = turf.transformRotate(midpoint, -Number(this.options.angle), {pivot: [this.options.position.lng, this.options.position.lat]}); + // console.log(midpoint.geometry.coordinates, rotatedPot.geometry.coordinates, this.options.position) + // let fromDegreesArray = [ + // rotatedPot.geometry.coordinates[0]-(0.0001 * this.options.scale), rotatedPot.geometry.coordinates[1]-(0.0001 * this.options.scale), + // rotatedPot.geometry.coordinates[0]+(0.0001 * this.options.scale), rotatedPot.geometry.coordinates[1]+(0.0001 * this.options.scale), + + // ] let fromDegreesArray = [ - this.options.positions.lng - offset.lng, this.options.positions.lat - offset.lat, - (this.options.positions.lng - offset.lng) + ((0.0001 * this.options.scale) * 2), (this.options.positions.lat - offset.lat) + (gap * 2), + // this.options.position.lng - offset.lng, this.options.position.lat - offset.lat, + // (this.options.position.lng - offset.lng) + ((0.0001 * this.options.scale) * 2), (this.options.position.lat - offset.lat) + (gap * 2), - // this.options.positions.lng - (0.0001 * this.options.scale), this.options.positions.lat - gap, - // // this.options.positions.lng + 0.05, this.options.positions.lat - 0.05, - // this.options.positions.lng + (0.0001 * this.options.scale), this.options.positions.lat + gap, - // // this.options.positions.lng - 0.05, this.options.positions.lat + 0.05, + this.options.position.lng - (0.0001 * this.options.scale), this.options.position.lat - gap, + // this.options.position.lng + 0.05, this.options.position.lat - 0.05, + this.options.position.lng + (0.0001 * this.options.scale), this.options.position.lat + gap, + // this.options.position.lng - 0.05, this.options.position.lat + 0.05, ] return Cesium.Rectangle.fromDegrees(...fromDegreesArray) @@ -281,7 +320,7 @@ class GroundImage extends Base { // 编辑框 async edit(state) { let _this = this - this.originalOptions = { ...this.options } + this.originalOptions = this.deepCopyObj(this.options) if (this._DialogObject && this._DialogObject.close) { this._DialogObject.close() this._DialogObject = null @@ -312,16 +351,19 @@ class GroundImage extends Base { this.Dialog.removeCallBack && this.Dialog.removeCallBack() }, closeCallBack: () => { + this.previous = null this.reset() // this.entity.style = new Cesium.Cesium3DTileStyle({ // color: "color('rgba(255,255,255," + this.newData.transparency + ")')", // show: true, // }); - this.positionEditing = false + if (anchorSetDialogObject && anchorSetDialogObject.close) { anchorSetDialogObject.close() } this.Dialog.closeCallBack && this.Dialog.closeCallBack() + YJ.Measure.SetMeasureStatus(false) + this.positionEditing = false }, showCallBack: (show) => { this.show = show @@ -491,17 +533,17 @@ class GroundImage extends Base { return } this._positionEditing = status - this.previous = { - positions: { ...this.options.positions } - } if (status === true) { + this.previous = { + position: { ...this.options.position } + } this.tip && this.tip.destroy() this.tip = new MouseTip('点击鼠标左键确认,右键取消', this.sdk) this.event.mouse_move((movement, cartesian) => { - let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer) - this.options.positions.lng = positions.lng - this.options.positions.lat = positions.lat - this.options.positions.alt = positions.alt + let position = this.cartesian3Towgs84(cartesian, this.sdk.viewer) + this.options.position.lng = position.lng + this.options.position.lat = position.lat + this.options.position.alt = position.alt this.tip.setPosition( cartesian, movement.endPosition.x, @@ -509,21 +551,22 @@ class GroundImage extends Base { ) }) this.event.mouse_left((movement, cartesian) => { - let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer) - this.options.positions.lng = positions.lng - this.options.positions.lat = positions.lat - this.options.positions.alt = positions.alt + let position = this.cartesian3Towgs84(cartesian, this.sdk.viewer) + this.options.position.lng = position.lng + this.options.position.lat = position.lat + this.options.position.alt = position.alt this.event.mouse_move(() => { }) this.event.mouse_left(() => { }) this.event.mouse_right(() => { }) this.event.gesture_pinck_start(() => { }) this.event.gesture_pinck_end(() => { }) + this.previous = null this.positionEditing = false }) this.event.mouse_right((movement, cartesian) => { - this.options.positions.lng = this.previous.positions.lng - this.options.positions.lat = this.previous.positions.lat - this.options.positions.alt = this.previous.positions.alt + this.options.position.lng = this.previous.position.lng + this.options.position.lat = this.previous.position.lat + this.options.position.alt = this.previous.position.alt this.positionEditing = false }) @@ -533,16 +576,16 @@ class GroundImage extends Base { let endTime = new Date() if (endTime - startTime >= 500) { // 长按取消 - this.options.positions.lng = this.previous.positions.lng - this.options.positions.lat = this.previous.positions.lat - this.options.positions.alt = this.previous.positions.alt + this.options.position.lng = this.previous.position.lng + this.options.position.lat = this.previous.position.lat + this.options.position.alt = this.previous.position.alt this.positionEditing = false } else { - let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer) - this.options.positions.lng = positions.lng - this.options.positions.lat = positions.lat - this.options.positions.alt = positions.alt + let position = this.cartesian3Towgs84(cartesian, this.sdk.viewer) + this.options.position.lng = position.lng + this.options.position.lat = position.lat + this.options.position.alt = position.alt this.event.mouse_move(() => { }) this.event.mouse_left(() => { }) this.event.mouse_right(() => { }) @@ -562,9 +605,17 @@ class GroundImage extends Base { this.event.gesture_pinck_end(() => { }) } this.tip && this.tip.destroy() - this.options.positions.lng = this.previous.positions.lng - this.options.positions.lat = this.previous.positions.lat - this.options.positions.alt = this.previous.positions.alt + if (!this.previous) { + this.previous = { + position: { ...this.options.position } + } + } + else { + this.options.position.lng = this.previous.position.lng + this.options.position.lat = this.previous.position.lat + this.options.position.alt = this.previous.position.alt + } + } } @@ -596,8 +647,8 @@ class GroundImage extends Base { if (this.options.position) { position = { ...this.options.position } } - else if (this.options.positions) { - position = { ...this.options.positions[0] } + else if (this.options.position) { + position = { ...this.options.position[0] } } else if (this.options.center) { position = { ...this.options.center } @@ -630,14 +681,14 @@ class GroundImage extends Base { }) } else { - let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.positions.lat)) * (0.0001 * this.options.scale) + let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.position.lat)) * (0.0001 * this.options.scale) let fromDegreesArray = [ - [this.options.positions.lng - (0.0001 * this.options.scale), this.options.positions.lat - gap], - [this.options.positions.lng + (0.0001 * this.options.scale), this.options.positions.lat + gap], + [this.options.position.lng - (0.0001 * this.options.scale), this.options.position.lat - gap], + [this.options.position.lng + (0.0001 * this.options.scale), this.options.position.lat + gap], ] let positionArray = [] let height = 0 - let position = this.options.positions + let position = this.options.position let point1 = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, 0); let point2 = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, 10000000); let direction = Cesium.Cartesian3.subtract(point2, point1, new Cesium.Cartesian3()); @@ -680,9 +731,14 @@ class GroundImage extends Base { if (!this.entity) { return } - this.name = this.originalOptions.name - this.angle = this.originalOptions.angle - this.scale = this.originalOptions.scale + this.options = this.deepCopyObj(this.originalOptions) + this.name = this.options.name + this.angle = this.options.angle + this.scale = this.options.scale + this.offset = this.options.offset + this.flipeX = this.options.flipe.x + this.flipeY = this.options.flipe.y + this.show = this.options.show } async remove() { @@ -699,9 +755,9 @@ class GroundImage extends Base { } setPosition(v) { - this.options.positions.lng = v.position.lng - this.options.positions.lat = v.position.lat - this.options.positions.alt = v.position.alt + this.options.position.lng = v.position.lng + this.options.position.lat = v.position.lat + this.options.position.alt = v.position.alt } } From ebaa10a79b7a08c1a83de6e4ffed4ab0dd1ed48e Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Tue, 12 Aug 2025 18:55:44 +0800 Subject: [PATCH 17/53] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/custom/css/index.css | 102 ++++++++++++++++++++++++++++-------- 1 file changed, 81 insertions(+), 21 deletions(-) diff --git a/static/custom/css/index.css b/static/custom/css/index.css index 32cb742..f7ce847 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -1034,6 +1034,7 @@ padding: 5px; position: fixed !important; } + .YJ-custom-base-dialog>.content .ew-color-picker input { font-size: 14px; line-height: 28px; @@ -1041,6 +1042,7 @@ padding: 0 8px; font-weight: 400; } + .YJ-custom-base-dialog>.content .ew-color-picker .input-number-unit input[type=number] { padding: 0 20px 0 8px; width: 66px; @@ -1049,11 +1051,12 @@ .YJ-custom-base-dialog.ew-color-picker>.ew-color-picker-content { margin-bottom: 10px; } -.YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content>.ew-color-panel { + +.YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content>.ew-color-panel { width: 302px; } -.YJ-custom-base-dialog .ew-color-picker> .ew-color-input { +.YJ-custom-base-dialog .ew-color-picker>.ew-color-input { margin-top: 1px; font-size: 14px; background-color: rgba(0, 0, 0, 0.5); @@ -1109,6 +1112,7 @@ margin: 0 0 8px 8px; border: 1px solid #9b979b; } + .YJ-custom-base-dialog .ew-color-picker>.ew-pre-define-color-container>.ew-pre-define-color:nth-child(11n+1) { width: 22px; height: 22px; @@ -1138,6 +1142,7 @@ text-align: center; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg=="); } + .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color:nth-child(11n+1) { margin: 0 0 8px 0; } @@ -1148,13 +1153,14 @@ background: unset; line-height: 22px; } + .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.add:hover, .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract:hover { border-color: rgba(var(--color-sdk-base-rgb), 0.4); } .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container svg, -.YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container> svg { +.YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>svg { margin: 0; } @@ -1171,6 +1177,7 @@ border-radius: 3px; cursor: pointer; } + .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color>.yj-pre-define-color-item.subtract-btn { position: absolute; top: 0; @@ -1192,6 +1199,7 @@ height: 28px; line-height: 28px; } + .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button.ew-color-clear { margin-right: 8px; } @@ -1229,12 +1237,12 @@ transform: rotate(-45deg); } -.YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtns{ +.YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtns { display: flex; align-items: center; } -.YJ-custom-base-dialog .ew-color-picker svg{ +.YJ-custom-base-dialog .ew-color-picker svg { margin: 0; } @@ -1955,6 +1963,7 @@ .YJ-custom-base-dialog.water-surface>.content>div .row .label { flex: 0 0 60px; } + /* 流光飞线 */ .YJ-custom-base-dialog.flow-line-surface>.content { width: 586px; @@ -2123,6 +2132,7 @@ .YJ-custom-base-dialog.particle-effects>.content .row>.col { width: 200px; } + .YJ-custom-base-dialog.particle-effects>.content .ew-color-picker .row>.col { width: auto; } @@ -2772,6 +2782,7 @@ .YJ-custom-base-dialog.polyline>.content { width: 580px; } + .YJ-custom-base-dialog.polyline>.content>div #dashTextureDom { display: none; } @@ -2823,6 +2834,7 @@ .YJ-custom-base-dialog.polyline>.content>div .spatial-info-table .table-body { max-height: 185px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-unit-box textarea { border-radius: unset !important; } @@ -2951,34 +2963,37 @@ } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit-box textarea { - border-radius: unset!important; + border-radius: unset !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit .datalist { - background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important; + background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; border-radius: 4px 0px 0px 4px !important; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) .datalist { - background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important; - border-radius: 4px 0px, 0px, 4px!important; + background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + border-radius: 4px 0px, 0px, 4px !important; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) .datalist { - background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important; - border-radius: 0px 4px 4px 0px!important; + background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + border-radius: 0px 4px 4px 0px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important; -} -.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important; + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; } -.YJ-custom-base-dialog.polyline>.content input.input-text{ - background-color: rgba(0, 0, 0, 0.5)!important; - border-radius: unset!important; - border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important; - border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; +.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; +} + +.YJ-custom-base-dialog.polyline>.content input.input-text { + background-color: rgba(0, 0, 0, 0.5) !important; + border-radius: unset !important; + border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist input { @@ -3002,65 +3017,78 @@ height: 13px; margin-right: 7px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.line { border: 1px solid rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.dash-line { border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.light-line { border: 1px solid rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; box-shadow: 0 0 3px #fff } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.tail-line { background: url(../../img/arrow/tail.png) 100% 100% no-repeat; background-size: 100% 100%; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.mult-tail-line { background: url(../../img/arrow/tail.png) 100% 100% no-repeat; background-size: 100% 100%; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line1 { border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line2 { border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line1 { background: url(../../img/arrow/1.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line2 { background: url(../../img/arrow/2.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line3 { background: url(../../img/arrow/3.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line4 { - background: url(../../img/arrow/4.png) ; + background: url(../../img/arrow/4.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line5 { background: url(../../img/arrow/5.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line6 { background: url(../../img/arrow/6.png) 100% 100% no-repeat; background-size: 100% 100%; @@ -3514,3 +3542,35 @@ border: 1px solid #ff7300; cursor: pointer; } + +.billboard-attribute-box { + position: absolute; + z-index: 1; + background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); + border: 1.5px solid; + border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; + color: #fff; +} +.billboard-attribute-box .DIV-cy-tabs { + height: 100%; + display: flex; + flex-direction: column; +} +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title { + padding: 0 2px; +} +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:first-child { + padding-left: 0; +} +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:last-child { + padding-right: 0; +} +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title span{ + margin: 0 5px; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content { + padding: 0 5px 5px 5px; + box-sizing: border-box; + flex: 1; +} \ No newline at end of file From 20ae03cc5ec41594e775d0d5e795baf60fefac83 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 13 Aug 2025 10:07:15 +0800 Subject: [PATCH 18/53] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=95=E5=9B=BE?= =?UTF-8?q?=E7=9A=84=E4=BA=8C=E4=B8=89=E7=BB=B4=E5=8D=95=E7=8B=AC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/MultiViewportMode/index.js | 17 +++++++++++- src/Obj/Base/GeoJson/index.js | 24 +++++++++++++++++ src/Obj/Base/index.js | 38 ++++++++++++++++++++++++--- 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/src/Global/MultiViewportMode/index.js b/src/Global/MultiViewportMode/index.js index 5d3c600..a05fd63 100644 --- a/src/Global/MultiViewportMode/index.js +++ b/src/Global/MultiViewportMode/index.js @@ -409,11 +409,25 @@ function syncImageryLayerRemoved(layer, index) { sdk2D.viewer.imageryLayers.remove(layer2d) } function syncImageryLayerShownOrHidden(layer, index, state) { + return let layer2d = sdk2D.viewer.imageryLayers._layers[index] + let layer3d = sdk3D.viewer.imageryLayers._layers[index] + console.log('layer2d', layer2d, sdk2D, layer3d) + if (!layer2d) { return } - layer2d.show = state + if(layer3d._objectState) { + if(!layer3d._showView || layer3d._showView==2) { + layer2d.show = true + } + if(layer3d._showView==3) { + layer2d.show = false + } + } + else { + layer2d.show = state + } } async function syncPrimitives(primitive) { @@ -543,6 +557,7 @@ function syncViewer() { } + function get2DView() { return sdk2D } diff --git a/src/Obj/Base/GeoJson/index.js b/src/Obj/Base/GeoJson/index.js index 43e4b25..795785e 100644 --- a/src/Obj/Base/GeoJson/index.js +++ b/src/Obj/Base/GeoJson/index.js @@ -8,6 +8,8 @@ import { getHost, getToken } from "../../../on"; import Base from '../index' import Tools from '../../../Tools' +import { syncSplitData } from "../../../Global/SplitScreen"; +import { syncData } from '../../../Global/MultiViewportMode' import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Global/global' class GeoJson extends Base { @@ -26,6 +28,7 @@ class GeoJson extends Base { this.primitive = undefined this.positions = [] + this.loading = true } @@ -48,6 +51,26 @@ class GeoJson extends Base { return this.options.show } + // set show(status) { + // if (!this.isShowView) { + // this.options.show = status + // } + // if (this.entity) { + // if (!this.showView || this.showView == 3) { + // for (let i = 0; i < this.entity.entities.values.length; i++) { + // this.entity.entities.values[i].show = this.options.show + // } + // } + // else { + // for (let i = 0; i < this.entity.entities.values.length; i++) { + // this.entity.entities.values[i].show = false + // } + // } + // } + // syncData(this.sdk, this.options.id) + // syncSplitData(this.sdk, this.options.id) + // this.isShowView = false + // } set show(status) { this.options.show = status if (this.entity) { @@ -74,6 +97,7 @@ class GeoJson extends Base { }) let json = await rsp.json() this.geojson = json + // this.sdk.addIncetance(this.options.id, this) return GeoJson.addDataToGlobe(this, json.features) } diff --git a/src/Obj/Base/index.js b/src/Obj/Base/index.js index 28a6fcb..4cee908 100644 --- a/src/Obj/Base/index.js +++ b/src/Obj/Base/index.js @@ -62,9 +62,11 @@ class Base extends Tools { } set showView(v) { + + let sdk2D = get2DSdk().sdkD - if(!sdk2D) { - v=0 + if (!sdk2D) { + v = 0 } if (!this.#_showView && !this.show) { return @@ -124,10 +126,16 @@ class Base extends Tools { this.originalOptions.show = v } } + this.entity._showView = this.showView + if (this.type == 'layer') { + if (this.entity) { + this.entity._objectState = this.options.show + } + } if (!this.showView || this.showView == 3) { this.entity && (this.entity.show = this.options.show) if (this.options.label && this.options.label.show && this.label) { - this.label.show = this.options.show + this.label.show = this.options.show } } else { @@ -138,12 +146,34 @@ class Base extends Tools { } if (this._DialogObject && this._DialogObject.showBtn) { - this._DialogObject.showBtn.checked = this.options.show + this._DialogObject.showBtn.checked = this.options.show } + syncData(this.sdk, this.options.id) 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 + + if (!layer2d) { + return + } + if (layer3d._objectState) { + if (!layer3d._showView || layer3d._showView == 2) { + layer2d.show = true + } + if (layer3d._showView == 3) { + layer2d.show = false + } + } + else { + layer2d.show = this.options.show + } + } } else { console.error("参数必须为boolean") } From fff8041faa0fd764f830d9f839cc4cabe7a72fed Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 13 Aug 2025 11:51:39 +0800 Subject: [PATCH 19/53] =?UTF-8?q?showView=E7=8A=B6=E6=80=81=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/MultiViewportMode/index.js | 33 ++++++++++++++----- src/Global/mouseRightMenu/index.js | 16 ++++----- src/Obj/Base/CircleDiffuse/index.js | 12 ++++--- src/Obj/Base/GeoJson/index.js | 7 ++-- src/Obj/Base/ParticleEffects/Flame/index.js | 7 ++-- .../Base/ParticleEffects/Fountain/index.js | 7 ++-- src/Obj/Base/ParticleEffects/Smoke/index.js | 7 ++-- src/Obj/Base/ParticleEffects/Spout/index.js | 7 ++-- src/Obj/Base/RadarScan/index.js | 12 ++++--- src/Obj/Base/TrajectoryMotion/index.js | 29 +++++++++------- src/Obj/Base/index.js | 6 ++-- 11 files changed, 86 insertions(+), 57 deletions(-) diff --git a/src/Global/MultiViewportMode/index.js b/src/Global/MultiViewportMode/index.js index a05fd63..f5531be 100644 --- a/src/Global/MultiViewportMode/index.js +++ b/src/Global/MultiViewportMode/index.js @@ -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 } } diff --git a/src/Global/mouseRightMenu/index.js b/src/Global/mouseRightMenu/index.js index 818271b..891623f 100644 --- a/src/Global/mouseRightMenu/index.js +++ b/src/Global/mouseRightMenu/index.js @@ -100,14 +100,14 @@ function MouseRightMenu(sdk, status, callBack) { that = sdk.entityMap.get(entityId) } - if (that && that.picking) { - addedMenu = ` - -
    -
  • 属性
  • -
- ` - } + // if (that && that.picking) { + // addedMenu = ` + // + //
    + //
  • 属性
  • + //
+ // ` + // } let position = tools.cartesian3Towgs84(cartesian, sdk.viewer) menuElm = document.createElement('div') menuElm.id = 'custom-menu' diff --git a/src/Obj/Base/CircleDiffuse/index.js b/src/Obj/Base/CircleDiffuse/index.js index d7fe430..36acfa4 100644 --- a/src/Obj/Base/CircleDiffuse/index.js +++ b/src/Obj/Base/CircleDiffuse/index.js @@ -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 diff --git a/src/Obj/Base/GeoJson/index.js b/src/Obj/Base/GeoJson/index.js index 795785e..02a0bbe 100644 --- a/src/Obj/Base/GeoJson/index.js +++ b/src/Obj/Base/GeoJson/index.js @@ -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 // } diff --git a/src/Obj/Base/ParticleEffects/Flame/index.js b/src/Obj/Base/ParticleEffects/Flame/index.js index 77b66b8..08fe7bb 100644 --- a/src/Obj/Base/ParticleEffects/Flame/index.js +++ b/src/Obj/Base/ParticleEffects/Flame/index.js @@ -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 } diff --git a/src/Obj/Base/ParticleEffects/Fountain/index.js b/src/Obj/Base/ParticleEffects/Fountain/index.js index 7b2a2a0..893eb47 100644 --- a/src/Obj/Base/ParticleEffects/Fountain/index.js +++ b/src/Obj/Base/ParticleEffects/Fountain/index.js @@ -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 } diff --git a/src/Obj/Base/ParticleEffects/Smoke/index.js b/src/Obj/Base/ParticleEffects/Smoke/index.js index f457661..3d367f7 100644 --- a/src/Obj/Base/ParticleEffects/Smoke/index.js +++ b/src/Obj/Base/ParticleEffects/Smoke/index.js @@ -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 } diff --git a/src/Obj/Base/ParticleEffects/Spout/index.js b/src/Obj/Base/ParticleEffects/Spout/index.js index 9e78cd5..ed2863d 100644 --- a/src/Obj/Base/ParticleEffects/Spout/index.js +++ b/src/Obj/Base/ParticleEffects/Spout/index.js @@ -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 } diff --git a/src/Obj/Base/RadarScan/index.js b/src/Obj/Base/RadarScan/index.js index dd3ec65..3959c72 100644 --- a/src/Obj/Base/RadarScan/index.js +++ b/src/Obj/Base/RadarScan/index.js @@ -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 diff --git a/src/Obj/Base/TrajectoryMotion/index.js b/src/Obj/Base/TrajectoryMotion/index.js index 56a8c6e..f561a70 100644 --- a/src/Obj/Base/TrajectoryMotion/index.js +++ b/src/Obj/Base/TrajectoryMotion/index.js @@ -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 { diff --git a/src/Obj/Base/index.js b/src/Obj/Base/index.js index 4cee908..7439d37 100644 --- a/src/Obj/Base/index.js +++ b/src/Obj/Base/index.js @@ -120,7 +120,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 +133,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 +155,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 From d17b03838877bd864dd8b7fbe32411d2f2496d6f Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 13 Aug 2025 21:56:07 +0800 Subject: [PATCH 20/53] =?UTF-8?q?=E8=B4=B4=E5=9C=B0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=8B=E4=BD=93=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/GroundImage/_element.js | 86 +- src/Obj/Base/GroundImage/index.js | 1320 ++++++++++++++++++++++++-- 2 files changed, 1340 insertions(+), 66 deletions(-) diff --git a/src/Obj/Base/GroundImage/_element.js b/src/Obj/Base/GroundImage/_element.js index 95acf9f..0edeb1e 100644 --- a/src/Obj/Base/GroundImage/_element.js +++ b/src/Obj/Base/GroundImage/_element.js @@ -1,5 +1,5 @@ function html() { - return ` + return `
@@ -7,14 +7,21 @@ function html() { 名称
-
- -
+
+
+ +
+
+ 军标模式 +
+
+
+
旋转角度 @@ -25,7 +32,7 @@ function html() {
-
+
调整大小 @@ -35,6 +42,75 @@ function html() {
+
+
+ 高度模式 +
+
+
+
+ 高度 +
+ + m + +
+
+
+
+ 图标倍数 +
+ + + +
+
+
+
+
+ 视野缩放 + +
+
+ 最近距离 +
+ + m + +
+
+
+ 最远距离 +
+ + m + +
+
+
+

文字设置

+
+
+ 显隐 + +
+
+ 字体选择 +
+
+
+ 文字大小 +
+ + px + +
+
+
+ 文字颜色 +
+
+
` diff --git a/src/Obj/Base/GroundImage/index.js b/src/Obj/Base/GroundImage/index.js index df7f882..2544c4f 100644 --- a/src/Obj/Base/GroundImage/index.js +++ b/src/Obj/Base/GroundImage/index.js @@ -4,8 +4,11 @@ import { html } from "./_element"; import EventBinding from '../../Element/Dialog/eventBinding'; import Base from "../index"; import MouseEvent from '../../../Event/index' +import { legp } from '../../Element/datalist' import { syncData } from '../../../Global/MultiViewportMode' +import { getGroundCover } from '../../../Global/global' import MouseTip from '../../../MouseTip' +import { getFontList, getFontFamily, getFontFamilyName } from '../../Element/fontSelect' import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' @@ -36,11 +39,31 @@ class GroundImage extends Base { this.options.angle = options.angle || 0 this.options.scale = (options.scale || options.scale === 0) ? options.scale : 1 this.options.position = options.position - this.options.offset = options.offset || { x: 0.5, y: 0.5 } + this.options.offset = options.offset || { x: 0.5, y: 1 } + this.options.mode = this.options.mode ? 1 : 0 + this.options.billboard = options.billboard || {} + this.options.billboard.scale = this.options.billboard.scale || 1 + this.options.billboard.near = this.options.billboard.near || this.options.billboard.near === 0 ? this.options.billboard.near : 2000 + this.options.billboard.far = this.options.billboard.far || this.options.billboard.far === 0 ? this.options.billboard.far : 100000 + this.options.billboard.scaleByDistance = this.options.billboard.scaleByDistance ? true : false + + options.label = options.label || {} + this.options.label = options.label || {} + this.options.label.text = options.label.text || this.options.name + this.options.name = this.options.label.text + this.options.label.show = + options.label.show || options.label.show === false + ? options.label.show + : true + this.options.label.fontFamily = options.label.fontFamily || 0 + this.options.label.fontSize = options.label.fontSize || 39 + this.options.label.color = options.label.color || '#00ffff' this.options.flipe = options.flipe || {} this.options.flipe.x = this.options.flipe.x || false this.options.flipe.y = this.options.flipe.y || false + this.options.heightMode = + options.heightMode || options.heightMode == 0 ? options.heightMode : 3 this.entity = { id: this.options.id @@ -48,6 +71,7 @@ class GroundImage extends Base { this._positionEditing = false this.Dialog = _Dialog this._elms = {}; + this._proj = this.sdk.proj this.previous = { position: { ...this.options.position } } @@ -57,6 +81,123 @@ class GroundImage extends Base { this.create() } + get mode() { + return this.options.mode + } + set mode(v) { + this.options.mode = v ? 1 : 0 + let modeData = [ + { + name: '贴地', + value: '贴地', + key: 0 + }, + { + name: '立体', + value: '立体', + key: 1 + } + ] + for (let i = 0; i < modeData.length; i++) { + if (modeData[i].key === this.options.mode) { + this._elms.mode && this._elms.mode.forEach((item) => { + item.value = modeData[i].value + }) + break + } + } + let elms = this._DialogObject._element.body.getElementsByClassName('row') + let elms2 = this._DialogObject._element.foot.getElementsByTagName('button') + let elms3 = this._DialogObject._element.foot.getElementsByTagName('h4') + for (let i = 0; i < elms.length; i++) { + let mode = elms[i].getAttribute('mode') + if (mode !== null) { + if (mode == this.options.mode) { + elms[i].style.display = 'flex' + } + else { + elms[i].style.display = 'none' + } + } + } + for (let i = 0; i < elms2.length; i++) { + let mode = elms2[i].getAttribute('mode') + if (mode !== null) { + if (mode == this.options.mode) { + elms2[i].style.display = 'block' + } + else { + elms2[i].style.display = 'none' + } + } + } + for (let i = 0; i < elms3.length; i++) { + let mode = elms3[i].getAttribute('mode') + if (mode !== null) { + if (mode == this.options.mode) { + elms3[i].style.display = 'block' + } + else { + elms3[i].style.display = 'none' + } + } + } + const img = new Image(); + img.crossOrigin = 'Anonymous'; + img.src = this.replaceHost(this.options.url, this.options.host); + img.onload = () => { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + + if (this.mode) { + // canvas.width = img.width + // canvas.height = img.height; + // let billboardH = img.height * (128 / img.width) + + // if (this.flipeX) { + // ctx.scale(1, -1); + // ctx.translate(0, -canvas.height) + // } + // if (this.flipeY) { + // ctx.scale(-1, 1); + // ctx.translate(-canvas.width, 0); + // } + // ctx.drawImage(img, 0, 0, img.width, img.height) + // this.entity.billboard.image = canvas + // this.entity.billboard.pixelOffset = { x: -128 * this.billboardScale * (this.flipeY ? (1-this.options.offset.x) : this.options.offset.x), y: -billboardH * this.billboardScale * (this.flipeX ? (1-this.options.offset.y) : this.options.offset.y) } + let canvas = this.entity.billboard.image.getValue() + let billboardH = canvas.height * (128 / canvas.width) + this.entity.billboard.pixelOffset = { x: -128 * this.billboardScale * this.options.offset.x, y: -billboardH * this.billboardScale * this.options.offset.y } + this.entity.billboard.show = true + this.labelShow && (this.entity.label.show = true) + this.entity.rectangle.show = false + } + else { + // 设置画布大小 + canvas.width = img.width * 2; + canvas.height = img.height * 2; + + // 绘制图像 + if (this.flipeX) { + ctx.scale(1, -1); + ctx.translate(0, -canvas.height) + } + if (this.flipeY) { + ctx.scale(-1, 1); + ctx.translate(-canvas.width, 0); + } + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); + this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ + image: canvas, + transparent: true + }) + this.entity.billboard.show = false + this.entity.label.show = false + this.entity.rectangle.show = true + } + } + } + get offset() { return this.options.offset } @@ -69,24 +210,52 @@ class GroundImage extends Base { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); - // 设置画布大小 - canvas.width = img.width * 2; - canvas.height = img.height * 2; + if (this.mode) { + // canvas.width = img.width + // canvas.height = img.height; + // let billboardH = img.height * (128 / img.width) - // 绘制图像 - if (this.flipeX) { - ctx.scale(1, -1); - ctx.translate(0, -canvas.height) + // if (this.flipeX) { + // ctx.scale(1, -1); + // ctx.translate(0, -canvas.height) + // } + // if (this.flipeY) { + // ctx.scale(-1, 1); + // ctx.translate(-canvas.width, 0); + // } + // ctx.drawImage(img, 0, 0, img.width, img.height) + // this.entity.billboard.image = canvas + // this.entity.billboard.pixelOffset = { x: -128 * this.billboardScale * (this.flipeY ? (1-this.options.offset.x) : this.options.offset.x), y: -billboardH * this.billboardScale * (this.flipeX ? (1-this.options.offset.y) : this.options.offset.y) } + let canvas = this.entity.billboard.image.getValue() + let billboardH = canvas.height * (128 / canvas.width) + this.entity.billboard.pixelOffset = { x: -128 * this.billboardScale * this.options.offset.x, y: -billboardH * this.billboardScale * this.options.offset.y } + this.entity.billboard.show = true + this.labelShow && (this.entity.label.show = true) + this.entity.rectangle.show = false } - if (this.flipeY) { - ctx.scale(-1, 1); - ctx.translate(-canvas.width, 0); + else { + // 设置画布大小 + canvas.width = img.width * 2; + canvas.height = img.height * 2; + + // 绘制图像 + if (this.flipeX) { + ctx.scale(1, -1); + ctx.translate(0, -canvas.height) + } + if (this.flipeY) { + ctx.scale(-1, 1); + ctx.translate(-canvas.width, 0); + } + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); + this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ + image: canvas, + transparent: true + }) + this.entity.billboard.show = false + this.entity.label.show = false + this.entity.rectangle.show = true } - ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); - this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ - image: canvas, - transparent: true - }) } } @@ -112,6 +281,70 @@ class GroundImage extends Base { }) } + get billboardScale() { + return this.options.billboard.scale + } + set billboardScale(v) { + let billboardScale = Number(v.toFixed(2)) + if (billboardScale > 99) { + billboardScale = 99 + } + if (billboardScale < 0.1) { + billboardScale = 0.1 + } + this.options.billboard.scale = billboardScale + this.renewPoint() + this._elms.billboardScale && + this._elms.billboardScale.forEach(item => { + item.value = v + }) + } + + get billboardScaleByDistance() { + return this.options.billboard.scaleByDistance + } + set billboardScaleByDistance(v) { + this.options.billboard.scaleByDistance = v + this.renewPoint() + this._elms.billboardScaleByDistance && + this._elms.billboardScaleByDistance.forEach(item => { + item.checked = v + }) + } + + get billboardNear() { + return this.options.billboard.near + } + set billboardNear(v) { + let near = v + if (near > this.billboardFar) { + near = this.billboardFar + } + this.options.billboard.near = near + this.renewPoint() + this._elms.billboardNear && + this._elms.billboardNear.forEach(item => { + item.value = near + }) + } + + get billboardFar() { + return this.options.billboard.far + } + set billboardFar(v) { + let far = v + if (far < this.billboardNear) { + far = this.billboardNear + } + this.options.billboard.far = far + this.renewPoint() + this._elms.billboardFar && + this._elms.billboardFar.forEach(item => { + item.value = far + }) + } + + get flipeY() { return this.options.flipe.y } @@ -129,28 +362,47 @@ class GroundImage extends Base { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); - // 设置画布大小 - canvas.width = img.width * 2; - canvas.height = img.height * 2; + if (this.mode) { + // canvas.width = img.width + // canvas.height = img.height; + // let billboardH = img.height * (128 / img.width) + // if (this.flipeX) { + // ctx.scale(1, -1); + // ctx.translate(0, -canvas.height) + // } + // if (this.flipeY) { + // ctx.scale(-1, 1); + // ctx.translate(-canvas.width, 0); + // } + // ctx.drawImage(img, 0, 0, img.width, img.height) + // this.entity.billboard.image = canvas + // this.entity.billboard.pixelOffset = { x: -128 * this.billboardScale * (this.flipeY ? (1-this.options.offset.x) : this.options.offset.x), y: -billboardH * this.billboardScale * (this.flipeX ? (1-this.options.offset.y) : this.options.offset.y) } + // this.entity.billboard.show = true + // this.entity.rectangle.show = false + } + else { + // 设置画布大小 + canvas.width = img.width * 2; + canvas.height = img.height * 2; - // 绘制图像 - if (this.flipeX) { - ctx.scale(1, -1); - ctx.translate(0, -canvas.height) + // 绘制图像 + if (this.flipeX) { + ctx.scale(1, -1); + ctx.translate(0, -canvas.height) + } + if (this.flipeY) { + ctx.scale(-1, 1); + ctx.translate(-canvas.width, 0); + } + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); + this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ + image: canvas, + transparent: true + }) + this.entity.billboard.show = false + this.entity.label.show = false + this.entity.rectangle.show = true } - if (this.flipeY) { - ctx.scale(-1, 1); - ctx.translate(-canvas.width, 0); - } - ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); - this.entity && (this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ - image: canvas, - transparent: true - })) - // this.offset = { - // x: Math.abs(this.offset.x - 1), - // y: this.offset.y, - // } } } else { console.error("参数必须为boolean") @@ -173,24 +425,48 @@ class GroundImage extends Base { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); - // 设置画布大小 - canvas.width = img.width * 2; - canvas.height = img.height * 2; + if (this.mode) { + // canvas.width = img.width + // canvas.height = img.height; + // let billboardH = img.height * (128 / img.width) + // if (this.flipeX) { + // ctx.scale(1, -1); + // ctx.translate(0, -canvas.height) + // } + // if (this.flipeY) { + // ctx.scale(-1, 1); + // ctx.translate(-canvas.width, 0); + // } + // ctx.drawImage(img, 0, 0, img.width, img.height) + // this.entity.billboard.image = canvas + // this.entity.billboard.pixelOffset = { x: -128 * this.billboardScale * (this.flipeY ? (1-this.options.offset.x) : this.options.offset.x), y: -billboardH * this.billboardScale * (this.flipeX ? (1-this.options.offset.y) : this.options.offset.y) } + // this.entity.billboard.show = true + // this.entity.rectangle.show = false + } + else { + // 设置画布大小 + canvas.width = img.width * 2; + canvas.height = img.height * 2; - // 绘制图像 - if (this.flipeX) { - ctx.scale(1, -1); - ctx.translate(0, -canvas.height) + // 绘制图像 + if (this.flipeX) { + ctx.scale(1, -1); + ctx.translate(0, -canvas.height) + } + if (this.flipeY) { + ctx.scale(-1, 1); + ctx.translate(-canvas.width, 0); + } + ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); + this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ + image: canvas, + transparent: true + }) + this.entity.billboard.show = false + this.entity.label.show = false + this.entity.rectangle.show = true } - if (this.flipeY) { - ctx.scale(-1, 1); - ctx.translate(-canvas.width, 0); - } - ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); - this.entity.rectangle.material = new Cesium.ImageMaterialProperty({ - image: canvas, - transparent: true - }) + // this.offset = { // x: this.offset.x, // y: Math.abs(this.offset.y - 1), @@ -201,6 +477,265 @@ class GroundImage extends Base { } } + get heightMode() { + return this.options.heightMode ? this.options.heightMode : 0 + } + set heightMode(v) { + this.options.heightMode = v ? v : 0 + this.options.heightMode = v || v == 0 ? v : 3 + let heightMode + let heightModeName = '' + let altBoxElm + if ( + this._DialogObject && + this._DialogObject._element && + this._DialogObject._element.content + ) { + altBoxElm = this._DialogObject._element.content.getElementsByClassName( + 'alt-box' + )[0] + } + let heightElm + if (this._elms.height) { + heightElm = this._elms.height.getElementsByClassName('input-number')[0] + } + switch (this.options.heightMode) { + case '0': + case 0: + altBoxElm && + (altBoxElm.className = 'input-number input-number-unit-1 alt-box') + // this._elms.height && (this._elms.height.style.display = 'flex') + heightElm && (heightElm.className = 'input-number input-number-unit-1') + heightMode = Cesium.HeightReference.NONE + heightModeName = '海拔高度' + break + case '1': + case 1: + altBoxElm && + (altBoxElm.className = 'input-number input-number-unit-1 alt-box') + // this._elms.height && (this._elms.height.style.display = 'flex') + heightElm && (heightElm.className = 'input-number input-number-unit-1') + heightMode = Cesium.HeightReference.NONE + heightModeName = '相对地表' + break + case '2': + case 2: + altBoxElm && + (altBoxElm.className = + 'input-number input-number-unit-1 alt-box disabled') + heightModeName = '依附地表' + altBoxElm && + (altBoxElm.className = + 'input-number input-number-unit-1 alt-box disabled') + heightModeName = '依附地表' + heightMode = Cesium.HeightReference.CLAMP_TO_GROUND + // this._elms.height && (this._elms.height.style.display = 'none') + heightElm && (heightElm.className = 'input-number input-number-unit-1 disabled') + break + case '3': + case 3: + altBoxElm && + (altBoxElm.className = + 'input-number input-number-unit-1 alt-box disabled') + // this._elms.height && (this._elms.height.style.display = 'none') + heightElm && (heightElm.className = 'input-number input-number-unit-1 disabled') + heightMode = Cesium.HeightReference.NONE + heightModeName = '依附模型' + break + } + if (this.entity && this.entity.billboard) { + this.entity.billboard.heightReference = heightMode + } + this._elms.heightMode && (this._elms.heightMode.value = heightModeName) + } + + get coordinate() { + return this.options.coordinate + } + set coordinate(v) { + this.options.coordinate = v + // let position = this._proj.convert( + // [ + // { + // x: this.options.position.lng, + // y: this.options.position.lat, + // z: this.options.position.alt + // } + // ], + // 'EPSG:4326', + // v + // ).points + // if ( + // this._DialogObject && + // this._DialogObject._element && + // this._DialogObject._element.content && + // position[0] + // ) { + // this._DialogObject._element.content.getElementsByClassName( + // 'convert-x' + // )[0].value = position[0].x + // this._DialogObject._element.content.getElementsByClassName( + // 'convert-y' + // )[0].value = position[0].y + // this._DialogObject._element.content.getElementsByClassName( + // 'convert-z' + // )[0].value = position[0].z + // } + // this._elms.coordinate && + // this._elms.coordinate.forEach(item => { + // item.value = v + // }) + } + + get position() { + return this.options.position + } + + set position(v) { + this.options.position = v + + this.coordinate = this.options.coordinate + + if (this._textToCenter) { + let point = turf.point([this.options.position.lng, this.options.position.lat]) + let targetPoint = turf.destination(point, this._textToCenter.distance, this._textToCenter.angle, { units: 'kilometers' }).geometry.coordinates + this.getClampToHeight({ lng: targetPoint[0], lat: targetPoint[1] }).then((height) => { + let textPosition = [targetPoint[0], targetPoint[1], height] + this.options.text.position = { lng: targetPoint[0], lat: targetPoint[1], alt: height } + this.text && (this.text.position = textPosition) + }) + } + + this._elms.lng && + this._elms.lng.forEach(item => { + item.value = this.options.position.lng + }) + this._elms.lat && + this._elms.lat.forEach(item => { + item.value = this.options.position.lat + }) + + if (this._elms.height) { + let heightElm = this._elms.height.getElementsByClassName('height')[0] + if (heightElm) { + switch (this._elms.heightMode.value) { + case '海拔高度': + heightElm.value = this.options.position.alt + break + case '相对地表': + if (this.sdk.viewer.scene.terrainProvider.availability) { + Cesium.sampleTerrainMostDetailed( + this.sdk.viewer.scene.terrainProvider, + [ + Cesium.Cartographic.fromDegrees( + this.options.position.lng, + this.options.position.lat + ) + ] + ).then(position => { + heightElm.value = Number( + (this.options.position.alt - position[0].height).toFixed(2) + ) + this._elms.alt && + this._elms.alt.forEach(item => { + item.value = this.options.position.alt + }) + }) + } else { + heightElm.value = Number( + Number(this.options.position.alt).toFixed(2) + ) + this._elms.alt && + this._elms.alt.forEach(item => { + item.value = this.options.position.alt + }) + } + break + case '依附地表': + case '依附地表': + break + case '依附模型': + this.updateHeight() + break + } + } + } + } + + get labelShow() { + return this.options.label.show + } + set labelShow(v) { + this.options.label.show = v + if (this.entity) { + if (this.mode == 1) { + this.entity.label.show = v + } + else { + this.entity.label.show = false + } + } + + this._elms.labelShow && + this._elms.labelShow.forEach(item => { + item.value = v + }) + } + + get labelFontFamily() { + return this.options.label.fontFamily + } + + set labelFontFamily(v) { + this.options.label.fontFamily = v || 0 + this.renewPoint() + + let name = getFontFamilyName(this.labelFontFamily) || '' + this._elms.labelFontFamily && + this._elms.labelFontFamily.forEach(item => { + item.value = name + }) + } + + get labelFontSize() { + return this.options.label.fontSize + } + set labelFontSize(v) { + this.options.label.fontSize = v + this.renewPoint() + this._elms.labelFontSize && + this._elms.labelFontSize.forEach(item => { + item.value = v + }) + } + + get labelColor() { + return this.options.label.color + } + set labelColor(v) { + this.options.label.color = v || '#00ffff' + this.renewPoint() + if (this._elms.labelColor) { + this._elms.labelColor.forEach((item, i) => { + let colorPicker = new YJColorPicker({ + el: item.el, + size: 'mini', //颜色box类型 + alpha: true, //是否开启透明度 + defaultColor: this.options.label.color, + disabled: false, //是否禁止打开颜色选择器 + openPickerAni: 'opacity', //打开颜色选择器动画 + sure: c => { + this.labelColor = c + }, //点击确认按钮事件回调 + clear: () => { + this.labelColor = 'rgba(0,255,255,1)' + } //点击清空按钮事件回调 + }) + this._elms.labelColor[i] = colorPicker + }) + } + } + async create() { // let gap = Math.abs(Math.cos(Math.PI/180 * this.options.position.lat)) * (0.0001*this.options.scale) // let fromDegreesArray = [ @@ -209,6 +744,15 @@ class GroundImage extends Base { // this.options.position.lng + 0.05, this.options.position.lat + 0.05, // this.options.position.lng - 0.05, this.options.position.lat + 0.05, // ] + let _this = this + let heightMode + let font = getFontFamily(this.labelFontFamily) || 'Helvetica' + switch (this.options.heightMode) { + case 2: + case '2': + heightMode = Cesium.HeightReference.CLAMP_TO_GROUND + break + } let response = await fetch(this.replaceHost(this.options.url, this.options.host), { method: 'get', headers: { @@ -225,6 +769,13 @@ class GroundImage extends Base { img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); + const canvas2 = document.createElement('canvas'); + const ctx2 = canvas2.getContext('2d'); + let width = img.width + let height = img.height + canvas2.width = width + canvas2.height = height; + ctx2.drawImage(img, 0, 0, width, height) // 设置画布大小 canvas.width = img.width * 2; @@ -240,10 +791,65 @@ class GroundImage extends Base { } ctx.drawImage(img, img.width - (img.width * this.options.offset.x), img.height - (img.height * this.options.offset.y)); + + let billboardH = height * (128 / width) + this.entity = this.sdk.viewer.entities.add({ id: this.options.id, show: this.options.show, + position: new Cesium.CallbackProperty(() => { + return Cesium.Cartesian3.fromDegrees( + this.options.position.lng, + this.options.position.lat, + this.options.position.alt || 0 + ) + }), + billboard: { + show: this.mode ? true : false, + image: canvas2, + scale: this.billboardScale, + disableDepthTestDistance: new Cesium.CallbackProperty(function () { + return getGroundCover() ? undefined : Number.POSITIVE_INFINITY + }, false), + heightReference: heightMode, + width: 128, + height: billboardH, + horizontalOrigin: Cesium.HorizontalOrigin.LEFT, + verticalOrigin: Cesium.VerticalOrigin.TOP, + // pixelOffset: { x: -128 * this.billboardScale * (this.flipeY ? (1-this.options.offset.x) : this.options.offset.x), y: -billboardH * this.billboardScale * (this.flipeX ? (1-this.options.offset.y) : this.options.offset.y) } + pixelOffset: { x: -128 * this.billboardScale * this.options.offset.x, y: -billboardH * this.billboardScale * this.options.offset.y } + }, + label: { + show: this.mode ? _this.options.label.show : false, + text: _this.options.label.text, + disableDepthTestDistance: new Cesium.CallbackProperty(function () { + return getGroundCover() ? undefined : Number.POSITIVE_INFINITY + }, false), + heightReference: heightMode, + font: _this.options.label.fontSize + 'px ' + font, + fillColor: Cesium.Color.fromCssColorString(_this.options.label.color), + // verticalOrigin : Cesium.VerticalOrigin.BOTTOM, + pixelOffset: new Cesium.CallbackProperty(function () { + if (_this.options.show) { + return new Cesium.Cartesian2( + 0, + -billboardH * _this.billboardScale - + _this.options.label.fontSize / 2 - + 5 + ) + } else { + return new Cesium.Cartesian2( + 0, + -_this.options.label.fontSize / 2 - 5 + ) + } + }, false), + outlineColor: Cesium.Color.BLACK, + outlineWidth: 1, + style: Cesium.LabelStyle.FILL_AND_OUTLINE + }, rectangle: { + show: this.mode ? false : true, coordinates: new Cesium.CallbackProperty(() => { let gap = Math.abs(Math.cos(Math.PI / 180 * this.options.position.lat)) * (0.0001 * this.options.scale) let offset = { @@ -293,6 +899,8 @@ class GroundImage extends Base { }, false) }, }) + + this.renewPoint() if (this.sdk.viewer._element.className === 'cesium-viewer 2d') { this.entity.rectangle.height = 0 } @@ -340,8 +948,8 @@ class GroundImage extends Base { this.originalOptions = this.deepCopyObj(this.options) this._DialogObject.close() this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions) - syncData(this.sdk, this.options.id) - syncSplitData(this.sdk, this.options.id) + // syncData(this.sdk, this.options.id) + // syncSplitData(this.sdk, this.options.id) }, resetCallBack: () => { this.reset() @@ -357,7 +965,7 @@ class GroundImage extends Base { // color: "color('rgba(255,255,255," + this.newData.transparency + ")')", // show: true, // }); - + if (anchorSetDialogObject && anchorSetDialogObject.close) { anchorSetDialogObject.close() } @@ -513,6 +1121,440 @@ class GroundImage extends Base { } } + // let coordinateData = [] + // this.epsg_map.forEach((value, key) => { + // coordinateData.push({ + // name: `${value.name}(${value.epsg})`, + // value: key + // }) + // }) + // let coordinateDataLegpObject = legp( + // this._DialogObject._element.content.getElementsByClassName( + // 'coordinate-select-box' + // )[0], + // '.coordinate-select' + // ) + // if (coordinateDataLegpObject) { + // coordinateDataLegpObject.legp_search(coordinateData) + // let coordinateDataLegpElm = this._DialogObject._element.content + // .getElementsByClassName('coordinate-select')[0] + // .getElementsByTagName('input')[0] + // if (!this.coordinate) { + // this.coordinate = coordinateData[0].value + // } else { + // this.coordinate = this.coordinate + // } + // coordinateDataLegpElm.value = this.coordinate + // for (let i = 0; i < coordinateData.length; i++) { + // if (coordinateData[i].value === coordinateData.value) { + // coordinateDataLegpObject.legp_searchActive( + // coordinateData[i].value + // ) + // break + // } + // } + // coordinateDataLegpElm.addEventListener('input', () => { + // for (let i = 0; i < coordinateData.length; i++) { + // if (coordinateData[i].value === coordinateDataLegpElm.value) { + // this.coordinate = coordinateData[i].value + // break + // } + // } + // }) + // } + + let elms = contentElm.getElementsByClassName('row') + let elms2 = contentElm.getElementsByTagName('h4') + for (let i = 0; i < elms.length; i++) { + let mode = elms[i].getAttribute('mode') + if (mode !== null) { + if (mode == this.options.mode) { + elms[i].style.display = 'flex' + } + else { + elms[i].style.display = 'none' + } + } + } + for (let i = 0; i < elms2.length; i++) { + let mode = elms2[i].getAttribute('mode') + if (mode !== null) { + if (mode == this.options.mode) { + elms2[i].style.display = 'block' + } + else { + elms2[i].style.display = 'none' + } + } + } + + // let lng = contentElm.getElementsByClassName("lng")[0] + // let lat = contentElm.getElementsByClassName("lat")[0] + // let alt = contentElm.getElementsByClassName("alt")[0] + // lng.value = this.options.position.lng + // lat.value = this.options.position.lat + // alt.value = this.options.position.alt + // this._elms.lng = [lng] + // this._elms.lat = [lat] + // this._elms.alt = [alt] + // lng.addEventListener('blur', (e) => { + // let value = e.target.value + // if (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) + // } + // if ((e.target.min) && value < Number(e.target.min)) { + // value = Number(e.target.min) + // } + // if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { + // value = Number(e.target.dataset.min) + // } + // } + // // this.position = { + // // lng: value, + // // lat: this.position.lat, + // // alt: this.position.alt + // // } + // this.options.position.lng = value + // this.coordinate = this.options.coordinate + // }) + // lat.addEventListener('blur', (e) => { + // let value = e.target.value + // if (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) + // } + // if ((e.target.min) && value < Number(e.target.min)) { + // value = Number(e.target.min) + // } + // if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { + // value = Number(e.target.dataset.min) + // } + // } + // // this.position = { + // // lng: this.position.lng, + // // lat: value, + // // alt: this.position.alt + // // } + // this.options.position.lat = value + // this.coordinate = this.options.coordinate + // }) + // alt.addEventListener('blur', (e) => { + // let value = e.target.value + // if (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) + // } + // if ((e.target.min) && value < Number(e.target.min)) { + // value = Number(e.target.min) + // } + // if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { + // value = Number(e.target.dataset.min) + // } + // } + // // this.position = { + // // lng: this.position.lng, + // // lat: this.position.lat, + // // alt: value + // // } + // this.options.position.alt = value + // this.coordinate = this.options.coordinate + // }) + + let colorPicker = new YJColorPicker({ + el: contentElm.getElementsByClassName('labelColor')[0], + size: 'mini', //颜色box类型 + alpha: true, //是否开启透明度 + defaultColor: this.labelColor, + disabled: false, //是否禁止打开颜色选择器 + openPickerAni: 'opacity', //打开颜色选择器动画 + sure: color => { + this.labelColor = color + }, //点击确认按钮事件回调 + clear: () => { + this.labelColor = 'rgba(255,255,255,1)' + } //点击清空按钮事件回调 + }) + this._elms.labelColor = [colorPicker] + + setTimeout(async () => { + let flipeOverXBtn = this._DialogObject._element.foot.getElementsByClassName('flipe-over-x')[0] + let flipeOverYBtn = this._DialogObject._element.foot.getElementsByClassName('flipe-over-y')[0] + flipeOverXBtn.setAttribute('mode', 0) + flipeOverYBtn.setAttribute('mode', 0) + if (this.options.mode) { + flipeOverXBtn.style.display = 'none' + flipeOverYBtn.style.display = 'none' + } + else { + flipeOverXBtn.style.display = 'block' + flipeOverYBtn.style.display = 'block' + } + let modeData = [ + { + name: '贴地', + value: '贴地', + key: 0 + }, + { + name: '立体', + value: '立体', + key: 1 + } + ] + let modeDataLegpObject = legp( + this._DialogObject._element.content.getElementsByClassName( + 'mode-box' + )[0], + '.mode' + ) + if (modeDataLegpObject) { + modeDataLegpObject.legp_search(modeData) + let modeDataLegpElm = this._DialogObject._element.content + .getElementsByClassName('mode')[0] + .getElementsByTagName('input')[0] + modeDataLegpElm.value = this.mode + for (let i = 0; i < modeData.length; i++) { + if (modeData[i].key === this.mode) { + modeDataLegpElm.value = modeData[i].value + modeDataLegpObject.legp_searchActive(modeData[i].value) + break + } + } + modeDataLegpElm.addEventListener('input', () => { + for (let i = 0; i < modeData.length; i++) { + if (modeData[i].value === modeDataLegpElm.value) { + this.mode = modeData[i].key + break + } + } + }) + this._elms.mode = [modeDataLegpElm] + } + + + let heightBoxElm = this._DialogObject._element.content.getElementsByClassName('height-box')[0] + let heightElm = heightBoxElm.getElementsByClassName('height')[0] + let heightModeData = [ + { + name: '海拔高度', + value: '海拔高度', + key: '0' + }, + { + name: '相对地表', + value: '相对地表', + key: '1' + }, + { + name: '依附地表', + value: '依附地表', + key: '2' + }, + { + name: '依附模型', + value: '依附模型', + key: '3' + } + ] + let heightMode = this.heightMode + + switch (heightMode) { + case 0: + case '0': + heightElm.value = this.options.position.alt + break + case 1: + case '1': + if (this.sdk.viewer.scene.terrainProvider.availability) { + Cesium.sampleTerrainMostDetailed( + this.sdk.viewer.scene.terrainProvider, + [ + Cesium.Cartographic.fromDegrees( + this.options.position.lng, + this.options.position.lat + ) + ] + ).then(position => { + heightElm.value = Number( + (this.options.position.alt - Number(position[0].height.toFixed(2))).toFixed(2) + ) + }) + } else { + heightElm.value = Number(this.options.position.alt.toFixed(2)) + } + break + case 2: + case '2': + case 3: + case '3': + let objectsToExclude = [] + for (let [key, value] of this.sdk.entityMap) { + if (value.type === 'RadarScanStereoscopic' && value.entity) { + objectsToExclude.push(value.entity) + } + } + this.getClampToHeight(this.options.position, objectsToExclude).then(h => { + this.options.position.alt = Number(h.toFixed(2)) + this.coordinate = this.options.coordinate + this._elms.alt && + this._elms.alt.forEach(item => { + item.value = this.options.position.alt + }) + heightElm.value = this.options.position.alt + }) + break + } + let heightModeObject = legp( + this._DialogObject._element.content.getElementsByClassName( + 'height-mode-box' + )[0], + '.height-mode' + ) + if (heightModeObject) { + heightModeObject.legp_search(heightModeData) + let heightModeDataLegpElm = this._DialogObject._element.content + .getElementsByClassName('height-mode')[0] + .getElementsByTagName('input')[0] + heightModeDataLegpElm.value = heightModeData[this.heightMode].value + for (let i = 0; i < heightModeData.length; i++) { + if (heightModeData[i].value == heightModeDataLegpElm.value) { + heightModeObject.legp_searchActive(heightModeData[i].value) + break + } + } + heightModeDataLegpElm.addEventListener('input', () => { + for (let i = 0; i < heightModeData.length; i++) { + if (heightModeData[i].value === heightModeDataLegpElm.value) { + heightMode = heightModeData[i].key + switch (heightMode) { + case 0: + case '0': + this.options.position.alt = Number(heightElm.value) + this.heightMode = 0 + // this.position = this.options.position + break + case 1: + case '1': + if (this.sdk.viewer.scene.terrainProvider.availability) { + Cesium.sampleTerrainMostDetailed( + this.sdk.viewer.scene.terrainProvider, + [ + Cesium.Cartographic.fromDegrees( + this.options.position.lng, + this.options.position.lat + ) + ] + ).then(position => { + this.options.position.alt = + Number(heightElm.value) + + Number(position[0].height.toFixed(2)) + // this.position = this.options.position + }) + } else { + this.options.position.alt = Number(heightElm.value) + // this.position = this.options.position + } + this.heightMode = 1 + break + case 2: + case '2': + this.heightMode = 2 + break + case 3: + case '3': + let objectsToExclude = [] + for (let [key, value] of this.sdk.entityMap) { + if (value.type === 'RadarScanStereoscopic' && value.entity) { + objectsToExclude.push(value.entity) + } + } + this.getClampToHeight(this.options.position, objectsToExclude).then(h => { + this.options.position.alt = Number(h.toFixed(2)) + // this.position = this.options.position + }) + this.heightMode = 3 + break + } + this.position = this.options.position + break + } + } + }) + + heightElm.addEventListener('blur', async () => { + switch (heightMode) { + case 0: + case '0': + this.options.position.alt = Number( + Number(heightElm.value).toFixed(2) + ) + break + case 1: + case '1': + if (this.sdk.viewer.scene.terrainProvider.availability) { + let position = await Cesium.sampleTerrainMostDetailed( + this.sdk.viewer.scene.terrainProvider, + [ + Cesium.Cartographic.fromDegrees( + this.options.position.lng, + this.options.position.lat + ) + ] + ) + this.options.position.alt = + Number(heightElm.value) + + Number(position[0].height.toFixed(2)) + } else { + this.options.position.alt = Number(heightElm.value) + + } + break + case 2: + case '2': + break + } + this.position = this.options.position + }) + this._elms.height = heightBoxElm + this._elms.heightMode = heightModeDataLegpElm + + this.heightMode = this.heightMode + } + + let fontData = getFontList() + let fontObject = legp( + this._DialogObject._element.content.getElementsByClassName( + 'font-select-box' + )[0], + '.font-select' + ) + if (fontObject) { + fontObject.legp_search(fontData) + let fontDataLegpElm = this._DialogObject._element.content + .getElementsByClassName('font-select')[0] + .getElementsByTagName('input')[0] + fontDataLegpElm.value = fontData[this.labelFontFamily].value + for (let i = 0; i < fontData.length; i++) { + if (fontData[i].value == fontDataLegpElm.value) { + fontObject.legp_searchActive(fontData[i].value) + break + } + } + fontDataLegpElm.addEventListener('input', () => { + for (let i = 0; i < fontData.length; i++) { + if (fontData[i].value === fontDataLegpElm.value) { + this.labelFontFamily = fontData[i].key + break + } + } + }) + this._elms.labelFontFamily = [fontDataLegpElm] + } + }, 0); } else { if (this._DialogObject && this._DialogObject.remove) { @@ -610,12 +1652,7 @@ class GroundImage extends Base { position: { ...this.options.position } } } - else { - this.options.position.lng = this.previous.position.lng - this.options.position.lat = this.previous.position.lat - this.options.position.alt = this.previous.position.alt - } - + this.position = { ...this.previous.position } } } @@ -727,6 +1764,167 @@ class GroundImage extends Base { } } + async updateHeight() { + let height + let height2 + let point1 = new Cesium.Cartesian3.fromDegrees( + this.options.position.lng, + this.options.position.lat, + 0 + ) + let point2 = new Cesium.Cartesian3.fromDegrees( + this.options.position.lng, + this.options.position.lat, + 10000000000000 + ) + + let objectsToExclude = [] + for (let [key, value] of this.sdk.entityMap) { + if (value.type === 'RadarScanStereoscopic' && value.entity) { + objectsToExclude.push(value.entity) + } + } + let updatedCartesians = await this.sdk.viewer.scene.clampToHeightMostDetailed([point1], objectsToExclude) + if (updatedCartesians && updatedCartesians[0]) { + height = this.cartesian3Towgs84(updatedCartesians[0], this.sdk.viewer).alt + } + + let direction = Cesium.Cartesian3.subtract( + point1, + point2, + new Cesium.Cartesian3() + ) + let c = Cesium.Cartesian3.normalize(direction, new Cesium.Cartesian3()) + let ray = new Cesium.Ray(point2, c) + let r = {} + let pickedObjects = this.sdk.viewer.scene.drillPickFromRay(ray) + for (let i = pickedObjects.length - 1; i >= 0; i--) { + if (pickedObjects[i].position) { + r = pickedObjects[i] + break + } + } + if (r && r.position) { + height2 = this.cartesian3Towgs84(r.position, this.sdk.viewer).alt + } + let promise + try { + promise = await Cesium.sampleTerrainMostDetailed( + this.sdk.viewer.terrainProvider, + [ + Cesium.Cartographic.fromDegrees( + this.options.position.lng, + this.options.position.lat + ) + ] + ) + } catch (error) { } + + if ((height2 === void 0 || height2 < promise[0].height) && promise) { + height2 = promise[0].height + } + if (height === void 0 || height < height2) { + height = height2 + } + if (height !== undefined) { + this.options.position.alt = Number(Number(height).toFixed(2)) + this._elms.alt && + this._elms.alt.forEach(item => { + item.value = this.options.position.alt + }) + this.coordinate = this.options.coordinate + + if (this._elms.height) { + let heightElm = this._elms.height.getElementsByClassName('height')[0] + if (heightElm) { + switch (this._elms.heightMode.value) { + case '海拔高度': + heightElm.value = this.options.position.alt + break + case '相对地表': + if (this.sdk.viewer.scene.terrainProvider.availability) { + Cesium.sampleTerrainMostDetailed( + this.sdk.viewer.scene.terrainProvider, + [ + Cesium.Cartographic.fromDegrees( + this.options.position.lng, + this.options.position.lat + ) + ] + ).then(position => { + heightElm.value = Number( + (this.options.position.alt - position[0].height).toFixed(2) + ) + }) + } else { + heightElm.value = this.options.position.alt + } + break + case '依附地表': + break + case '依附模型': + heightElm.value = this.options.position.alt + break + } + } + } + } + + // if (!this.entity.values) { + // this.entity.position = Cesium.Cartesian3.fromDegrees( + // this.options.position.lng, + // this.options.position.lat, + // this.options.position.alt + // ) + // } + } + + renewPoint() { + if (!this.entity.values && this.entity.billboard) { + let font = getFontFamily(this.labelFontFamily) || 'Helvetica' + this.entity.billboard.scale = this.billboardScale + if (this.billboardScaleByDistance) { + this.entity.billboard.scaleByDistance = new Cesium.NearFarScalar( + this.billboardNear, + 1, + this.billboardFar, + 0 + ) + this.entity.billboard.pixelOffsetScaleByDistance = new Cesium.NearFarScalar( + this.billboardNear, + 1, + this.billboardFar, + 0 + ) + this.entity.label.scaleByDistance = new Cesium.NearFarScalar( + this.billboardNear, + 1, + this.billboardFar, + 0 + ) + this.entity.label.pixelOffsetScaleByDistance = new Cesium.NearFarScalar( + this.billboardNear, + 1, + this.billboardFar, + 0 + ) + } else { + this.entity.billboard.scaleByDistance = undefined + this.entity.billboard.pixelOffsetScaleByDistance = undefined + this.entity.label.scaleByDistance = undefined + this.entity.label.pixelOffsetScaleByDistance = undefined + } + this.entity.label.font = this.options.label.fontSize + 'px ' + font + this.entity.label.fillColor = Cesium.Color.fromCssColorString( + this.options.label.color + ) + let canvas = this.entity.billboard.image.getValue() + let billboardH = canvas.height * (128 / canvas.width) + this.entity.billboard.pixelOffset = { x: -128 * this.billboardScale * this.options.offset.x, y: -billboardH * this.billboardScale * this.options.offset.y } + // this.entity.billboard.pixelOffset = { x: -width * this.billboardScale * (this.flipeY ? (1 - this.options.offset.x) : this.options.offset.x), y: -height * this.billboardScale * (this.flipeX ? (1 - this.options.offset.y) : this.options.offset.y) } + } + } + reset() { if (!this.entity) { return From a6fb1af6f9e8560f6b25409e1045f043c5817ce6 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 13 Aug 2025 21:56:53 +0800 Subject: [PATCH 21/53] =?UTF-8?q?=E4=BA=8C=E4=B8=89=E7=BB=B4=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E6=98=BE=E7=A4=BA=E7=8A=B6=E6=80=81=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/PolygonObject/index.js | 1 - src/Obj/Base/PolyhedronObject/eventBinding.js | 2 +- src/Obj/Base/WallRealStereoscopic/eventBinding.js | 2 +- src/Obj/Base/WallStereoscopic/eventBinding.js | 2 +- src/Obj/Base/index.js | 11 ++++++++++- static/custom/css/index.css | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Obj/Base/PolygonObject/index.js b/src/Obj/Base/PolygonObject/index.js index dbaafdf..ca87983 100644 --- a/src/Obj/Base/PolygonObject/index.js +++ b/src/Obj/Base/PolygonObject/index.js @@ -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) diff --git a/src/Obj/Base/PolyhedronObject/eventBinding.js b/src/Obj/Base/PolyhedronObject/eventBinding.js index 6e7380d..87fa67f 100644 --- a/src/Obj/Base/PolyhedronObject/eventBinding.js +++ b/src/Obj/Base/PolyhedronObject/eventBinding.js @@ -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) diff --git a/src/Obj/Base/WallRealStereoscopic/eventBinding.js b/src/Obj/Base/WallRealStereoscopic/eventBinding.js index 60f6829..22136c8 100644 --- a/src/Obj/Base/WallRealStereoscopic/eventBinding.js +++ b/src/Obj/Base/WallRealStereoscopic/eventBinding.js @@ -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) diff --git a/src/Obj/Base/WallStereoscopic/eventBinding.js b/src/Obj/Base/WallStereoscopic/eventBinding.js index 52240e6..4a2f708 100644 --- a/src/Obj/Base/WallStereoscopic/eventBinding.js +++ b/src/Obj/Base/WallStereoscopic/eventBinding.js @@ -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) diff --git a/src/Obj/Base/index.js b/src/Obj/Base/index.js index 7439d37..3f16db4 100644 --- a/src/Obj/Base/index.js +++ b/src/Obj/Base/index.js @@ -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 diff --git a/static/custom/css/index.css b/static/custom/css/index.css index f7ce847..f78718f 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -3096,7 +3096,7 @@ /* 贴地图片 */ .YJ-custom-base-dialog.ground-image>.content { - width: 500px; + width: 560px; } /* 模型 */ From d7ecd6d865cd6cbf02891d16f7c75d14c7f3ab17 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Thu, 14 Aug 2025 00:15:55 +0800 Subject: [PATCH 22/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=8C=E4=B8=89?= =?UTF-8?q?=E7=BB=B4=E5=88=87=E6=8D=A2=E6=97=B6=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/GroundSvg/index.js | 5 ++++- src/Obj/Base/LabelObject/index.js | 2 +- src/Obj/Base/TrajectoryMotion/index.js | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Obj/Base/GroundSvg/index.js b/src/Obj/Base/GroundSvg/index.js index d94cce8..5f74f8d 100644 --- a/src/Obj/Base/GroundSvg/index.js +++ b/src/Obj/Base/GroundSvg/index.js @@ -1212,7 +1212,7 @@ class GroundSvg extends Base { * @param {boolean} status=false 状态 */ drag(status, cd) { - if (!this.#loaded) { + if (!this.#loaded || !this.sdk || !this.sdk.viewer) { return } this.ismove = false @@ -2020,6 +2020,9 @@ class GroundSvg extends Base { return } this.drag(false) + if(!this.sdk || !this.sdk.viewer) { + return + } this.sdk.viewer.entities.remove(this.entity) this.text && this.text.remove() for (let i = this.entity.values.length; i >= 0; i--) { diff --git a/src/Obj/Base/LabelObject/index.js b/src/Obj/Base/LabelObject/index.js index dfd9dc1..5b127cd 100644 --- a/src/Obj/Base/LabelObject/index.js +++ b/src/Obj/Base/LabelObject/index.js @@ -441,7 +441,7 @@ class LabelObject extends Base { clearTimeout(this.#updateBillboardImageTimeout) this.#updateBillboardImageTimeout = setTimeout(() => { clearTimeout(this.#updateBillboardImageTimeout) - this.entity.billboard.image = this.getcanvas() + this.entity && (this.entity.billboard.image = this.getcanvas()) }, 500) } get lineColor() { diff --git a/src/Obj/Base/TrajectoryMotion/index.js b/src/Obj/Base/TrajectoryMotion/index.js index f561a70..e02a63a 100644 --- a/src/Obj/Base/TrajectoryMotion/index.js +++ b/src/Obj/Base/TrajectoryMotion/index.js @@ -655,7 +655,7 @@ class TrajectoryMotion extends Base { }) this.TweenAnimate.pause() setTimeout(() => { - _this.model.isMove = false + _this.model && (_this.model.isMove = false) }, 200); } } @@ -1531,7 +1531,7 @@ class TrajectoryMotion extends Base { else { setPosition(startDistance) setTimeout(() => { - _this.model.isMove = false + _this.model && (_this.model.isMove = false) }, 500); From e022aa5ef190b7e656ed1ca82384935abe3a2497 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Thu, 14 Aug 2025 15:54:14 +0800 Subject: [PATCH 23/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B4=B4=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BF=AE=E6=94=B9=E6=96=87=E5=AD=97=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/GroundImage/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Obj/Base/GroundImage/index.js b/src/Obj/Base/GroundImage/index.js index 2544c4f..969ccc5 100644 --- a/src/Obj/Base/GroundImage/index.js +++ b/src/Obj/Base/GroundImage/index.js @@ -81,6 +81,16 @@ class GroundImage extends Base { this.create() } + get name() { + return this.options.name + } + + set name(v) { + super.name = v + this.options.label.text = this.options.name + this.entity && (this.entity.label.text = this.options.label.text) + } + get mode() { return this.options.mode } From 22f9693957cdfaf89e13299537783395ca1494a3 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Thu, 14 Aug 2025 15:55:52 +0800 Subject: [PATCH 24/53] =?UTF-8?q?=E4=BA=8C=E4=B8=89=E7=BB=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/MultiViewportMode/index.js | 6 +++++- src/Obj/Base/GroundSvg/index.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Global/MultiViewportMode/index.js b/src/Global/MultiViewportMode/index.js index f5531be..53ec9c0 100644 --- a/src/Global/MultiViewportMode/index.js +++ b/src/Global/MultiViewportMode/index.js @@ -231,7 +231,11 @@ async function syncData2(sdk, id, entityId) { if (obj.showView == 3) { options.show = false } - let target = await new obj.constructor(sdk2D, options) + let target = await sdk2D.entityMap.get(options.id) + if(target) { + await target.remove() + } + target = await new obj.constructor(sdk2D, options) target.onClick = obj.onClick target.onRightClick = obj.onRightClick target.onMouseMove = obj.onMouseMove diff --git a/src/Obj/Base/GroundSvg/index.js b/src/Obj/Base/GroundSvg/index.js index 5f74f8d..198aa89 100644 --- a/src/Obj/Base/GroundSvg/index.js +++ b/src/Obj/Base/GroundSvg/index.js @@ -1526,6 +1526,9 @@ class GroundSvg extends Base { controlPoints[9] = turf.destination(point, wh, 0 + angle, options).geometry.coordinates this.controlPoints = controlPoints + if(!this.sdk || !this.sdk.viewer) { + return + } for (let i = 0; i < this.controlPoints.length; i++) { let color = '#00ff0a' if (i === 5) { From 9f35d752c2ba55ab881342bf61613fa039e48591 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Thu, 14 Aug 2025 15:56:34 +0800 Subject: [PATCH 25/53] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=87=E5=BD=A2?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E7=BC=96=E8=BE=91=E6=97=B6=E6=A0=87=E6=B3=A8?= =?UTF-8?q?=E6=9C=AA=E8=B4=B4=E5=90=88=E5=AE=9E=E4=BD=93=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/SectorObject/index.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Obj/Base/SectorObject/index.js b/src/Obj/Base/SectorObject/index.js index 6d306bc..66e9c1e 100644 --- a/src/Obj/Base/SectorObject/index.js +++ b/src/Obj/Base/SectorObject/index.js @@ -293,7 +293,7 @@ class SectorObject extends Base { return this.options.line.width } set lineWidth(v) { - this.options.line.width = ((v || v === 0) ? v : 3) + this.options.line.width = ((v || v === 0) ? v : 3) this.entity.polyline.width = this.options.line.width this._elms.lineWidth && this._elms.lineWidth.forEach((item) => { item.value = this.options.line.width @@ -1560,7 +1560,7 @@ class SectorObject extends Base { _addRr() { if (this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value) { this.options.attribute.vr.content.push({ - name: '全景图' , + name: '全景图', url: this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value }) this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value = '' @@ -1573,7 +1573,7 @@ class SectorObject extends Base { addAttributeRr(vr) { this.options.attribute.vr.content.push({ - name: '全景图' , + name: '全景图', url: vr }) this.attributeVr = this.options.attribute.vr.content @@ -1922,6 +1922,19 @@ class SectorObject extends Base { that.cartesian3Towgs84(positions[1], that.sdk.viewer), that.cartesian3Towgs84(positions[positions.length - 4], that.sdk.viewer) ] + let objectsToExclude = [...that.sdk.viewer.entities.values] + that + .getClampToHeight({ + lng: that.options.center.lng, + lat: that.options.center.lat + }, objectsToExclude) + .then(height => { + that.label.position = [ + that.options.center.lng, + that.options.center.lat, + height + ] + }) setTimeout(() => { createNodePoints(positions[1], 'sector-start') createNodePoints(positions[positions.length - 4], 'sector-end') From eec0ca44c00211a40860a1cd9d17191916a9c508 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 10:00:38 +0800 Subject: [PATCH 26/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=9B=86=E7=BB=93?= =?UTF-8?q?=E5=9C=B0=E7=82=B9=E4=BD=8D=E7=BB=8F=E5=BA=A6=E8=B6=8A=E8=BF=87?= =?UTF-8?q?180=C2=B0=E6=97=B6=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Draw/drawAssemble.js | 3 +++ src/Tools/index.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Draw/drawAssemble.js b/src/Draw/drawAssemble.js index 8f1a321..6cc8605 100644 --- a/src/Draw/drawAssemble.js +++ b/src/Draw/drawAssemble.js @@ -124,6 +124,9 @@ class DrawAssemble extends Draw { if (this.points_ids.length === 1) { let pnts = new Array(); this.positions.forEach((item) => { + if(item.lng<=0) { + item.lng += 360 + } pnts.push([item.lng, item.lat]); }); diff --git a/src/Tools/index.js b/src/Tools/index.js index 0674a47..1156611 100644 --- a/src/Tools/index.js +++ b/src/Tools/index.js @@ -503,6 +503,9 @@ class Tools { let points = positions.length; let pnts = new Array(); positions.forEach((item) => { + if(item.lng<=0) { + item.lng += 360 + } pnts.push([item.lng, item.lat]); }); //console.log("pnts6666",pnts); From 08bdd515a9433ccd07addfa38608875c87a07e92 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 10:16:05 +0800 Subject: [PATCH 27/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=9B=86=E7=BB=93?= =?UTF-8?q?=E5=9C=B0=E7=82=B9=E4=BD=8D=E7=BB=8F=E5=BA=A6=E8=B6=8A=E8=BF=87?= =?UTF-8?q?180=C2=B0=E6=97=B6=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Draw/drawAssemble.js | 2 +- src/Tools/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Draw/drawAssemble.js b/src/Draw/drawAssemble.js index 6cc8605..6c7a9f8 100644 --- a/src/Draw/drawAssemble.js +++ b/src/Draw/drawAssemble.js @@ -124,7 +124,7 @@ class DrawAssemble extends Draw { if (this.points_ids.length === 1) { let pnts = new Array(); this.positions.forEach((item) => { - if(item.lng<=0) { + if(item.lng<-90) { item.lng += 360 } pnts.push([item.lng, item.lat]); diff --git a/src/Tools/index.js b/src/Tools/index.js index 1156611..1e75b1c 100644 --- a/src/Tools/index.js +++ b/src/Tools/index.js @@ -503,7 +503,7 @@ class Tools { let points = positions.length; let pnts = new Array(); positions.forEach((item) => { - if(item.lng<=0) { + if(item.lng<-90) { item.lng += 360 } pnts.push([item.lng, item.lat]); From 7be9a6a41da6058d042c48f6c39fe7dc50c86169 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 16:18:27 +0800 Subject: [PATCH 28/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=8C=E4=B8=89?= =?UTF-8?q?=E7=BB=B4=E6=A8=A1=E5=BC=8F=E4=B8=8BMouseCoordinate=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/MouseCoordinate/index.js | 83 +++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 11 deletions(-) diff --git a/src/Global/MouseCoordinate/index.js b/src/Global/MouseCoordinate/index.js index 0189c67..147f96a 100644 --- a/src/Global/MouseCoordinate/index.js +++ b/src/Global/MouseCoordinate/index.js @@ -4,18 +4,38 @@ import Tools from "../../Tools"; import { getCoordinateSystem } from "../../Global/global"; import MouseEvent from '../../Event/index' +import { getSdk as get2DSdk } from '../../Global/MultiViewportMode' +import { getSdk as getSplitScreenSdk } from "../../Global/SplitScreen"; let event +let event2 let MouseCoordinateElm let requestAnimationFrameEventId +let tmovement +let targetSdk +let sdkD const MouseCoordinate = (sdk, status) => { + if (!sdk || !sdk.viewer) { + return + } + targetSdk = sdk + sdkD = get2DSdk().sdkD + if(!sdkD) { + sdkD = getSplitScreenSdk().sdkD + } + let tools = new Tools(sdk) if (status) { if (event) { event.destroy() } + if (event2) { + event2.destroy() + event2 = undefined + } event = new MouseEvent(sdk) + tmovement = null let position = { x: '', y: '', @@ -40,22 +60,60 @@ const MouseCoordinate = (sdk, status) => { contentElm.style['background-size'] = `200% 200%`; MouseCoordinateElm = contentElm } - sdk.viewer._element.appendChild(contentElm) - let tmovement + sdk.viewer.container.appendChild(contentElm) + event.mouse_move((movement, cartesian) => { - tmovement = { ...movement } + targetSdk = sdk + tmovement = { ...movement.endPosition } }) const getPosition = () => { - if(!tmovement) { + if (!targetSdk) { return } let canvas = sdk.viewer._element.getElementsByTagName('canvas')[0] - let left = tmovement.endPosition.x; - let top = tmovement.endPosition.y; - let cartesian = event.getcartesian(tmovement) - contentElm.style['background-position-x'] = `${-canvas.width + left + 4}px`; - contentElm.style['background-position-y'] = `${-canvas.height + top - 2}px`; + sdkD = get2DSdk().sdkD + if(!sdkD) { + sdkD = getSplitScreenSdk().sdkD + } + if (!event2 && sdkD) { + event2 = new MouseEvent(sdkD) + event2.mouse_move((movement, cartesian) => { + targetSdk = sdkD + tmovement = { x: movement.endPosition.x, y: movement.endPosition.y } + }) + } + if (!tmovement) { + return + } + let left = tmovement.x; + let top = tmovement.y; + let cartesian + if (targetSdk.viewer.scene.mode === 2) { + left = left + canvas.width + cartesian = targetSdk.viewer.camera.pickEllipsoid(tmovement, targetSdk.viewer.scene.globe.ellipsoid) + } + else { + cartesian = targetSdk.viewer.scene.pickPosition(tmovement) + if (!cartesian) { + const ray = targetSdk.viewer.camera.getPickRay(position); //相交的射线 + let pickedObjects = targetSdk.viewer.scene.drillPickFromRay(ray, 10); + let result = {} + for (let i = 0; i < pickedObjects.length; i++) { + if (pickedObjects[i].position) { + result = pickedObjects[i] + break + } + } + cartesian = result.position + if (!cartesian) { + cartesian = targetSdk.viewer.scene.globe.pick(ray, targetSdk.viewer.scene); + } + } + } + contentElm.style['background-position-x'] = `${-sdk.viewer.container.clientWidth + left + 4}px`; + + contentElm.style['background-position-y'] = `${-sdk.viewer.container.clientHeight + top - 2}px`; // this.entity.position = cartesian if (cartesian) { let degrees = tools.cartesian3Towgs84(cartesian, sdk.viewer) @@ -97,10 +155,13 @@ const MouseCoordinate = (sdk, status) => { else { if (event) { event.destroy() - event = undefined + } + if (event2) { + event2.destroy() + event2 = undefined } if (MouseCoordinateElm) { - sdk.viewer._element.removeChild(MouseCoordinateElm) + sdk.viewer.container.removeChild(MouseCoordinateElm) MouseCoordinateElm = undefined } if (requestAnimationFrameEventId) { From 6729b6080675bb2ba9e907def2d03c0a5e001e45 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 16:19:03 +0800 Subject: [PATCH 29/53] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B4=B4=E5=9C=B0svg?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=82=B9=E9=A2=9C=E8=89=B2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/GroundSvg/index.js | 78 ++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/src/Obj/Base/GroundSvg/index.js b/src/Obj/Base/GroundSvg/index.js index 198aa89..5a1e306 100644 --- a/src/Obj/Base/GroundSvg/index.js +++ b/src/Obj/Base/GroundSvg/index.js @@ -1279,6 +1279,9 @@ class GroundSvg extends Base { // 中心点到鼠标的距离 let distance = turf.rhumbDistance(pointC, point2, options); + let flag = false + let flag2 = false + switch (this.pickPoint.id) { case 'svg-control-points_0': angle = bearing2_0 - bearing1 @@ -1290,12 +1293,39 @@ class GroundSvg extends Base { bearingH = (((turf.rhumbBearing(pointC, turf.point(controlPoints[2])) + 360) - this.angle) % 360) angleW = bearing2 - bearingW angleH = bearing2 - bearingH - if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { angleW = angleW + 180 + flag=true } if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { angleH = angleH + 180 + flag2=true + } + if(flag && flag2) { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000') + } + else { + if(flag) { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') + } + else if(flag2) { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') + } + else { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') + } } radiansW = (Math.PI / 180) * angleW @@ -1314,6 +1344,12 @@ class GroundSvg extends Base { if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { angleH = angleH + 180 + this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#ff0000') + } + else { + this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#ff0000') + this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#00ff0a') } radiansH = (Math.PI / 180) * angleH @@ -1331,9 +1367,37 @@ class GroundSvg extends Base { if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { angleW = angleW + 180 + flag=true } if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { angleH = angleH + 180 + flag2=true + } + if(flag && flag2) { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') + } + else { + if(flag) { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') + } + else if(flag2) { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000') + } + else { + this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000') + this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') + } } radiansW = (Math.PI / 180) * angleW @@ -1351,6 +1415,12 @@ class GroundSvg extends Base { if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { angleW = angleW + 180 + this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000') + } + else { + this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000') } radiansW = (Math.PI / 180) * angleW @@ -1381,6 +1451,12 @@ class GroundSvg extends Base { if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { angleW = angleW + 180 + this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000') + } + else { + this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a') + this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000') } radiansW = (Math.PI / 180) * angleW From d1bcba6a1356863773b11dd151cb5dd7ea185425 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 16:29:18 +0800 Subject: [PATCH 30/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E7=AE=AD=E5=A4=B4=E9=9D=A2=E6=97=B6=E8=BF=9E=E7=BB=AD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=90=8C=E6=A0=B7=E7=9A=84=E5=9D=90=E6=A0=87=E6=97=B6?= =?UTF-8?q?=E9=9D=A2=E5=9D=90=E6=A0=87=E8=AE=A1=E7=AE=97=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Draw/drawAttackArrow.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Draw/drawAttackArrow.js b/src/Draw/drawAttackArrow.js index 0cd20a4..c9208e2 100644 --- a/src/Draw/drawAttackArrow.js +++ b/src/Draw/drawAttackArrow.js @@ -59,12 +59,17 @@ export default class DrawAttackArrow extends Draw { return } into = '3D' + let pos84 = this.cartesian3Towgs84(cartesian, this.viewer) + let lastPos84 = cache_positions[cache_positions.length - 1] + if(lastPos84 && (lastPos84.lng === pos84.lng && lastPos84.lat === pos84.lat)) { + return + } if (!this.entityHasCreated) { let polyline_id = DrawAttackArrow.create_arrow_polygon(this) this.points_ids.push(polyline_id) } this.points_ids.push(this.create_point(cartesian)) - cache_positions.push(this.cartesian3Towgs84(cartesian, this.viewer)) + cache_positions.push(pos84) isMove = false }) this.event.mouse_right((movement, cartesian) => { From 2e301cd0fcac672d27ff42968a69f88b6dc173da Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 16:48:36 +0800 Subject: [PATCH 31/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E7=AE=AD=E5=A4=B4=E9=9D=A2=E6=97=B6=E8=BF=9E=E7=BB=AD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=90=8C=E6=A0=B7=E7=9A=84=E5=9D=90=E6=A0=87=E6=97=B6?= =?UTF-8?q?=E9=9D=A2=E5=9D=90=E6=A0=87=E8=AE=A1=E7=AE=97=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/mouseRightMenu/index.js | 16 +++++++------- src/Obj/Base/BillboardObject/index.js | 30 +++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Global/mouseRightMenu/index.js b/src/Global/mouseRightMenu/index.js index 891623f..818271b 100644 --- a/src/Global/mouseRightMenu/index.js +++ b/src/Global/mouseRightMenu/index.js @@ -100,14 +100,14 @@ function MouseRightMenu(sdk, status, callBack) { that = sdk.entityMap.get(entityId) } - // if (that && that.picking) { - // addedMenu = ` - // - //
    - //
  • 属性
  • - //
- // ` - // } + if (that && that.picking) { + addedMenu = ` + +
    +
  • 属性
  • +
+ ` + } let position = tools.cartesian3Towgs84(cartesian, sdk.viewer) menuElm = document.createElement('div') menuElm.id = 'custom-menu' diff --git a/src/Obj/Base/BillboardObject/index.js b/src/Obj/Base/BillboardObject/index.js index 3bd6bfc..efcbfe7 100644 --- a/src/Obj/Base/BillboardObject/index.js +++ b/src/Obj/Base/BillboardObject/index.js @@ -433,11 +433,11 @@ class BillboardObject extends Base { value: '链接', key: 'link' }, - // { - // name: 'IP摄像头', - // value: 'IP摄像头', - // key: 'camera' - // }, + { + name: 'IP摄像头', + value: 'IP摄像头', + key: 'camera' + }, // { // name: 'ISC摄像头', // value: 'ISC摄像头', @@ -448,16 +448,16 @@ class BillboardObject extends Base { // value: '传感器', // key: 'sensor' // }, - // { - // name: '全景图', - // value: '全景图', - // key: 'vr' - // }, - // { - // name: '物资', - // value: '物资', - // key: 'goods' - // } + { + name: '全景图', + value: '全景图', + key: 'vr' + }, + { + name: '物资', + value: '物资', + key: 'goods' + } ] } From 04ccdc73ca63e99800705cbe4851bbde71d58b87 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 16:58:15 +0800 Subject: [PATCH 32/53] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=B9=B0=E7=9C=BC?= =?UTF-8?q?=E5=9B=BE=E8=8C=83=E5=9B=B4=E6=98=BE=E7=A4=BA=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Global/MapX/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Global/MapX/index.js b/src/Global/MapX/index.js index a96b34f..d16f0cd 100644 --- a/src/Global/MapX/index.js +++ b/src/Global/MapX/index.js @@ -124,7 +124,7 @@ function syncViewer() { if (height > 9000000) { height = 9000000 } - if (height < 100000) { + if (height < 400000) { this.entity.billboard.show = true this.entity.rectangle.show = false } From 23420762ca074c6bd747f5e4aa3d339d142a135f Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 15 Aug 2025 17:18:17 +0800 Subject: [PATCH 33/53] =?UTF-8?q?=E5=9B=9E=E6=92=A4-=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E9=9B=86=E7=BB=93=E5=9C=B0=E7=82=B9=E4=BD=8D=E7=BB=8F=E5=BA=A6?= =?UTF-8?q?=E8=B6=8A=E8=BF=87180=C2=B0=E6=97=B6=E8=AE=A1=E7=AE=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Draw/drawAssemble.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Draw/drawAssemble.js b/src/Draw/drawAssemble.js index 6c7a9f8..8f1a321 100644 --- a/src/Draw/drawAssemble.js +++ b/src/Draw/drawAssemble.js @@ -124,9 +124,6 @@ class DrawAssemble extends Draw { if (this.points_ids.length === 1) { let pnts = new Array(); this.positions.forEach((item) => { - if(item.lng<-90) { - item.lng += 360 - } pnts.push([item.lng, item.lat]); }); From a9594ccec27007dbfd856df09f16cc3253ff1b89 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Mon, 18 Aug 2025 13:42:26 +0800 Subject: [PATCH 34/53] =?UTF-8?q?=E5=9B=9E=E6=92=A4-=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E9=9B=86=E7=BB=93=E5=9C=B0=E7=82=B9=E4=BD=8D=E7=BB=8F=E5=BA=A6?= =?UTF-8?q?=E8=B6=8A=E8=BF=87180=C2=B0=E6=97=B6=E8=AE=A1=E7=AE=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tools/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Tools/index.js b/src/Tools/index.js index 1e75b1c..0674a47 100644 --- a/src/Tools/index.js +++ b/src/Tools/index.js @@ -503,9 +503,6 @@ class Tools { let points = positions.length; let pnts = new Array(); positions.forEach((item) => { - if(item.lng<-90) { - item.lng += 360 - } pnts.push([item.lng, item.lat]); }); //console.log("pnts6666",pnts); From 1936a142b1ae308772a134a823466bad3f50fd15 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Tue, 19 Aug 2025 10:56:01 +0800 Subject: [PATCH 35/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3scale=E5=A4=AA=E5=B0=8F?= =?UTF-8?q?=E6=97=B6flyto=E9=AB=98=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/GroundSvg/index.js | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/Obj/Base/GroundSvg/index.js b/src/Obj/Base/GroundSvg/index.js index 5a1e306..3f1200c 100644 --- a/src/Obj/Base/GroundSvg/index.js +++ b/src/Obj/Base/GroundSvg/index.js @@ -10,6 +10,7 @@ import { FontLoader } from '../../../../static/3rdparty/three/jsm/loaders/FontLo import { TextGeometry } from '../../../../static/3rdparty/three/jsm/geometries/TextGeometry.js'; import * as variable from '../../../../static/3rdparty/three/fonts/FZZongYi-M05S_regular.typeface.json' import Base from "../index"; +import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' class GroundSvg extends Base { @@ -2171,6 +2172,59 @@ class GroundSvg extends Base { } this._update() } + + async flyTo(options = {}) { + if (this._error) { + return + } + setActiveViewer(0) + closeRotateAround(this.sdk) + closeViewFollow(this.sdk) + + if (this.options.customView && this.options.customView.relativePosition && this.options.customView.orientation) { + let orientation = { + heading: Cesium.Math.toRadians(this.options.customView.orientation.heading || 0.0), + pitch: Cesium.Math.toRadians(this.options.customView.orientation.pitch || -60.0), + roll: Cesium.Math.toRadians(this.options.customView.orientation.roll || 0.0) + } + + let lng = this.options.customView.relativePosition.lng + let lat = this.options.customView.relativePosition.lat + let alt = this.options.customView.relativePosition.alt + let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt) + + let position = { ...this.options.position } + // 如果没有高度值,则获取紧贴高度计算 + if (!position.hasOwnProperty('alt')) { + position.alt = await this.getClampToHeight(position) + } + lng = this.options.customView.relativePosition.lng + position.lng + lat = this.options.customView.relativePosition.lat + position.lat + alt = this.options.customView.relativePosition.alt + position.alt + destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt) + this.sdk.viewer.camera.flyTo({ + destination: destination, + orientation: orientation + }) + } + else { + let array = [] + for (let i = 0; i < this.controlPoints.length; i++) { + let height = await this.getClampToHeight({lng: this.controlPoints[i][0], lat: this.controlPoints[i][1]}) + let cartesian = Cesium.Cartesian3.fromDegrees(this.controlPoints[i][0], this.controlPoints[i][1], height) + array.push(cartesian.x, cartesian.y, cartesian.z) + } + let BoundingSphere = Cesium.BoundingSphere.fromVertices(array) + + this.sdk.viewer.camera.flyToBoundingSphere(BoundingSphere, { + offset: options.orientation || { + heading: Cesium.Math.toRadians(0.0), + pitch: Cesium.Math.toRadians(-60.0), + roll: Cesium.Math.toRadians(0.0) + } + }) + } + } } export default GroundSvg \ No newline at end of file From 9ecb3c72692356dd1e02095b6419c5b95a58b6dd Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Tue, 19 Aug 2025 10:56:10 +0800 Subject: [PATCH 36/53] =?UTF-8?q?=E9=99=90=E5=88=B6=E6=96=87=E5=AD=97?= =?UTF-8?q?=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/GroundSvg/_element.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Obj/Base/GroundSvg/_element.js b/src/Obj/Base/GroundSvg/_element.js index 1f16498..1766d91 100644 --- a/src/Obj/Base/GroundSvg/_element.js +++ b/src/Obj/Base/GroundSvg/_element.js @@ -54,7 +54,7 @@ function html(that) {
文字内容 - +
+
+
+
+ 油耗 +
+ + L/100km + +
+
+
+ 总油耗 + +
+
+
+ ` } diff --git a/src/Obj/Base/TrajectoryMotion/index.js b/src/Obj/Base/TrajectoryMotion/index.js index 56a8c6e..7e5af05 100644 --- a/src/Obj/Base/TrajectoryMotion/index.js +++ b/src/Obj/Base/TrajectoryMotion/index.js @@ -78,6 +78,7 @@ class TrajectoryMotion extends Base { this.options.line.smooth = options.line.smooth ? options.line.smooth : false this.options.line.noseToTail = options.line.noseToTail ? options.line.noseToTail : false this.positions_smooth = [] + this.options.unitFuelConsumption = options.unitFuelConsumption || 0 this.options.ground = options.ground || false this.options.state = (options.state || options.state === false) ? options.state : true this.options.routeDirection = (options.routeDirection || options.routeDirection === false) ? options.routeDirection : true @@ -180,6 +181,7 @@ class TrajectoryMotion extends Base { this.realTimeLine && (this.realTimeLine.show = (!this.showView || this.showView == 3) ? true : false) } this.label && (this.label.show = (!this.showView || this.showView == 3) ? this.options.label.show : false) + this.fuelLabel && (this.fuelLabel.show = (!this.showView || this.showView == 3) ? this.options.fuelShow : false) } else { this.model.show = (!this.showView || this.showView == 3) ? this.options.show : false @@ -202,6 +204,7 @@ class TrajectoryMotion extends Base { this.keyPoints[i].show = (!this.showView || this.showView == 3) ? show : false } this.label && (this.label.show = false) + this.fuelLabel && (this.fuelLabel.show = false) this.viewFollow = false } @@ -256,14 +259,17 @@ class TrajectoryMotion extends Base { // Cesium.Matrix4.multiplyByTranslation(this.model.modelMatrix, new Cesium.Cartesian3(0, 0, -difference), this.model.modelMatrix) // Cesium.Matrix4.getTranslation(this.model.modelMatrix, this.model.position) this.label && (this.label.show = this.label.show) + this.fuelLabel && (this.fuelLabel.show = this.fuelLabel.show) if (this.options.label.position) { setTimeout(() => { if (this.options.label.position.alt) { this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) + this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) } else { this.getClampToHeight({ lng: this.options.label.position.lng, lat: this.options.label.position.lat }).then((height) => { this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, height]) + this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, height]) }) } }, 0) @@ -1163,18 +1169,21 @@ class TrajectoryMotion extends Base { show = false } if (this.show) { - this.label && (this.label.show = show) - if (this.options.label.position) { - setTimeout(() => { - if (this.options.label.position.alt) { - this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) - } - else { - this.getClampToHeight({ lng: this.options.label.position.lng, lat: this.options.label.position.lat }).then((height) => { - this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, height]) - }) - } - }, 0); + if (this.label) { + this.label.show = show + this.label.pixelOffset = this.options.label.pixelOffset + (this.fuelShow ? this.labelFontSize + 20 : 0) + if (this.options.label.position) { + setTimeout(() => { + if (this.options.label.position.alt) { + this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) + } + else { + this.getClampToHeight({ lng: this.options.label.position.lng, lat: this.options.label.position.lat }).then((height) => { + this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, height]) + }) + } + }, 0); + } } } else { @@ -1192,6 +1201,7 @@ class TrajectoryMotion extends Base { set labelFontFamily(v) { this.options.label.fontFamily = v || 0 this.label && (this.label.fontFamily = this.options.label.fontFamily) + this.fuelLabel && (this.fuelLabel.fontFamily = this.options.label.fontFamily) let name = getFontFamilyName(this.labelFontFamily) || '' this._elms.labelFontFamily && @@ -1206,6 +1216,7 @@ class TrajectoryMotion extends Base { set labelColor(v) { this.options.label.color = v this.label && (this.label.color = v) + this.fuelLabel && (this.fuelLabel.color = v) if (this._elms.labelColor) { this._elms.labelColor.forEach((item, i) => { let labelColorPicker = new YJColorPicker({ @@ -1233,6 +1244,13 @@ class TrajectoryMotion extends Base { set labelFontSize(v) { this.options.label.fontSize = v this.label && (this.label.fontSize = v) + if (this.fuelLabel) { + this.fuelLabel.fontSize = v + this.label.pixelOffset = this.options.label.pixelOffset + v + 20 + } + else { + this.label.pixelOffset = this.options.label.pixelOffset + } this._elms.labelFontSize && this._elms.labelFontSize.forEach((item) => { item.value = v }) @@ -1244,6 +1262,7 @@ class TrajectoryMotion extends Base { set labelScaleByDistance(v) { this.options.label.scaleByDistance = v this.label && (this.label.scaleByDistance = v) + this.fuelLabel && (this.fuelLabel.scaleByDistance = v) this._elms.labelScaleByDistance && this._elms.labelScaleByDistance.forEach((item) => { item.checked = v }) @@ -1259,6 +1278,7 @@ class TrajectoryMotion extends Base { } this.options.label.near = near this.label && (this.label.near = near) + this.fuelLabel && (this.fuelLabel.near = near) this._elms.labelNear && this._elms.labelNear.forEach((item) => { item.value = near }) @@ -1274,11 +1294,66 @@ class TrajectoryMotion extends Base { } this.options.label.far = far this.label && (this.label.far = far) + this.fuelLabel && (this.fuelLabel.far = far) this._elms.labelFar && this._elms.labelFar.forEach((item) => { item.value = far }) } + get unitFuelConsumption() { + return this.options.unitFuelConsumption + } + + set unitFuelConsumption(v) { + this.options.unitFuelConsumption = v + this._elms.unitFuelConsumption && this._elms.unitFuelConsumption.forEach((item) => { + item.value = v + }) + } + + get fuelShow() { + return this.options.fuelShow + } + + set fuelShow(v) { + this.options.fuelShow = v + let show = v + if (this.show && (!this.showView || this.showView == 3)) { + show = v + } + else { + show = false + } + if (this.show) { + if (this.fuelLabel) { + this.fuelLabel.show = show + this.label.pixelOffset = this.options.label.pixelOffset + (show ? this.labelFontSize + 20 : 0) + } + else { + this.label.pixelOffset = this.options.label.pixelOffset + } + if (this.options.label.position) { + setTimeout(() => { + if (this.options.label.position.alt) { + this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) + } + else { + this.getClampToHeight({ lng: this.options.label.position.lng, lat: this.options.label.position.lat }).then((height) => { + this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, height]) + }) + } + }, 0); + } + } + else { + this.fuelLabel && (this.fuelLabel.show = false) + this.label.pixelOffset = this.options.label.pixelOffset + } + this._elms.fuelShow && this._elms.fuelShow.forEach((item) => { + item.checked = v + }) + } + // 创建路径 static addLine(that) { let positions_smooth = that.renewLinePositions(that.options.line.positions) @@ -1397,6 +1472,7 @@ class TrajectoryMotion extends Base { } let pos = that.smooth ? that.positions_smooth : Cesium.Cartesian3.fromDegreesArrayHeights(fromDegreesArrayHeights) TrajectoryMotion.createLabel(that) + TrajectoryMotion.createFuelLabel(that) that.modelMove(pos) @@ -1406,13 +1482,13 @@ class TrajectoryMotion extends Base { static async createLabel(that) { let labelPosition = that.cartesian3Towgs84(that.model.position, that.sdk.viewer) that.label = new LabelObject(that.sdk, { - show: that.options.show ? (that.options.model.show ? that.options.label.show : false) : false, + show: that.options.show ? (that.options.label.show ? true : false) : false, position: [labelPosition.lng, labelPosition.lat, labelPosition.alt], text: that.options.name, fontSize: that.options.label.fontSize, fontFamily: that.options.label.fontFamily, color: that.options.label.color, - pixelOffset: that.options.label.pixelOffset, + pixelOffset: that.options.label.pixelOffset + (that.options.fuelShow ? that.options.label.fontSize + 20 : 0), backgroundColor: that.options.label.backgroundColor, lineColor: that.options.label.lineColor, lineWidth: that.options.label.lineWidth, @@ -1422,6 +1498,26 @@ class TrajectoryMotion extends Base { }, that.model) } + static async createFuelLabel(that) { + let labelPosition = that.cartesian3Towgs84(that.model.position, that.sdk.viewer) + that.fuelLabel = new LabelObject(that.sdk, { + show: that.options.show ? (that.options.fuelShow ? true : false) : false, + // show: true, + position: [labelPosition.lng, labelPosition.lat, labelPosition.alt], + text: '总油耗:', + fontSize: that.options.label.fontSize, + fontFamily: that.options.label.fontFamily, + color: that.options.label.color, + pixelOffset: 0, + backgroundColor: ['#6e6e6e', '#6e6e6e'], + lineColor: '#00ffff00', + lineWidth: 0, + scaleByDistance: that.options.label.scaleByDistance, + near: that.options.label.near, + far: that.options.label.far + }, that.model) + } + // 创建关键点 static async addKeyPoint(that) { for (let i = 0; i < that.options.line.positions.length; i++) { @@ -1527,7 +1623,7 @@ class TrajectoryMotion extends Base { setPosition(startDistance) setTimeout(() => { _this.model.isMove = false - }, 500); + }, 1000); animateUpdate() @@ -1550,6 +1646,8 @@ class TrajectoryMotion extends Base { } async function setPosition(distance) { + _this.totalFuelConsumption = Number((distance / 100 * _this.unitFuelConsumption).toFixed(2)) + _this.fuelLabel.text = '总油耗:' + _this.totalFuelConsumption + ' L' _this.model.isMove = true let sdk2D = get2DView() let splitSdk = getSdk() @@ -1761,6 +1859,7 @@ class TrajectoryMotion extends Base { } let labelPosition = _this.cartesian3Towgs84(position, _this.sdk.viewer) _this.label.position = [labelPosition.lng, labelPosition.lat, labelPosition.alt] + _this.fuelLabel.position = [labelPosition.lng, labelPosition.lat, labelPosition.alt] lastDistance = distance // console.log(position) _this.realTimeRouteArray.push(position) @@ -2157,6 +2256,7 @@ class TrajectoryMotion extends Base { this.sdk.viewer.entities.remove(this.line) this.sdk.viewer.entities.remove(this.realTimeLine) this.label && this.label.remove() + this.fuelLabel && this.fuelLabel.remove() for (let i = 0; i < this.keyPointShow.length; i++) { this.sdk.viewer.entities.remove(this.keyPointShow[i]) } @@ -2164,6 +2264,7 @@ class TrajectoryMotion extends Base { this.realTimeLine = null this.model = null this.label = null + this.fuelLabel = null if (this._DialogObject && !this._DialogObject.isDestroy) { this._DialogObject.close() this._DialogObject = null @@ -2217,6 +2318,7 @@ class TrajectoryMotion extends Base { this.model && (this.model.show = false) } this.labelShow = this.originalOptions.label.show + this.fuelLabelShow = this.originalOptions.fuelShow this.labelColor = this.originalOptions.label.color this.labelFontSize = this.originalOptions.label.fontSize this.labelFontFamily = this.originalOptions.label.fontFamily diff --git a/static/custom/css/index.css b/static/custom/css/index.css index f7ce847..f5d1ff7 100644 --- a/static/custom/css/index.css +++ b/static/custom/css/index.css @@ -1429,6 +1429,24 @@ margin-bottom: 10px; display: flex; position: relative; + overflow-y: auto; +} + +.DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar { + width: 4px; + height: 4px; +} + +.DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-thumb { + border-radius: 5px; + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + background-color: rgba(var(--color-sdk-base-rgb)); +} + +.DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + border-radius: 5px; + background-color: rgba(var(--color-sdk-base-rgb), 0.1); } .DIV-cy-tabs .DIV-cy-tab-top::after { @@ -1473,7 +1491,14 @@ border-bottom: 2px solid #dddddd00; position: relative; z-index: 2; + white-space: nowrap; + user-select: none; cursor: pointer; + -webkit-pointer-events: auto; + -moz-pointer-events: auto; + -ms-pointer-events: auto; + -o-pointer-events: auto; + pointer-events: auto; } .DIV-cy-tabs .DIV-cy-tab-pane-title-p span { @@ -3550,22 +3575,35 @@ border: 1.5px solid; border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; color: #fff; + min-width: 200px; + min-height: 120px; + box-sizing: border-box; + /* -webkit-pointer-events: none; + -moz-pointer-events: none; + -ms-pointer-events: none; + -o-pointer-events: none; + pointer-events: none; */ } + .billboard-attribute-box .DIV-cy-tabs { height: 100%; display: flex; flex-direction: column; } + .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title { padding: 0 2px; } + .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:first-child { padding-left: 0; } + .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:last-child { padding-right: 0; } -.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title span{ + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title span { margin: 0 5px; } @@ -3573,4 +3611,116 @@ padding: 0 5px 5px 5px; box-sizing: border-box; flex: 1; + overflow: auto; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-thumb { + border-radius: 5px; + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + background-color: rgba(var(--color-sdk-base-rgb)); +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + border-radius: 5px; + background-color: rgba(var(--color-sdk-base-rgb), 0.1); +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content-pane { + width: 100%; + height: 100%; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content-pane iframe { + border: none; +} + +.billboard-attribute-box .billboard-attribute-box-line { + position: absolute; + width: 0px; + /* border-left: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); */ + border-left: 1px solid rgba(var(--color-sdk-base-rgb), 1); + /* transform: rotate(45deg); */ + transform-origin: 0px 0px; + -webkit-pointer-events: none; + -moz-pointer-events: none; + -ms-pointer-events: none; + -o-pointer-events: none; + pointer-events: none; +} + +.billboard-attribute-box .drag-nook { + position: absolute; + width: 12px; + height: 12px; + display: block; + user-select: none; + -webkit-pointer-events: auto; + -moz-pointer-events: auto; + -ms-pointer-events: auto; + -o-pointer-events: auto; + pointer-events: auto; + z-index: 3; + clip-path: polygon(0% 100%, 100% 100%, 50% 50%); + background-image: linear-gradient(to top, #ffffff 1px, #00000000 1px); + background-size: 100% 3px; + /* background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAJRJREFUWEftltsJgFAMQ5NNdBJ1Eh3NTdRJdJPIBQXF50/p/WgHSNNDCSGch877EQbyIyCpBtAa/cZEsj9qXwhImgEURgZA8rTzzkAiYGVgITm+ErC6/Ek3vycMAkHAnYCkAUDKAosZSTaeSZiCqIwgCgJBIG8CWyXzKySSZBGBu+afStYBqIxMfJdSo8WPslHJgsAKWjkmIRBy/c8AAAAASUVORK5CYII='); */ +} + +.billboard-attribute-box .drag-nook.left-top { + top: -6px; + left: -6px; + cursor: se-resize; + transform: rotate(-45deg); + display: none; +} + +.billboard-attribute-box .drag-nook.right-top { + top: -6px; + right: -6px; + cursor: ne-resize; + transform: rotate(45deg); + display: none; +} + +.billboard-attribute-box .table { + background-color: #ffffff00; + color: #ffffff; + overflow: hidden; + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); +} + +.billboard-attribute-box .table .table-head .tr { + border-top: none; + border-left: none; + border-right: none; +} + +.billboard-attribute-box .table .tr { + display: flex; + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-right: none; +} +.billboard-attribute-box .table .tr .th, .billboard-attribute-box .table .tr .td { + border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + display: flex; + justify-content: center; +} +.billboard-attribute-box .table .tr .th:last-child, .billboard-attribute-box .table .tr .td:last-child { + border-right: none; +} + + +.billboard-attribute-box .table .table-body .tr { + border-bottom: none; + border-left: none; +} + +.billboard-attribute-box .table .table-body .tr:first-child { + border-top: none; } \ No newline at end of file From 0f518ef6cbf9f94e1f5e2ae3e97c02e743e0ac80 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 22 Aug 2025 10:14:12 +0800 Subject: [PATCH 44/53] =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=9B=BE=E7=89=87=E8=AE=BE=E7=BD=AE=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Element/richText.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Obj/Element/richText.js b/src/Obj/Element/richText.js index 072a599..c63614c 100644 --- a/src/Obj/Element/richText.js +++ b/src/Obj/Element/richText.js @@ -56,8 +56,8 @@ class richText { MENU_CONF: { uploadImage: { fieldName: 'file', - maxFileSize: 50 * 1024 * 1024, - base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64 + // maxFileSize: 50 * 1024 * 1024, + // base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64 server: this.uploadImageServer, // // 上传之前触发 // onBeforeUpload(file) { // TS 语法 @@ -95,18 +95,18 @@ class richText { // console.log(`${file.name} 上传出错`, err, res) // }, - // // 自定义上传 - // async customUpload(file, insertFn) { // TS 语法 - // // async customUpload(file, insertFn) { // JS 语法 - // // file 即选中的文件 - // // 自己实现上传,并得到图片 url alt href - // // 最后插入图片 - // console.log(file, insertFn) - // insertFn(url, file.name) - // } + // 自定义上传 + async customUpload(file, insertFn) { // TS 语法 + // async customUpload(file, insertFn) { // JS 语法 + // file 即选中的文件 + // 自己实现上传,并得到图片 url alt href + // 最后插入图片 + let url = await _this.upload(file) + insertFn((_this.host = _this.host || getHost()) + '/' + url) + } }, uploadVideo: { - maxFileSize: 500 * 1024 * 1024, + // maxFileSize: 500 * 1024 * 1024, server: this.uploadVideoServer, allowedFileTypes: ['video/mp4', 'video/mp3', 'video/ogg', 'video/webm', 'video/avi'], // 自定义上传 From 8025a298a2af08ad62464469553968bf8a651245 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 22 Aug 2025 14:23:06 +0800 Subject: [PATCH 45/53] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BA=BF=E6=AE=B5?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=83=8C=E6=99=AF=E4=BF=AE=E6=94=B9=E6=97=A0?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/PolylineObject/index.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Obj/Base/PolylineObject/index.js b/src/Obj/Base/PolylineObject/index.js index e184417..df4e412 100644 --- a/src/Obj/Base/PolylineObject/index.js +++ b/src/Obj/Base/PolylineObject/index.js @@ -825,7 +825,6 @@ class PolylineObject extends Base { set labelLineColor(v) { this.options.label.lineColor = v this.label.lineColor = v - let _this = this if (this._elms.labelLineColor) { this._elms.labelLineColor.forEach((item, i) => { let lineColorPicker = new YJColorPicker({ @@ -840,6 +839,29 @@ class PolylineObject extends Base { }, //点击确认按钮事件回调 clear: () => { this.labelLineColor = 'rgba(0,255,255,0.5)' + } //点击清空按钮事件回调 + }) + this._elms.labelLineColor[i] = lineColorPicker + }) + } + } + + get labelBackgroundColorStart() { + return this.options.label.backgroundColor[0] + } + set labelBackgroundColorStart(v) { + this.options.label.backgroundColor[0] = v + this.label.backgroundColor = [v, this.label.backgroundColor[1]] + if (this._elms.labelBackgroundColorStart) { + this._elms.labelBackgroundColorStart.forEach((item, i) => { + let labelBackgroundColorStartPicker = new YJColorPicker({ + el: item.el, + size: 'mini', //颜色box类型 + alpha: true, //是否开启透明度 + defaultColor: this.labelBackgroundColorStart, + disabled: false, //是否禁止打开颜色选择器 + openPickerAni: 'opacity', //打开颜色选择器动画 + sure: color => { this.labelBackgroundColorStart = color }, //点击确认按钮事件回调 clear: () => { @@ -848,7 +870,7 @@ class PolylineObject extends Base { }) this._elms.labelBackgroundColorStart[ i - ] = _this.labelBackgroundColorStartPicker + ] = labelBackgroundColorStartPicker }) } } From 80869050e1a00eeeaa01fc26540aa98c033b3fbe Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 22 Aug 2025 14:26:14 +0800 Subject: [PATCH 46/53] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fonts/PangMenZhengDaoBiaoTiTi-1.ttf | Bin 1915800 -> 1028572 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/static/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf b/static/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf index 61d491d8c20b2da92309223fc23066ae338b7a7c..cd65b624d9d83939890b33cbcc57a239e864092f 100644 GIT binary patch literal 1028572 zcma&P2V9d^_XnPHBZL465C|x;VuT=DR!~8vxD`;G%mhW;vo5OQKp{9l+;v+=-BoL+ zRjbvvb!(Tkt!=ff9k1Pe+wxrh=iDa&`+ML2|ML%dk`R*T-h1x3=X}rioco{vg+k%3 zSfo%YGIECW?Tx>I!sGZIe0J%bH+V>><+rg4kE16Q3KleYNNoJ13p1EPJMVk^dzp1o z`P9;xKXz7V=MPXQs-{*>oICc)XI~lcZ&wtW50;J_Q(h4o%f>6TUDn`x$>Z=1mot9b z@%xwY_s-)c&73p;L`xw49e>YPOq^mZuMH>-QD{D#iob_UDxWje=c3|c{5=mpA2PXo z(wK&BnmY>ZgVz-b<*unyX3U&C`_1zT?Kfo##igMNS4HuYnXp+|grm_abc!HFXGM%6 zQIVm@QS?zLoD5zDWs=dHkYv;+sPtxhq9Y+GL2tCbrgy}j_2O^xyRGkd;|IO)fX)0Z zNE@k}40{dBDzf%w;k^PMpU=!PR8$xY4a#p?iVd*_yswxx?eMe| zzu3HK%PX=vb;~svLJf;M<&Im7&v=(Ui)B8Y6--f~a0M+pk7MvsD7+KAjLyjk3Gu#q zA7`VnQ&`fBh6az=PA;8d;|wl_ICh?Qw8X}S7~t_r_vN>G_qM$=^1 zO|G|Gm$@>RTXe&zRGe1?DMQ(tijIn4oN!fw$|w$_*{H(9oFI+_Rf1WG@38k=N4X4l zpWsrZZcx|YF;YFueS&(NtIf5>wWE8DJ9~3|(HlkU@g_g<{5Rgf2}4bKN1;>(vD=DR zg(B3LWQb2rN=ghf8ajoA;frJ(7s@_CZ|LN#*ZcS;7~*|>@r5%E6oq`|SJ>;}?d`$2 zDLXto+mvU!!e?rIe6+yAb4=mc;aRrCA|K5Zt+y$=OMI7XQ}^!0-r6Fq4}QECe!i>1 zNijy@qg;aRD;0hUlcI;BKXwX?;3V2^YmNHj>x)vB`)8#7!2gfWum}891N7$_>`f{* ziT70Oo6XxprS$I+2r^O9sOF9f4;=imzPC-_7K^95` zzpGa?vfC_8;fB8$aSfBEkzO6yw5b8_kW##VfAK#1Sf4zBfr?8gSp`Y5B5zX#TqYw$ z=Yd}AHteFmfg#DjZu2ZS1HFpzR~(Z9l#1=tMrUVQor%e`R6&U=GB(x_5*rm2-N_go zZN$%h@}x!S&TfkHB!H3C*m#kR-IOBnZ}SwD%E@e;!Wq{|Xi})&$w@g`a%aCvTbZ@; z%(63;n>J%#7>?-@j>#L(f$N)k<7Cj=dqlm$4yZ{FqvQnHG?+j+|plbHJQ z<*F+AGYU29rx;6P3ndx#6zznjkeEmboQ(=xc=19L z!f@R=>&>+840^E!(I${}2up&dz2)V5Ef(>}&lRp6K74JV{8(i$hd}#3-8?aT%P&*gX_xMHasER6l&MUktk<_fus` zHsc@3dQs2(P@Vh|OwMMS^sppzBH9kJTt*{&U)8fG-pAAZ^@L#w3B%%p{1cs+ULP7b zy<;f!N=O;t>;(xK__tMF`5G4|3pmrq9p8fv!{XzIC7613oXD7SC!er@ur3`wn=?nF zg>d{%e-Dq&Di@&(qfi%SqV9R%G(Dx^D%1&wmTwYDv81@Uxp-|inh%^$=mtvokaSk@ zKXn$yIFyz?4?4v%_CD)NpAQvF&+JFbkTvhvk-1}M)=qrfu}nN>iFZ)0sHeTLZ!1v3 z9_V8fq^a%1%0Lm}bb3DZT3%25Cao67s-b7-R{RMr93%DxE=ETg#VQj0M}7S6pZZww zX2r4|S)`9km&#*o`wZZEHlmS3QLgp+!r&QEHxUv%7LfQK%jQ^Z3 zp_-&}D9_GM$rA#iLk!W;hLGsh^gzFWq4m|!DEY7S2?M?kj-}_AVC+)?oL8=5uOS-r z!9JlGL{x;5!^coujs%g|+JyM^W4czvkKu)|e(9>E?A1k!{8 zHv{L!RiQAWMtTFGCFAMLz2m`fWdgr{Nh;`ACx zfQKGmD+fIM>LK2xJoy>EnKWrq6(0Nz`wKDGf1~~SH@4}GXFwRE7Z4^1Aq*Y}Vc6~I zeO~=$jBQN+xqZ(4SYj*5hL@U(-+i~ZsrbwpvH`OcJ(X2#jhGA6anc3A73777vPu|X zGQ{$cP|V$mVFc<3L;G5YHhV694@XN@56EuoL+zHEzOaRjk=zT5p+`gUwCTkS@|gem zJ-s0*2~9qlXYsu;_#JHQ#p2@S)29_TEEC@WoEx)pJ#50Z6yDgc0%cCi>#)fp#y?P@ zQf_AdA_;~Pg7LzxVE2VFs>s#q_!8wnezJSS%cVLk{7_shJ&EX!!&D4VI4PfF?~>d) zhly{Yixl5PB&IUJ;^Zgzsnu|fr|UFO6Uv7=nZsdV<%tuO{9}!GC7q+ELajW&E-Un{ zZ7Yr52=w%L0?`AuYJytB(`uGqy{()eJ&tC931M%I)~KO9U&=~~i);C_q39IoTxsY^ z53=iIFFKnM7Wn!ln{g$c(@1+*aqWtF-Msl*KRSGp zUwJlr(vf8YEB6(T9$kEOQJnw6prMnTFp@y2Whu1Ez3eT=9GkI&Bu76yvXm7q&n2)Y z5_DmQr6IE_*{RACmDnGLTu~>?288|iS<;Dt(5Du9^7F8;UW_WvE0MUd46iiQiKi<*%v` z_=_(eyt@{9@Qca`+-k_Jg~;2hZ^OHMH~govGEuq-Kl8b;T%1Ri-wm9L4))nF8N3t7 z8Q@{`7W#m{utO7EH6VG0*SfNIq$pQ*7hzWD1?eSrPD&r5QU3xni;GK&I1fz(*J6}I z2Kw*)xV~^+gnlK_SrcR}Bcb3Ap4-6Ek85;NMT9M2Cts@^$JfAcegG^PG5qUton{Qg zU4<~Kb*#1cUUUZbSBc{W@Y?mIw3=KLB|ET@Ahn1%)u?^?S%7+hOzC$7LMjh!lABm zfw)!v92^O$yjiWOga}`E^;wh?!*$&b$AOFh#k1xFFSL@VG89M~LcI)LX$49rsg{lF zI~{vJolh9cvW=F2c^3Yw#RBg9S3C#V8NfAiLlM$yXH*H^h(yuYV1IFbQO>O<=UlQ{ z%l~knwV;05pnA*BTIlP;SK|6<@_|W-p_@uHu29g4|NZT^VB)DPvPWfQ4<1EUNU7+B zbGjR4PM8YqBKFq)gZ2Ui?v$W3_PS?VW4qU~YeBy`{n-0+a^~RtNo(k^u-QBsZfiK2 zS3Fl5KD>bEa>132_K_A1oC!k`FkTaU7`{nK7 z59za^r|Uq;rIfG@2dgJkv-c)cPsrD4p9iDGY_^=6Gsp5uxcQf#@g~NRfer7&aj0lb3dxxf2*=s)?JCo2rq-@M)FPIl)w7~IH4YO!}&cT-7(;1FSi|)?};i zAbhoG)EyKTat`rNB;_gO9Kscmimr+z)LoqWByx(#HIZ%eQ909(5qXw)GsYC8$7Xs! zD{a(=`k9S-6%kWTej?n^tKvCVE_txGL#SHguJQA3zr2%KqgMAFIjRQO$dQE$ewu+1 zg!Q$MNB@Gs{k$}}AuPpQQDF}4z-Q?F+PitE)ni;;w90cA@V*S*d%U;yx^wnXv-#+* ztL{4IY%v$Its$-V6V}+PwaX|NTxY09PS_{HsS|(uO_~1Sfz&&;_WkJE7({?@`}Ql(p*)zPyO8-!#IKPGg)b66sI4gC1R;7^TLn-ft;Ki` zaj;Bgz`Ggw6MG-%J({0_{*5qzpB&fyg&t+nc%5dm?^&2tFlcl0<_kD2J!2nQ1`nQW z88pZ;dGKJ%4Xw@so%{E0Zh+3zeg@i(eP}y`U-m|YQldhIqI0ekaCdkt3Q6_g)6WMviNhn8Nd4* zxCx)e&`w^JdCF2dYFn{cog4D z&-I0s^_BB0v$OG`zH&H@%7M2!2x}59I6CUDz0blK(45F!$GP{$1BfESm+}*~w+g1y zVS{OzQM^TdwEg<)uWX1$_sbnT`h%Yd{957@q+(8^9Ga+!i;Grlx_rPg@n>#)^fQ0naBvLtLrSjUch*v6GT zhOdTPo7af3B_+}~E-tFk9Xp1>1UFkJ9YqX)DR zMjRm_2QRYW>})4jl}eJj*2Trev6H5h$VmSVrrJ?jSFVSSS@oI2RnBgWt0zxhJr<^< znD~!l4~6-6fC<02YWZ)U96yfwj2xWud6cir`J(R7A{2NCJ-%#>D0o166x)Lw{$ynQ zu7uRy>w3dFNC^EcsL55sU*k{Kv6PX!M#7hslPA~KR`S`QiN)wpC-Wd!_Qe;ZtH`tq zT!g+t;CG>~*p@>}@wpFvem{)hO_Jeu&Vg$Z1xn;lQZOax*zkc}ewgu(Y4gK9w zw536)t(hn<8D0tDv>ML@*-Uz&v-|)4Gog28guxv;>%2S85AWdQd%ewX&`RP9EW&d%1+`^slp>dWDtu>(4wN4de-6KW~PK{5C|d zhiH77$eY*m=2`Juy6}JhK@h0X$ zsoc)45%xfK$e>J6w$8G*(VLuV*r&?&mYt9ob~k9QS_>B~{68PAV9(}r&YQy$3$$u* z1Eo}p=jwrDIgEA<`Cc#xoq+@=a#`${v~k$#&a8)c8ZsQt?QDiWjy5+|MHZPrSqWaKeDU*gpeWOc(Qvz zgb$K2Dh#8*(ASS*Lu8ws$&t!|p(=^g_RBT7=9G$nL%xOa3EjFSOpiPqP}0+!yK?`} z7ta3zUuWz|e074VFHFUS0Ndfg))KE9ug5CKIky78m#9X&4dHyvtbiI@%FrZ0r$}m%Pwg zCjghc93LaKVqn`Vv^pvOhG&xp95$Pt@6-c-eZmfzP1mGzEL(bGh)%N~nvBN%CUb#K zlW>iHX)<3yEyLIh<+~5(1(CIVUhsVOA0y=R$B8Tb*c&_vPVxS9*jUKXftJbEN!Dkv zuY^$<>gaXh^U?0vdy6hWKq6W&0*EO|HOVtq<|2}u2CMl-WfbPXaM7lOoeoc%lg2XV zWX&0=)6B6TVQz`F==dL&)!}9qclPXAArsPrYr-!gs{V&al?cB20P8Eg0mY$vIzxBq zG8+-ra?w>ep=I3|@U0j;xPpIcWxKnK!G)w$^hMrc8^#mu6#=dB0QNXRV7RB?FDkqo zK`+e2PS5jHI!j~0wGKk~eY5H17Z#N+Vt)>6=5$CPr15OVR? zlwHu(%-|~;%{+F9?DHG z9)-@``sshwMIJp0njT5dD7CubJ!7eVfVpL@au4Qf5hV&+p(i_$!;+Cv9H)k#F$1<9K04%7XqU+>blMcLlb{Jvx50pMvmmp zYK7TYp1UktDIfo*KtxEVVfcRFf$)IBxIT)WI?_b zy$rHF_(LH!S{gcxaGoznfsGS+|9gBZ1iX3tg_@K6;QNUO_|+3ox%yw=d0-YlpUY7y z=(o}597LZZB5a{)h|EwV!gJ{pD12)T-H72M{5gU@fB?>yE1m>3q@|Y!1co=pguAGm z`D@Ez!UHgl+c>Uw@7^n4<#)pa0>(MJsCM#?Vdch+LM9j=$vlrQ`Z<9VkafU0RLL&Z zi$Hu8P`_Vhf$vMwPO5yYS>@DiudvDPP#h~H86o