Merge branch 'develop' of http://xny.yj-3d.com:3000/zh/sdk4.0 into develop
This commit is contained in:
@ -3,7 +3,7 @@ class BaseDialog {
|
||||
this.container = container
|
||||
this.options = { ...options }
|
||||
this.options.ismove = true
|
||||
if(options.ismove === false) {
|
||||
if (options.ismove === false) {
|
||||
this.options.ismove = options.ismove
|
||||
}
|
||||
this.closeCallBack = options.closeCallBack
|
||||
@ -12,7 +12,6 @@ class BaseDialog {
|
||||
}
|
||||
|
||||
async init() {
|
||||
|
||||
this.closeAll()
|
||||
DialogAll.push(this)
|
||||
this.isDestroy = false
|
||||
@ -62,7 +61,7 @@ class BaseDialog {
|
||||
});
|
||||
}
|
||||
|
||||
if(this.options.ismove) {
|
||||
if (this.options.ismove) {
|
||||
this.moveDiv()
|
||||
}
|
||||
}
|
||||
@ -92,7 +91,7 @@ class BaseDialog {
|
||||
}
|
||||
|
||||
closeAll() {
|
||||
for(let i=DialogAll.length-1;i>=0;i--) {
|
||||
for (let i = DialogAll.length - 1; i >= 0; i--) {
|
||||
DialogAll[i].close()
|
||||
DialogAll.splice(i, 1)
|
||||
}
|
||||
@ -187,6 +186,14 @@ class BaseDialog {
|
||||
_this._element.body.style.bottom = 'unset'
|
||||
_this._element.body.style.right = 'unset'
|
||||
}
|
||||
|
||||
//鼠标抬起事件
|
||||
document.onmouseup = function (e) {
|
||||
window.onmousemove = null
|
||||
}
|
||||
window.ondragend = function (e) {
|
||||
window.onmousemove = null
|
||||
}
|
||||
}
|
||||
|
||||
//鼠标抬起事件
|
||||
|
@ -73,7 +73,7 @@ import { dialog as ContourDialog } from '../Global/Contour'
|
||||
import { on as SplitScreenOn, off as SplitScreenOff, setActiveId as SplitScreenSetActiveId, getSdk } from '../Global/SplitScreen'
|
||||
import LocateCurrent from '../Obj/Base/LocateCurrent'
|
||||
|
||||
import { Clear as AnalysisClear } from '../Obj/Analysis/clear'
|
||||
import { AnalysisClear, SectionClear } from '../Obj/Analysis/clear'
|
||||
import CutFillAnalysis from '../Obj/Analysis/CutFill'
|
||||
import Submerge from '../Obj/Analysis/Submerge'
|
||||
import ViewShed from '../Obj/Analysis/ViewShed'
|
||||
@ -390,7 +390,9 @@ if (!window.YJ) {
|
||||
Section,
|
||||
TerrainExcavation,
|
||||
Flat,
|
||||
Analyses: []
|
||||
AnalysesResults: [],
|
||||
SectionResults: [],
|
||||
ClearSection: SectionClear
|
||||
},
|
||||
CoordTransform,
|
||||
RoutePlanningArrays: [],
|
||||
|
@ -35,7 +35,7 @@ class CircleViewShed extends Tools {
|
||||
this.Dialog = _Dialog
|
||||
this._EventBinding = new EventBinding()
|
||||
this.html = null
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
CircleViewShed.edit(this)
|
||||
// CircleViewShed.create(this)
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class ContourAnalysis {
|
||||
"#2F0000",
|
||||
]; //等高线赋值颜色,内含default值
|
||||
this.countorLineList = Cesium.defaultValue(options.countorLineList, []);
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
this.createNewLine();
|
||||
}
|
||||
createNewLine() {
|
||||
|
@ -27,7 +27,7 @@ class CutFillAnalysis {
|
||||
}
|
||||
this.entities = []
|
||||
this.Draw = new DrawPolygon(this.sdk)
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
CutFillAnalysis.EditBox(this)
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ class Profile extends Draw {
|
||||
super(sdk)
|
||||
this.viewer = sdk.viewer;
|
||||
this.Dialog = _Dialog
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
Profile.create(this)
|
||||
}
|
||||
static create(that) {
|
||||
|
@ -15,7 +15,7 @@ class Section extends Tools {
|
||||
this.tiles3d = tiles3d
|
||||
this.options = { ...options }
|
||||
this.options.regionsType = this.options.regionsType || false
|
||||
// YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.SectionResults.push(this)
|
||||
this.Planes = []
|
||||
Section.start(this)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class SlopeAspect extends Tools {
|
||||
this.result = []; //存储创建的坡度分析结果,primitive集合
|
||||
this.handler = undefined;
|
||||
this.toolTip = "";
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
this.Draw = new DrawPolygon(this.sdk)
|
||||
// this.createNew4Distance()
|
||||
this.createNew4Num(50)
|
||||
|
@ -26,7 +26,7 @@ class Submerge extends Tools {
|
||||
this.status = true
|
||||
this.area = 0
|
||||
this._elms = {};
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
Submerge.EditBox(this)
|
||||
// Submerge.create(this)
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class ViewShedStage extends Tools {
|
||||
this.Dialog = _Dialog
|
||||
this._EventBinding = new EventBinding()
|
||||
this.html = null
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
ViewShedStage.edit(this)
|
||||
// ViewShedStage.edit(this)
|
||||
// this.update();
|
||||
|
@ -50,7 +50,7 @@ class ViewShedStage extends Tools {
|
||||
this.ids = []
|
||||
this.Dialog = _Dialog
|
||||
this.html = null
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
ViewShedStage.create(this)
|
||||
// ViewShedStage.edit(this)
|
||||
// this.update();
|
||||
|
@ -38,7 +38,7 @@ class ViewShedStage extends Tools {
|
||||
this.viewpointPrimitive = null
|
||||
this.Dialog = _Dialog
|
||||
this.html = null
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
ViewShedStage.create(this)
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ class VisibilityAnalysis extends Tools {
|
||||
this.viewPointHeight = options.viewPointHeight
|
||||
this.Dialog = _Dialog
|
||||
this._EventBinding = new EventBinding()
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
VisibilityAnalysis.edit(this)
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,14 @@
|
||||
function Clear() {
|
||||
YJ.Analysis.Analyses.forEach(m => {
|
||||
function AnalysisClear() {
|
||||
YJ.Analysis.AnalysesResults.forEach(m => {
|
||||
m.destroy()
|
||||
})
|
||||
// YJ.Analysis.Analyses = []
|
||||
// YJ.Analysis.AnalysesResults = []
|
||||
}
|
||||
|
||||
export {Clear}
|
||||
function SectionClear() {
|
||||
YJ.Analysis.SectionResults.forEach(m => {
|
||||
m.destroy()
|
||||
})
|
||||
}
|
||||
|
||||
export {AnalysisClear, SectionClear}
|
@ -50,7 +50,7 @@ class Test extends Tools {
|
||||
this.ids = []
|
||||
this.Dialog = _Dialog
|
||||
this.html = null
|
||||
YJ.Analysis.Analyses.push(this)
|
||||
YJ.Analysis.AnalysesResults.push(this)
|
||||
Test.create(this)
|
||||
// Test.edit(this)
|
||||
// this.update();
|
||||
|
@ -231,7 +231,20 @@ class BillboardObject extends Base {
|
||||
that._superGif = superGif
|
||||
that._superGif.id = id // 自定义id,用于判断gif实例是否改变
|
||||
|
||||
superGif.load(function () {
|
||||
superGif.load(function (status) {
|
||||
if (status == 404) {
|
||||
canvas = document.createElement('canvas')
|
||||
canvas.width = 0
|
||||
canvas.height = 0
|
||||
billboardH = 0
|
||||
if (that.entity) {
|
||||
that.entity.billboard.imgWidth = 0
|
||||
that.entity.billboard.imgHeight = 0
|
||||
that.entity.billboard.image = canvas
|
||||
addCluster(that.sdk, that.entity)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (that._superGif.id != id) {
|
||||
return
|
||||
}
|
||||
@ -286,6 +299,17 @@ class BillboardObject extends Base {
|
||||
addCluster(that.sdk, that.entity)
|
||||
}
|
||||
}
|
||||
image.onerror = function (err) {
|
||||
canvas.width = 0
|
||||
canvas.height = 0
|
||||
billboardH = 0
|
||||
if (that.entity) {
|
||||
that.entity.billboard.imgWidth = 0
|
||||
that.entity.billboard.imgHeight = 0
|
||||
that.entity.billboard.image = canvas
|
||||
addCluster(that.sdk, that.entity)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
that.entity = new Cesium.Entity({
|
||||
@ -729,7 +753,24 @@ class BillboardObject extends Base {
|
||||
let billboardH = 36
|
||||
let index = 0
|
||||
_this._frameImages = []
|
||||
superGif.load(function () {
|
||||
superGif.load(function (status) {
|
||||
if (status == 404) {
|
||||
canvas = document.createElement('canvas')
|
||||
canvas.width = 0
|
||||
canvas.height = 0
|
||||
billboardH = 0
|
||||
_this.entity.billboard.imgWidth = 0
|
||||
_this.entity.billboard.imgHeight = 0
|
||||
_this.entity && (_this.entity.billboard.image = canvas)
|
||||
_this.entity.billboard.height = new Cesium.CallbackProperty(function () {
|
||||
return 0
|
||||
}, false)
|
||||
_this.entity.label.pixelOffset = new Cesium.CallbackProperty(function () {
|
||||
return new Cesium.Cartesian2(0, 0)
|
||||
}, false)
|
||||
billboardH = height * (31 / width)
|
||||
return
|
||||
}
|
||||
if (_this._superGif.id != id) {
|
||||
return
|
||||
}
|
||||
@ -802,6 +843,21 @@ class BillboardObject extends Base {
|
||||
}, false)
|
||||
billboardH = height * (31 / width)
|
||||
}
|
||||
image.onerror = function (err) {
|
||||
canvas.width = 0
|
||||
canvas.height = 0
|
||||
billboardH = 0
|
||||
_this.entity.billboard.imgWidth = 0
|
||||
_this.entity.billboard.imgHeight = 0
|
||||
_this.entity && (_this.entity.billboard.image = canvas)
|
||||
_this.entity.billboard.height = new Cesium.CallbackProperty(function () {
|
||||
return 0
|
||||
}, false)
|
||||
_this.entity.label.pixelOffset = new Cesium.CallbackProperty(function () {
|
||||
return new Cesium.Cartesian2(0, 0)
|
||||
}, false)
|
||||
billboardH = height * (31 / width)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -2077,9 +2133,9 @@ class BillboardObject extends Base {
|
||||
// )
|
||||
this.entity.label.pixelOffset = new Cesium.CallbackProperty(function () {
|
||||
if (_this.options.billboard.show) {
|
||||
let billboardH =
|
||||
let billboardH = _this.entity.billboard.imgHeight ?
|
||||
_this.entity.billboard.imgHeight *
|
||||
(31 / _this.entity.billboard.imgWidth)
|
||||
(31 / _this.entity.billboard.imgWidth) : 0
|
||||
return new Cesium.Cartesian2(
|
||||
0,
|
||||
-billboardH * _this.options.billboard.scale -
|
||||
@ -2224,7 +2280,7 @@ class BillboardObject extends Base {
|
||||
.value
|
||||
) {
|
||||
this.options.attribute.vr.content.push({
|
||||
name: '全景图' ,
|
||||
name: '全景图',
|
||||
url: this._DialogObject._element.content.getElementsByClassName(
|
||||
'vr_add'
|
||||
)[0].value
|
||||
@ -2240,7 +2296,7 @@ class BillboardObject extends Base {
|
||||
|
||||
addAttributeRr(vr) {
|
||||
this.options.attribute.vr.content.push({
|
||||
name: '全景图' ,
|
||||
name: '全景图',
|
||||
url: vr
|
||||
})
|
||||
this.attributeVr = this.options.attribute.vr.content
|
||||
|
Reference in New Issue
Block a user