修改
This commit is contained in:
@ -49,7 +49,11 @@ async function init(sdk) {
|
|||||||
sdk2D.viewer.imageryLayers.removeAll()
|
sdk2D.viewer.imageryLayers.removeAll()
|
||||||
for (let i = 0; i < imageryLayers.length; i++) {
|
for (let i = 0; i < imageryLayers.length; i++) {
|
||||||
let entity = sdk2D.viewer.imageryLayers.addImageryProvider(imageryLayers[i].imageryProvider, imageryLayers[i]._layerIndex)
|
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.show = imageryLayers[i].show
|
||||||
|
entity.alpha = imageryLayers[i].alpha
|
||||||
if (imageryLayers[i]._objectState) {
|
if (imageryLayers[i]._objectState) {
|
||||||
if (imageryLayers[i]._showView == 3) {
|
if (imageryLayers[i]._showView == 3) {
|
||||||
entity.show = false
|
entity.show = false
|
||||||
@ -136,7 +140,7 @@ async function syncData2(sdk, id, entityId) {
|
|||||||
options.height = 0
|
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) {
|
if (that.showView == 3) {
|
||||||
options.show = false
|
options.show = false
|
||||||
}
|
}
|
||||||
@ -227,7 +231,7 @@ async function syncData2(sdk, id, entityId) {
|
|||||||
obj.options.heightReference = 1
|
obj.options.heightReference = 1
|
||||||
}
|
}
|
||||||
let options = syncObject.tools.deepCopyObj(obj.options)
|
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) {
|
if (obj.showView == 3) {
|
||||||
options.show = false
|
options.show = false
|
||||||
}
|
}
|
||||||
|
@ -100,14 +100,14 @@ function MouseRightMenu(sdk, status, callBack) {
|
|||||||
that = sdk.entityMap.get(entityId)
|
that = sdk.entityMap.get(entityId)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (that && that.picking) {
|
// if (that && that.picking) {
|
||||||
addedMenu = `
|
// addedMenu = `
|
||||||
<span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>
|
// <span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>
|
||||||
<ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">
|
// <ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">
|
||||||
<li style="padding: 3px 10px;cursor: pointer;">属性</li>
|
// <li style="padding: 3px 10px;cursor: pointer;">属性</li>
|
||||||
</ul>
|
// </ul>
|
||||||
`
|
// `
|
||||||
}
|
// }
|
||||||
let position = tools.cartesian3Towgs84(cartesian, sdk.viewer)
|
let position = tools.cartesian3Towgs84(cartesian, sdk.viewer)
|
||||||
menuElm = document.createElement('div')
|
menuElm = document.createElement('div')
|
||||||
menuElm.id = 'custom-menu'
|
menuElm.id = 'custom-menu'
|
||||||
|
@ -91,7 +91,7 @@ class MeasureDistance extends Measure {
|
|||||||
|
|
||||||
|
|
||||||
//暂时固定取20个点
|
//暂时固定取20个点
|
||||||
if (d > 20) {//大于20m时,固定取20个点
|
if (d > 2) {//大于20m时,固定取20个点
|
||||||
meters = d / 20
|
meters = d / 20
|
||||||
await start(meters)
|
await start(meters)
|
||||||
} else if (d < 1) {
|
} else if (d < 1) {
|
||||||
@ -106,8 +106,8 @@ class MeasureDistance extends Measure {
|
|||||||
|
|
||||||
|
|
||||||
async sampleHeight(p1, index) {
|
async sampleHeight(p1, index) {
|
||||||
let p2 = await this.sampleHeightMostDetailed([p1])
|
let height = await this.getClampToHeight(p1, [...this.sdk.viewer.entities.values])
|
||||||
p1.alt = p2[0].height
|
p1.alt = height
|
||||||
return {position: p1, index}
|
return {position: p1, index}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
import Dialog from '../../../Element/Dialog';
|
import Dialog from '../../../Element/Dialog';
|
||||||
import CoordTransform from "../../../../transform/CoordTransform";
|
import CoordTransform from "../../../../transform/CoordTransform";
|
||||||
import BaseSource from "../index";
|
import BaseSource from "../index";
|
||||||
import { syncData } from '../../../../Global/MultiViewportMode'
|
import { syncData, get2DView } from '../../../../Global/MultiViewportMode'
|
||||||
import { setSplitDirection, syncSplitData } from '../../../../Global/SplitScreen'
|
import { setSplitDirection, syncSplitData } from '../../../../Global/SplitScreen'
|
||||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global'
|
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global'
|
||||||
|
|
||||||
@ -244,8 +244,19 @@ class BaseLayer extends BaseSource {
|
|||||||
this.originalOptions = this.deepCopyObj(this.options)
|
this.originalOptions = this.deepCopyObj(this.options)
|
||||||
this._DialogObject.close()
|
this._DialogObject.close()
|
||||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions)
|
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)
|
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: () => {
|
closeCallBack: () => {
|
||||||
this.reset()
|
this.reset()
|
||||||
|
@ -433,31 +433,31 @@ class BillboardObject extends Base {
|
|||||||
value: '链接',
|
value: '链接',
|
||||||
key: 'link'
|
key: 'link'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'IP摄像头',
|
|
||||||
value: 'IP摄像头',
|
|
||||||
key: 'camera'
|
|
||||||
},
|
|
||||||
// {
|
// {
|
||||||
// name: 'ISC摄像头',
|
// name: 'IP摄像头',
|
||||||
// value: 'ISC摄像头',
|
// value: 'IP摄像头',
|
||||||
// key: 'isc'
|
// key: 'camera'
|
||||||
|
// },
|
||||||
|
// // {
|
||||||
|
// // name: 'ISC摄像头',
|
||||||
|
// // value: 'ISC摄像头',
|
||||||
|
// // key: 'isc'
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // name: '传感器',
|
||||||
|
// // value: '传感器',
|
||||||
|
// // key: 'sensor'
|
||||||
|
// // },
|
||||||
|
// {
|
||||||
|
// name: '全景图',
|
||||||
|
// value: '全景图',
|
||||||
|
// key: 'vr'
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// name: '传感器',
|
// name: '物资',
|
||||||
// value: '传感器',
|
// value: '物资',
|
||||||
// key: 'sensor'
|
// key: 'goods'
|
||||||
// },
|
// }
|
||||||
{
|
|
||||||
name: '全景图',
|
|
||||||
value: '全景图',
|
|
||||||
key: 'vr'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '物资',
|
|
||||||
value: '物资',
|
|
||||||
key: 'goods'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -825,7 +825,6 @@ class PolylineObject extends Base {
|
|||||||
set labelLineColor(v) {
|
set labelLineColor(v) {
|
||||||
this.options.label.lineColor = v
|
this.options.label.lineColor = v
|
||||||
this.label.lineColor = v
|
this.label.lineColor = v
|
||||||
let _this = this
|
|
||||||
if (this._elms.labelLineColor) {
|
if (this._elms.labelLineColor) {
|
||||||
this._elms.labelLineColor.forEach((item, i) => {
|
this._elms.labelLineColor.forEach((item, i) => {
|
||||||
let lineColorPicker = new YJColorPicker({
|
let lineColorPicker = new YJColorPicker({
|
||||||
@ -840,6 +839,29 @@ class PolylineObject extends Base {
|
|||||||
}, //点击确认按钮事件回调
|
}, //点击确认按钮事件回调
|
||||||
clear: () => {
|
clear: () => {
|
||||||
this.labelLineColor = 'rgba(0,255,255,0.5)'
|
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
|
this.labelBackgroundColorStart = color
|
||||||
}, //点击确认按钮事件回调
|
}, //点击确认按钮事件回调
|
||||||
clear: () => {
|
clear: () => {
|
||||||
@ -848,10 +870,11 @@ class PolylineObject extends Base {
|
|||||||
})
|
})
|
||||||
this._elms.labelBackgroundColorStart[
|
this._elms.labelBackgroundColorStart[
|
||||||
i
|
i
|
||||||
] = _this.labelBackgroundColorStartPicker
|
] = labelBackgroundColorStartPicker
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get labelBackgroundColorEnd() {
|
get labelBackgroundColorEnd() {
|
||||||
return this.options.label.backgroundColor[1]
|
return this.options.label.backgroundColor[1]
|
||||||
}
|
}
|
||||||
|
@ -2087,7 +2087,7 @@ class TrajectoryMotion extends Base {
|
|||||||
rubricElm.style.color = '#ff5733';
|
rubricElm.style.color = '#ff5733';
|
||||||
rubricElm.style.display = 'none'
|
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]
|
let iconRubric = contentElm.getElementsByClassName('icon-rubric')[0]
|
||||||
iconRubric.addEventListener('mouseenter', (e) => {
|
iconRubric.addEventListener('mouseenter', (e) => {
|
||||||
rubricElm.style.display = 'block'
|
rubricElm.style.display = 'block'
|
||||||
|
@ -88,6 +88,10 @@ class WallStereoscopic extends Base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get type() {
|
||||||
|
return 'wallStereoscopic'
|
||||||
|
}
|
||||||
|
|
||||||
static createLabel(that) {
|
static createLabel(that) {
|
||||||
// 标签
|
// 标签
|
||||||
that.label = new LabelObject(that.sdk, {
|
that.label = new LabelObject(that.sdk, {
|
||||||
|
@ -290,7 +290,7 @@ class Base extends Tools {
|
|||||||
let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt)
|
let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt)
|
||||||
|
|
||||||
let position = { lng: 0, lat: 0 }
|
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 }
|
position = { ...this.options.position }
|
||||||
}
|
}
|
||||||
else if (this.options.positions) {
|
else if (this.options.positions) {
|
||||||
@ -436,7 +436,7 @@ class Base extends Tools {
|
|||||||
|
|
||||||
let position = { lng: 0, lat: 0 }
|
let position = { lng: 0, lat: 0 }
|
||||||
let relativePosition = { ...cameraPosition84 }
|
let relativePosition = { ...cameraPosition84 }
|
||||||
if (this.options.position) {
|
if (this.options.position && Object.prototype.toString.call(this.options.position) === '[object Object]') {
|
||||||
position = { ...this.options.position }
|
position = { ...this.options.position }
|
||||||
}
|
}
|
||||||
else if (this.options.positions) {
|
else if (this.options.positions) {
|
||||||
|
@ -56,8 +56,8 @@ class richText {
|
|||||||
MENU_CONF: {
|
MENU_CONF: {
|
||||||
uploadImage: {
|
uploadImage: {
|
||||||
fieldName: 'file',
|
fieldName: 'file',
|
||||||
maxFileSize: 50 * 1024 * 1024,
|
// maxFileSize: 50 * 1024 * 1024,
|
||||||
base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64
|
// base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64
|
||||||
server: this.uploadImageServer,
|
server: this.uploadImageServer,
|
||||||
// // 上传之前触发
|
// // 上传之前触发
|
||||||
// onBeforeUpload(file) { // TS 语法
|
// onBeforeUpload(file) { // TS 语法
|
||||||
@ -95,18 +95,18 @@ class richText {
|
|||||||
// console.log(`${file.name} 上传出错`, err, res)
|
// console.log(`${file.name} 上传出错`, err, res)
|
||||||
// },
|
// },
|
||||||
|
|
||||||
// // 自定义上传
|
// 自定义上传
|
||||||
// async customUpload(file, insertFn) { // TS 语法
|
async customUpload(file, insertFn) { // TS 语法
|
||||||
// // async customUpload(file, insertFn) { // JS 语法
|
// async customUpload(file, insertFn) { // JS 语法
|
||||||
// // file 即选中的文件
|
// file 即选中的文件
|
||||||
// // 自己实现上传,并得到图片 url alt href
|
// 自己实现上传,并得到图片 url alt href
|
||||||
// // 最后插入图片
|
// 最后插入图片
|
||||||
// console.log(file, insertFn)
|
let url = await _this.upload(file)
|
||||||
// insertFn(url, file.name)
|
insertFn((_this.host = _this.host || getHost()) + '/' + url)
|
||||||
// }
|
}
|
||||||
},
|
},
|
||||||
uploadVideo: {
|
uploadVideo: {
|
||||||
maxFileSize: 500 * 1024 * 1024,
|
// maxFileSize: 500 * 1024 * 1024,
|
||||||
server: this.uploadVideoServer,
|
server: this.uploadVideoServer,
|
||||||
allowedFileTypes: ['video/mp4', 'video/mp3', 'video/ogg', 'video/webm', 'video/avi'],
|
allowedFileTypes: ['video/mp4', 'video/mp3', 'video/ogg', 'video/webm', 'video/avi'],
|
||||||
// 自定义上传
|
// 自定义上传
|
||||||
|
@ -70,7 +70,7 @@ function StreamWall1() {
|
|||||||
fragColor.rgb = color.rgb / 1.0;\n\
|
fragColor.rgb = color.rgb / 1.0;\n\
|
||||||
fragColor = czm_gammaCorrect(fragColor);\n\
|
fragColor = czm_gammaCorrect(fragColor);\n\
|
||||||
material.alpha = colorImage.a * color.a;\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\
|
material.emission = fragColor.rgb;\n\
|
||||||
return material;\n\
|
return material;\n\
|
||||||
}";
|
}";
|
||||||
@ -208,6 +208,14 @@ function StreamWall2() {
|
|||||||
Property.equals(this.repeat, other._repeat) &&
|
Property.equals(this.repeat, other._repeat) &&
|
||||||
Property.equals(this.repeats, other._repeats)
|
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的材质队列中
|
// 将定义的材质对象添加到cesium的材质队列中
|
||||||
Material._materialCache.addMaterial(MaterialType, {
|
Material._materialCache.addMaterial(MaterialType, {
|
||||||
fabric: {
|
fabric: {
|
||||||
@ -230,8 +238,8 @@ function StreamWall2() {
|
|||||||
else {
|
else {
|
||||||
material.alpha = 1.0;
|
material.alpha = 1.0;
|
||||||
}
|
}
|
||||||
material.diffuse = colorImage.rgb*color.rgb*0.0;
|
material.diffuse = color.rgb*0.0;
|
||||||
material.emission = colorImage.rgb*color.rgb * 1.4;
|
material.emission = color.rgb * 1.0;
|
||||||
return material;
|
return material;
|
||||||
}`,
|
}`,
|
||||||
components: {
|
components: {
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user