Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0 into develop
This commit is contained in:
@ -548,11 +548,11 @@ class BillboardObject extends Base {
|
||||
value: '链接',
|
||||
key: 'link'
|
||||
},
|
||||
// {
|
||||
// name: 'IP摄像头',
|
||||
// value: 'IP摄像头',
|
||||
// key: 'camera'
|
||||
// },
|
||||
{
|
||||
name: 'IP摄像头',
|
||||
value: 'IP摄像头',
|
||||
key: 'camera'
|
||||
},
|
||||
// {
|
||||
// name: 'ISC摄像头',
|
||||
// value: 'ISC摄像头',
|
||||
@ -563,16 +563,16 @@ class BillboardObject extends Base {
|
||||
// value: '传感器',
|
||||
// key: 'sensor'
|
||||
// },
|
||||
// {
|
||||
// name: '全景图',
|
||||
// value: '全景图',
|
||||
// key: 'vr'
|
||||
// },
|
||||
// {
|
||||
// name: '物资',
|
||||
// value: '物资',
|
||||
// key: 'goods'
|
||||
// }
|
||||
{
|
||||
name: '全景图',
|
||||
value: '全景图',
|
||||
key: 'vr'
|
||||
},
|
||||
{
|
||||
name: '物资',
|
||||
value: '物资',
|
||||
key: 'goods'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -8,6 +8,8 @@
|
||||
import { getHost, getToken } from "../../../on";
|
||||
import Base from '../index'
|
||||
import Tools from '../../../Tools'
|
||||
import { syncSplitData } from "../../../Global/SplitScreen";
|
||||
import { syncData, getSdk as get2DSdk } 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,27 @@ class GeoJson extends Base {
|
||||
return this.options.show
|
||||
}
|
||||
|
||||
// set show(status) {
|
||||
// let sdkD = get2DSdk().sdkD
|
||||
// if (!this.isShowView || !sdkD) {
|
||||
// this.options.show = status
|
||||
// }
|
||||
// if (this.entity) {
|
||||
// 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
|
||||
// }
|
||||
// }
|
||||
// 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 +98,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)
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
function html() {
|
||||
return `
|
||||
return `
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
@ -7,14 +7,21 @@ function html() {
|
||||
<span class="label">名称</span>
|
||||
<input class="input" maxlength="40" type="text" @model="name">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="anchor btn">调整锚点</button>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button class="anchor btn">调整锚点</button>
|
||||
</div>
|
||||
<div class="col mode-box">
|
||||
<span class="label" style="flex: unset;">军标模式</span>
|
||||
<div class="mode"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" mode="0">
|
||||
<div class="col">
|
||||
<span class="label">旋转角度</span>
|
||||
<input type="range" max="360" min="0" step="0.1" @model="angle">
|
||||
@ -25,7 +32,7 @@ function html() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row" mode="0">
|
||||
<div class="col">
|
||||
<span class="label">调整大小</span>
|
||||
<input type="range" max="40000" min="0" step="0.1" @model="scale">
|
||||
@ -35,6 +42,75 @@ function html() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" mode="1">
|
||||
<div class="col height-mode-box" style="flex: 0 0 155px;margin-right: 10px;">
|
||||
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
||||
<div class="height-mode"></div>
|
||||
</div>
|
||||
<div class="col" style="margin: 0 10px;">
|
||||
<div class="height-box" style="display: flex; align-items: center;">
|
||||
<span class="label" style="flex: 0 0 56px;">高度</span>
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input class="input height" type="number" title="" min="-9999999" max="999999999">
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" style="margin-left: 10px;">
|
||||
<span class="label">图标倍数</span>
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input class="input" type="number" title="" data-min="0.1" max="99" @model="billboardScale">
|
||||
<span class="unit">倍</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" mode="1">
|
||||
<div class="col" style="flex: 0 0 155px;margin-right: 10px;">
|
||||
<span class="label">视野缩放</span>
|
||||
<input class="btn-switch" type="checkbox" @model="billboardScaleByDistance">
|
||||
</div>
|
||||
<div class="col" style="margin: 0 10px;">
|
||||
<span class="label">最近距离</span>
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input class="input" type="number" title="" min="1" max="99999999" @model="billboardNear">
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" style="margin-left: 10px;">
|
||||
<span class="label">最远距离</span>
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input class="input" type="number" title="" min="1" max="99999999" @model="billboardFar">
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 mode="1">文字设置</h4>
|
||||
<div class="row" mode="1">
|
||||
<div class="col" style="flex: 0 0 80px;margin: 0 10px;">
|
||||
<span class="label" style="flex: none;">显隐</span>
|
||||
<input class="btn-switch" type="checkbox" @model="labelShow">
|
||||
</div>
|
||||
<div class="col font-select-box" style="margin: 0 0px;flex: 0 0 150px;">
|
||||
<span class="label" style="flex: none;">字体选择</span>
|
||||
<div class="input input-select font-select"></div>
|
||||
</div>
|
||||
<div class="col" style="margin: 0 10px;">
|
||||
<span class="label">文字大小</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" style="margin-left: 10px;">
|
||||
<span class="label">文字颜色</span>
|
||||
<div class="labelColor"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
`
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -54,7 +54,7 @@ function html(that) {
|
||||
<div class="row">
|
||||
<div class="col" style="flex: 5;">
|
||||
<span class="label">文字内容</span>
|
||||
<input class="input" type="text" @model="textValue">
|
||||
<input class="input" type="text" @model="textValue" maxlength="30">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn" @click="textPosPick">设置位置</span>
|
||||
|
@ -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 {
|
||||
@ -1212,7 +1213,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
|
||||
@ -1279,6 +1280,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 +1294,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 +1345,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 +1368,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 +1416,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 +1452,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
|
||||
@ -1526,6 +1603,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) {
|
||||
@ -2020,6 +2100,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--) {
|
||||
@ -2089,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
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
@ -145,7 +145,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
|
||||
@ -156,10 +157,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,
|
||||
@ -175,18 +176,18 @@ 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.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
|
||||
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 {
|
||||
@ -660,7 +661,7 @@ class TrajectoryMotion extends Base {
|
||||
})
|
||||
this.TweenAnimate.pause()
|
||||
setTimeout(() => {
|
||||
_this.model.isMove = false
|
||||
_this.model && (_this.model.isMove = false)
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
@ -679,9 +680,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 {
|
||||
@ -755,7 +757,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 {
|
||||
@ -979,6 +982,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
|
||||
@ -1033,7 +1037,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 {
|
||||
@ -1161,8 +1165,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 {
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
@ -62,9 +63,19 @@ class Base extends Tools {
|
||||
}
|
||||
|
||||
set showView(v) {
|
||||
|
||||
|
||||
let sdk2D = get2DSdk().sdkD
|
||||
if(!sdk2D) {
|
||||
v=0
|
||||
if (!sdk2D) {
|
||||
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
|
||||
@ -118,16 +129,23 @@ 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
|
||||
}
|
||||
}
|
||||
if (!this.showView || this.showView == 3) {
|
||||
this.entity._showView = this.showView
|
||||
if (this.type == 'layer') {
|
||||
if (this.entity) {
|
||||
this.entity._objectState = this.options.show
|
||||
}
|
||||
}
|
||||
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
|
||||
this.label.show = this.options.show
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -138,12 +156,33 @@ 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
|
||||
|
||||
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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user