This commit is contained in:
zh
2025-09-01 16:26:25 +08:00
parent 6fa99df21c
commit 29629b9d43
5 changed files with 117 additions and 31 deletions

View File

@ -35,9 +35,20 @@ class CircleViewShed extends Tools {
this.Dialog = _Dialog this.Dialog = _Dialog
this._EventBinding = new EventBinding() this._EventBinding = new EventBinding()
this.html = null this.html = null
let tools = new Tools(sdk)
YJ.Analysis.AnalysesResults.push(this) YJ.Analysis.AnalysesResults.push(this)
CircleViewShed.edit(this) // CircleViewShed.edit(this)
// CircleViewShed.create(this) let terrainAvailability = this.viewer.terrainProvider.availability;
if (!terrainAvailability) {
tools.message({ type: 'warning', text: '未加载地形数据!' })
// window.ELEMENT && window.ELEMENT.Message({
// message: '未加载地形数据!',
// type: 'warning',
// duration: 1500
// });
return
}
CircleViewShed.create(this)
} }
get viewPointHeight() { get viewPointHeight() {

View File

@ -48,7 +48,7 @@ class Profile extends Draw {
}) })
Profile.interPoints(that).then((points) => { Profile.interPoints(that).then((points) => {
if (this._currentId && this._currentId === id) { if (this._currentId && this._currentId === id) {
that._DialogObject ? Profile.initEcharts(that, points) : Profile.edit(that, points) that.clickCallBack(points)
} }
}) })
} }
@ -84,7 +84,9 @@ class Profile extends Draw {
}) })
} }
} }
reDraw() {
Profile.create(this)
}
static create_polyline(that) { static create_polyline(that) {
that.entityHasCreated = true that.entityHasCreated = true
let id = that.randomString() let id = that.randomString()
@ -104,6 +106,16 @@ class Profile extends Draw {
) )
return id return id
} }
get onEnd() {
return this.clickCallBack
}
set onEnd(val) {
if (val && typeof val !== 'function') {
console.error('val:', val, '不是一个function')
} else {
this.clickCallBack = val
}
}
/** /**
* 线段插值点 * 线段插值点
@ -159,6 +171,28 @@ class Profile extends Draw {
} }
return positions_Inter return positions_Inter
} }
formatter(xy, tipData) {
const pointOption = {
show: true,
pixelSize: 10,
color: Cesium.Color.GREEN,
outlineColor: Cesium.Color.SKYBLUE,
outlineWidth: 3,
disableDepthTestDistance: Number.POSITIVE_INFINITY
}
if (!this.tipEntity) {
this.tipEntity = this.sdk.viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(xy[0], xy[1], Number(tipData[1])),
point: pointOption
})
} else {
this.tipEntity.position = Cesium.Cartesian3.fromDegrees(
xy[0],
xy[1],
Number(tipData[1])
)
}
}
static async edit(that, points) { static async edit(that, points) {
if (that._DialogObject && that._DialogObject.close) { if (that._DialogObject && that._DialogObject.close) {
@ -218,7 +252,7 @@ class Profile extends Draw {
outlineWidth: 3, outlineWidth: 3,
disableDepthTestDistance: Number.POSITIVE_INFINITY disableDepthTestDistance: Number.POSITIVE_INFINITY
}; };
const ele = that._DialogObject._element.content.getElementsByClassName("profile-echarts")[0]; const ele = document.getElementsByClassName("profile-echarts")[0];
that.echartsObject = echarts.init(ele); that.echartsObject = echarts.init(ele);
option = { option = {
tooltip: { tooltip: {
@ -383,7 +417,7 @@ class Profile extends Draw {
}; };
} }
else { else {
const ele = that._DialogObject._element.content.getElementsByClassName("profile-echarts")[0]; const ele = document.getElementsByClassName("profile-echarts")[0];
that.echartsObject = echarts.init(ele); that.echartsObject = echarts.init(ele);
option = { option = {
tooltip: { tooltip: {

View File

@ -26,8 +26,9 @@ class Submerge extends Tools {
this.status = true this.status = true
this.area = 0 this.area = 0
this._elms = {}; this._elms = {};
this.tools = new Tools(this.sdk)
YJ.Analysis.AnalysesResults.push(this) YJ.Analysis.AnalysesResults.push(this)
Submerge.EditBox(this) // Submerge.EditBox(this)
// Submerge.create(this) // Submerge.create(this)
} }
@ -35,16 +36,13 @@ class Submerge extends Tools {
that.Draw.start((a, positions) => { that.Draw.start((a, positions) => {
if (!positions || positions.length < 3) { if (!positions || positions.length < 3) {
let _error = '至少需要三个坐标!' let _error = '至少需要三个坐标!'
console.warn(_error) this.tools.message({
window.ELEMENT &&
window.ELEMENT.Message({
message: _error, message: _error,
type: 'warning', type: 'warning',
duration: 1500 });
})
return return
} }
that.destroy() Submerge.destroy()
if (!positions || positions.length == 0) { if (!positions || positions.length == 0) {
that.positions = [] that.positions = []
that._positions = [] that._positions = []
@ -95,6 +93,9 @@ class Submerge extends Tools {
// Submerge.EditBox(that) // Submerge.EditBox(that)
}) })
} }
draw() {
Submerge.create(this)
}
static async EditBox(that) { static async EditBox(that) {
if (that._DialogObject && that._DialogObject.close) { if (that._DialogObject && that._DialogObject.close) {
@ -104,7 +105,7 @@ class Submerge extends Tools {
that._DialogObject = await new Dialog(that.sdk.viewer._container, { that._DialogObject = await new Dialog(that.sdk.viewer._container, {
title: '淹没分析', left: '180px', top: '100px', title: '淹没分析', left: '180px', top: '100px',
closeCallBack: () => { closeCallBack: () => {
that.destroy() Submerge.destroy()
that.Dialog.closeCallBack && that.Dialog.closeCallBack() that.Dialog.closeCallBack && that.Dialog.closeCallBack()
}, },
}) })
@ -315,6 +316,39 @@ class Submerge extends Tools {
}) })
} }
get waterVolume() {
return this.options.waterVolume
}
set waterVolume(val) {
this.options.waterVolume = val
}
get minWaterLevel() {
return this.options.minWaterLevel
}
set minWaterLevel(val) {
this.options.minWaterLevel = val
}
get maxWaterLevel() {
return this.options.maxWaterLevel
}
set maxWaterLevel(val) {
this.options.maxWaterLevel = val
}
get risingSpeed() {
return this.options.risingSpeed
}
set risingSpeed(val) {
this.options.risingSpeed = val
}
get area() {
return this.area
}
set area(val) {
this.area = val
}
move() { move() {
if (this.TweenAnimate) { if (this.TweenAnimate) {
TWEEN.remove(this.TweenAnimate) TWEEN.remove(this.TweenAnimate)
@ -386,7 +420,7 @@ class Submerge extends Tools {
}) })
} }
destroy() { static destroy() {
if (this.TweenAnimate) { if (this.TweenAnimate) {
TWEEN.remove(this.TweenAnimate) TWEEN.remove(this.TweenAnimate)
} }

View File

@ -28,7 +28,8 @@ class VisibilityAnalysis extends Tools {
this.Dialog = _Dialog this.Dialog = _Dialog
this._EventBinding = new EventBinding() this._EventBinding = new EventBinding()
YJ.Analysis.AnalysesResults.push(this) YJ.Analysis.AnalysesResults.push(this)
VisibilityAnalysis.edit(this) // VisibilityAnalysis.edit(this)
VisibilityAnalysis.create(this)
} }
get viewPointHeight() { get viewPointHeight() {
@ -64,8 +65,7 @@ class VisibilityAnalysis extends Tools {
if (!that.resultObject.viewPoint) { if (!that.resultObject.viewPoint) {
let pos84 = that.cartesian3Towgs84(cartesian, that.viewer) let pos84 = that.cartesian3Towgs84(cartesian, that.viewer)
let positions let positions
if(that.sdk.viewer.terrainProvider.availability) if (that.sdk.viewer.terrainProvider.availability) {
{
positions = await Cesium.sampleTerrainMostDetailed( positions = await Cesium.sampleTerrainMostDetailed(
that.sdk.viewer.terrainProvider, that.sdk.viewer.terrainProvider,
[Cesium.Cartographic.fromDegrees(pos84.lng, pos84.lat)] [Cesium.Cartographic.fromDegrees(pos84.lng, pos84.lat)]

View File

@ -755,10 +755,17 @@
} }
.YJ-custom-base-dialog>.content input[type=number] { .YJ-custom-base-dialog>.content input[type=number] {
padding: 0 16px 0 10px; /* padding: 0 16px 0 10px;
font-weight: 700; font-weight: 700;
font-family: 'D-Din-Bold'; font-family: 'D-Din-Bold';
font-size: 18px; font-size: 18px; */
font-size: 12px;
font-weight: 400;
letter-spacing: 0px;
line-height: 24px;
color: rgba(204, 204, 204, 1);
text-align: left;
vertical-align: top;
} }
.YJ-custom-base-dialog>.content input[type=number]::-webkit-outer-spin-button, .YJ-custom-base-dialog>.content input[type=number]::-webkit-outer-spin-button,