Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0 into develop

This commit is contained in:
zh
2025-08-22 17:52:03 +08:00
6 changed files with 37 additions and 10 deletions

View File

@ -49,7 +49,11 @@ async function init(sdk) {
sdk2D.viewer.imageryLayers.removeAll()
for (let i = 0; i < imageryLayers.length; i++) {
let entity = sdk2D.viewer.imageryLayers.addImageryProvider(imageryLayers[i].imageryProvider, imageryLayers[i]._layerIndex)
if(imageryLayers[i]._id) {
entity._id = imageryLayers[i]._id
}
entity.show = imageryLayers[i].show
entity.alpha = imageryLayers[i].alpha
if (imageryLayers[i]._objectState) {
if (imageryLayers[i]._showView == 3) {
entity.show = false
@ -136,7 +140,7 @@ async function syncData2(sdk, id, entityId) {
options.height = 0
}
if (!that.type || (that.type !== 'tileset' && that.type !== 'bim' && that.type !== 'glb' && that.type !== 'layer')) {
if (!that.type || (that.type !== 'tileset' && that.type !== 'bim' && that.type !== 'glb' && that.type !== 'layer' && that.type !== 'wallStereoscopic')) {
if (that.showView == 3) {
options.show = false
}
@ -227,7 +231,7 @@ async function syncData2(sdk, id, entityId) {
obj.options.heightReference = 1
}
let options = syncObject.tools.deepCopyObj(obj.options)
if (!obj.type || (obj.type !== 'tileset' && obj.type !== 'bim' && obj.type !== 'glb' && obj.type !== 'layer')) {
if (!obj.type || (obj.type !== 'tileset' && obj.type !== 'bim' && obj.type !== 'glb' && obj.type !== 'layer' && obj.type !== 'wallStereoscopic')) {
if (obj.showView == 3) {
options.show = false
}

View File

@ -9,7 +9,7 @@
import Dialog from '../../../Element/Dialog';
import CoordTransform from "../../../../transform/CoordTransform";
import BaseSource from "../index";
import { syncData } from '../../../../Global/MultiViewportMode'
import { syncData, get2DView } from '../../../../Global/MultiViewportMode'
import { setSplitDirection, syncSplitData } from '../../../../Global/SplitScreen'
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global'
@ -244,8 +244,19 @@ class BaseLayer extends BaseSource {
this.originalOptions = this.deepCopyObj(this.options)
this._DialogObject.close()
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions)
syncData(this.sdk, this.options.id)
// syncData(this.sdk, this.options.id)
syncSplitData(this.sdk, this.options.id)
let sdk2D = get2DView()
if (sdk2D && sdk2D != this.sdk) {
for(let i=0;i<sdk2D.viewer.imageryLayers._layers.length;i++) {
let layer = sdk2D.viewer.imageryLayers._layers[i]
if(layer._id && layer._id == this.options.id) {
layer.alpha = this.options.alpha
break
}
}
}
},
closeCallBack: () => {
this.reset()

View File

@ -2186,7 +2186,7 @@ class TrajectoryMotion extends Base {
rubricElm.style.color = '#ff5733';
rubricElm.style.display = 'none'
rubricElm.innerHTML = `场景正方向为轨迹前进正方向<div x-arrow="" class="custom__popper__arrow" style="left: 59px;"></div>`
rubricElm.innerHTML = `场景正方向为轨迹前进正方向<div x-arrow="" class="custom__popper__arrow" style="left: 59px;"></div>`
let iconRubric = contentElm.getElementsByClassName('icon-rubric')[0]
iconRubric.addEventListener('mouseenter', (e) => {
rubricElm.style.display = 'block'

View File

@ -88,6 +88,10 @@ class WallStereoscopic extends Base {
}
}
get type() {
return 'wallStereoscopic'
}
static createLabel(that) {
// 标签
that.label = new LabelObject(that.sdk, {

View File

@ -290,7 +290,7 @@ class Base extends Tools {
let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt)
let position = { lng: 0, lat: 0 }
if (this.options.position) {
if (this.options.position && Object.prototype.toString.call(this.options.position) === '[object Object]') {
position = { ...this.options.position }
}
else if (this.options.positions) {
@ -436,7 +436,7 @@ class Base extends Tools {
let position = { lng: 0, lat: 0 }
let relativePosition = { ...cameraPosition84 }
if (this.options.position) {
if (this.options.position && Object.prototype.toString.call(this.options.position) === '[object Object]') {
position = { ...this.options.position }
}
else if (this.options.positions) {

View File

@ -70,7 +70,7 @@ function StreamWall1() {
fragColor.rgb = color.rgb / 1.0;\n\
fragColor = czm_gammaCorrect(fragColor);\n\
material.alpha = colorImage.a * color.a;\n\
material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n\
material.diffuse = color.rgb/20.0;\n\
material.emission = fragColor.rgb;\n\
return material;\n\
}";
@ -208,6 +208,14 @@ function StreamWall2() {
Property.equals(this.repeat, other._repeat) &&
Property.equals(this.repeats, other._repeats)
};
// let code2 = 'material.diffuse = color.rgb*1.0;'
// if (uniforms.is2D) {
// code2 = `
// material.diffuse = color.rgb*0.0;
// material.emission = color.rgb * 1.0;
// `
// }
// console.log(code2, uniforms.is2D)
// 将定义的材质对象添加到cesium的材质队列中
Material._materialCache.addMaterial(MaterialType, {
fabric: {
@ -230,8 +238,8 @@ function StreamWall2() {
else {
material.alpha = 1.0;
}
material.diffuse = colorImage.rgb*color.rgb*0.0;
material.emission = colorImage.rgb*color.rgb * 1.4;
material.diffuse = color.rgb*0.0;
material.emission = color.rgb * 1.0;
return material;
}`,
components: {