Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0_new
This commit is contained in:
@ -2391,7 +2391,7 @@ class BillboardObject extends Base {
|
||||
10000000000000
|
||||
)
|
||||
|
||||
let objectsToExclude = []
|
||||
let objectsToExclude = [this.entity]
|
||||
for (let [key, value] of this.sdk.entityMap) {
|
||||
if (value.type === 'RadarScanStereoscopic' && value.entity) {
|
||||
objectsToExclude.push(value.entity)
|
||||
|
||||
@ -239,7 +239,9 @@ class CurvelineObject extends Base {
|
||||
})
|
||||
|
||||
this.options.rotate = v
|
||||
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
|
||||
let params = { ...this.options }
|
||||
params.speed = this.inputSpeed
|
||||
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params)
|
||||
}
|
||||
|
||||
get space() {
|
||||
@ -2590,10 +2592,14 @@ class CurvelineObject extends Base {
|
||||
// }
|
||||
|
||||
nodeEdit(cd) {
|
||||
let lastHeightMode = this.heightMode
|
||||
this.positionEditing = false
|
||||
this.heightMode = 0
|
||||
if (YJ.Measure.GetMeasureStatus()) {
|
||||
} else {
|
||||
this.closeNodeEdit()
|
||||
this._lastHeightMode = lastHeightMode
|
||||
YJ.Measure.SetMeasureStatus(true)
|
||||
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
|
||||
this.event = new MouseEvent(this.sdk)
|
||||
this.ControllerObject = new Controller(this.sdk)
|
||||
@ -2643,6 +2649,11 @@ class CurvelineObject extends Base {
|
||||
})
|
||||
|
||||
this.event.mouse_right((movement, cartesian) => {
|
||||
let _lastHeightMode = this._lastHeightMode
|
||||
this._lastHeightMode = null
|
||||
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||
this.heightMode = _lastHeightMode
|
||||
}
|
||||
for (let i = 0; i < this.nodePoints.length; i++) {
|
||||
this.sdk.viewer.entities.remove(this.nodePoints[i])
|
||||
}
|
||||
@ -2695,6 +2706,12 @@ class CurvelineObject extends Base {
|
||||
}
|
||||
|
||||
closeNodeEdit() {
|
||||
let _lastHeightMode = this._lastHeightMode
|
||||
this._lastHeightMode = null
|
||||
if(_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||
this.heightMode = _lastHeightMode
|
||||
}
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
this.ControllerObject && this.ControllerObject.destroy()
|
||||
this.event && this.event.destroy()
|
||||
this.tip && this.tip.destroy()
|
||||
|
||||
@ -96,17 +96,13 @@ 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)
|
||||
}
|
||||
|
||||
/*geojosn暂时只用线的形式*/
|
||||
static addDataToGlobe(that) {
|
||||
/*geojosn暂时只用线的形式*/
|
||||
const geoJsonDataSource = new Cesium.GeoJsonDataSource();
|
||||
let geojson = that.deepCopyObj(that.geojson)
|
||||
let geojson = this.deepCopyObj(this.geojson)
|
||||
for (let i = 0; i < geojson.features.length; i++) {
|
||||
if (!geojson.features[i].id) {
|
||||
geojson.features[i].id = that.options.id + '_' + i
|
||||
geojson.features[i].id = this.options.id + '_' + i
|
||||
}
|
||||
}
|
||||
// console.log(geojson)
|
||||
@ -114,13 +110,13 @@ class GeoJson extends Base {
|
||||
clampToGround: true,
|
||||
});
|
||||
return promise.then(datasource => {
|
||||
that.entity = datasource
|
||||
this.entity = datasource
|
||||
datasource.entities.values.forEach(enetity => {
|
||||
// console.log(enetity)
|
||||
let color = Cesium.Color.fromCssColorString(that.options.color)
|
||||
let color = Cesium.Color.fromCssColorString(this.options.color)
|
||||
let colorPolygon = color.withAlpha(0.2)
|
||||
enetity.show = that.options.show
|
||||
that.sdk.viewer.entities.add(enetity)
|
||||
enetity.show = this.options.show
|
||||
this.sdk.viewer.entities.add(enetity)
|
||||
if (enetity.billboard) {
|
||||
enetity.billboard.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND
|
||||
enetity.point = new Cesium.PointGraphics({
|
||||
@ -134,26 +130,26 @@ class GeoJson extends Base {
|
||||
|
||||
if (enetity.polyline) {
|
||||
enetity.polyline.material = color
|
||||
enetity.polyline.zIndex = that.sdk._entityZIndex
|
||||
that.sdk._entityZIndex++
|
||||
enetity.polyline.zIndex = this.sdk._entityZIndex
|
||||
this.sdk._entityZIndex++
|
||||
}
|
||||
|
||||
if (enetity.polygon) {
|
||||
enetity.polygon.perPositionHeight = false
|
||||
enetity.polygon.material = colorPolygon
|
||||
enetity.polygon.zIndex = that.sdk._entityZIndex
|
||||
enetity.polygon.zIndex = this.sdk._entityZIndex
|
||||
|
||||
enetity.polyline = new Cesium.PolylineGraphics({
|
||||
positions: enetity.polygon.hierarchy._value.positions,
|
||||
width: 1,
|
||||
clampToGround: true,
|
||||
material: color,
|
||||
zIndex: that.sdk._entityZIndex
|
||||
zIndex: this.sdk._entityZIndex
|
||||
})
|
||||
that.sdk._entityZIndex++
|
||||
this.sdk._entityZIndex++
|
||||
}
|
||||
})
|
||||
that.loading = false
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -1683,6 +1683,7 @@ class PolygonObject extends Base {
|
||||
_this.previous.positions[0],
|
||||
_this.previous.positions[1]
|
||||
]
|
||||
this.previous = null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -141,11 +141,11 @@ class PolylineObject extends Base {
|
||||
// this.options.attribute.goods.content =
|
||||
// this.options.attribute.goods.content || []
|
||||
|
||||
delete this.options.attribute.camera
|
||||
delete this.options.attribute.vr
|
||||
delete this.options.attribute.goods
|
||||
delete this.options.attribute.camera
|
||||
delete this.options.attribute.vr
|
||||
delete this.options.attribute.goods
|
||||
|
||||
this.options.richTextContent = options.richTextContent || ''
|
||||
this.options.richTextContent = options.richTextContent || ''
|
||||
|
||||
|
||||
this.operate = {}
|
||||
@ -2587,6 +2587,7 @@ class PolylineObject extends Base {
|
||||
// }
|
||||
|
||||
nodeEdit(cb) {
|
||||
let lastHeightMode = this.heightMode
|
||||
this.positionEditing = false
|
||||
this.noseToTail = false
|
||||
// this.smooth = false
|
||||
@ -2594,6 +2595,7 @@ class PolylineObject extends Base {
|
||||
if (YJ.Measure.GetMeasureStatus()) {
|
||||
} else {
|
||||
this.closeNodeEdit()
|
||||
this._lastHeightMode = lastHeightMode
|
||||
YJ.Measure.SetMeasureStatus(true)
|
||||
this._nodeEditCallback = cb
|
||||
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
|
||||
@ -2644,6 +2646,11 @@ class PolylineObject extends Base {
|
||||
})
|
||||
|
||||
this.event.mouse_right((movement, cartesian) => {
|
||||
let _lastHeightMode = this._lastHeightMode
|
||||
this._lastHeightMode = null
|
||||
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||
this.heightMode = _lastHeightMode
|
||||
}
|
||||
for (let i = 0; i < this.nodePoints.length; i++) {
|
||||
this.sdk.viewer.entities.remove(this.nodePoints[i])
|
||||
}
|
||||
@ -2696,6 +2703,11 @@ class PolylineObject extends Base {
|
||||
}
|
||||
|
||||
closeNodeEdit() {
|
||||
let _lastHeightMode = this._lastHeightMode
|
||||
this._lastHeightMode = null
|
||||
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
|
||||
this.heightMode = _lastHeightMode
|
||||
}
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
this.ControllerObject && this.ControllerObject.destroy()
|
||||
this.event && this.event.destroy()
|
||||
@ -2846,8 +2858,8 @@ class PolylineObject extends Base {
|
||||
this.previous.positions = positionsLngLat
|
||||
|
||||
// this.entity.polyline.positionsLngLat = positionsLngLat
|
||||
let fromDegreesArray = this.renewPositions(this.options.positions, ()=>{
|
||||
if(this._positionEditingCallback) {
|
||||
let fromDegreesArray = this.renewPositions(this.options.positions, () => {
|
||||
if (this._positionEditingCallback) {
|
||||
this._positionEditingCallback()
|
||||
this._positionEditingCallback = null
|
||||
}
|
||||
@ -2958,7 +2970,7 @@ class PolylineObject extends Base {
|
||||
return this._lengthChangeCallBack
|
||||
}
|
||||
|
||||
set lengthChangeCallBack (cd) {
|
||||
set lengthChangeCallBack(cd) {
|
||||
this._lengthChangeCallBack = cd
|
||||
}
|
||||
|
||||
|
||||
@ -1440,6 +1440,10 @@ class SectorObject extends Base {
|
||||
center: this.deepCopyObj(this.options.center)
|
||||
}
|
||||
this.positionEditing = false
|
||||
if(this._positionEditingCallback) {
|
||||
this._positionEditingCallback()
|
||||
this._positionEditingCallback = null
|
||||
}
|
||||
})
|
||||
this.event.mouse_right((movement, cartesian) => {
|
||||
this.positionEditing = false
|
||||
@ -1520,7 +1524,8 @@ class SectorObject extends Base {
|
||||
this._areaChangeCallBack = cd
|
||||
}
|
||||
|
||||
static nodeEdit(that, cb = () => { }) {
|
||||
nodeEdit(cb = () => { }) {
|
||||
let that = this
|
||||
that.positionEditing = false
|
||||
if (YJ.Measure.GetMeasureStatus()) {
|
||||
} else {
|
||||
@ -1675,6 +1680,8 @@ class SectorObject extends Base {
|
||||
that.tip = null
|
||||
|
||||
that.heightMode = that.heightMode
|
||||
|
||||
cb('', {...that.options.center})
|
||||
})
|
||||
}, 200);
|
||||
async function createNodePoints(pos, type) {
|
||||
|
||||
@ -95,6 +95,7 @@ class TrajectoryMotion extends Base {
|
||||
this.options.line.noseToTail = options.line.noseToTail ? options.line.noseToTail : false
|
||||
this.positions_smooth = []
|
||||
this.options.ground = options.ground || false
|
||||
this.options.reverse = options.reverse || false
|
||||
this.options.state = (options.state || options.state === false) ? options.state : true
|
||||
this.options.routeDirection = (options.routeDirection || options.routeDirection === false) ? options.routeDirection : true
|
||||
this.keyPoints = []
|
||||
@ -618,13 +619,23 @@ class TrajectoryMotion extends Base {
|
||||
set delay(v) {
|
||||
this.options.delay = v
|
||||
if (this.TweenAnimate && this.TweenAnimate._isPlaying) {
|
||||
this.TweenAnimate.delay(this.delay)
|
||||
this.TweenAnimate.delay(this.delay*1000)
|
||||
}
|
||||
this._elms.delay && this._elms.delay.forEach((item) => {
|
||||
item.value = v
|
||||
})
|
||||
}
|
||||
|
||||
get reverse() {
|
||||
return this.options.reverse
|
||||
}
|
||||
|
||||
set reverse(v) {
|
||||
this.lineEdit = false
|
||||
this.options.reverse = v
|
||||
this.smooth = this.smooth
|
||||
}
|
||||
|
||||
get state() {
|
||||
return this.options.state
|
||||
}
|
||||
@ -646,10 +657,10 @@ class TrajectoryMotion extends Base {
|
||||
if (this.TweenAnimate.isPlaying()) {
|
||||
this.TweenAnimate.timeout = setTimeout(() => {
|
||||
this.TweenAnimate.resume()
|
||||
}, this.options.delay);
|
||||
}, this.options.delay*1000);
|
||||
}
|
||||
else {
|
||||
this.TweenAnimate.delay(this.delay).start()
|
||||
this.TweenAnimate.delay(this.delay*1000).start()
|
||||
}
|
||||
this.speed = this.speed
|
||||
}
|
||||
@ -1513,7 +1524,7 @@ class TrajectoryMotion extends Base {
|
||||
let HeadingPitchRoll2
|
||||
let previous = {}
|
||||
let m = 0
|
||||
this.TweenAnimate = new TWEEN.Tween({ distance: startDistance }).to({ distance: this.distance }, (totalTime - time) * 1000).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop ? Infinity : 0).onRepeat(() => {
|
||||
this.TweenAnimate = new TWEEN.Tween({ distance: startDistance }).to({ distance: this.distance }, (totalTime - time) * 1000).delay(this.delay*1000).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop ? Infinity : 0).onRepeat(() => {
|
||||
if (time || startDistance) {
|
||||
this.modelMove(positions)
|
||||
}
|
||||
@ -2457,10 +2468,13 @@ class TrajectoryMotion extends Base {
|
||||
|
||||
// 更新坐标
|
||||
renewLinePositions(pos) {
|
||||
let positions = pos
|
||||
let positions = [...pos]
|
||||
if (this.noseToTail) {
|
||||
positions = [...pos, pos[0]]
|
||||
}
|
||||
if(this.reverse) {
|
||||
positions.reverse()
|
||||
}
|
||||
let fromDegreesArrayHeights = []
|
||||
let time = []
|
||||
let positions_smooth = []
|
||||
|
||||
@ -1221,7 +1221,7 @@ class Tools {
|
||||
let pos3 = new Cesium.Cartesian3.fromDegrees(position.lng, position.lat);
|
||||
let position1
|
||||
try {
|
||||
position1 = await this.sdk.viewer.scene.clampToHeight(pos3, objectsToExclude) || pos3
|
||||
position1 = await this.sdk.viewer.scene.clampToHeight({x:pos3.x, y: pos3.y, z: pos3.z}, objectsToExclude) || pos3
|
||||
} catch (error) {
|
||||
position1 = pos3
|
||||
}
|
||||
|
||||
@ -49,6 +49,10 @@
|
||||
--color-text-shadow: rgba(20, 118, 255, 1);
|
||||
}
|
||||
|
||||
/* .cesium-viewer.\32 d{
|
||||
opacity: 0;
|
||||
} */
|
||||
|
||||
.cesium-viewer-cesiumWidgetContainer {
|
||||
position: relative;
|
||||
}
|
||||
@ -171,9 +175,14 @@
|
||||
|
||||
.YJ-custom-base-dialog button:not(button[disabled]):hover {
|
||||
border-color: rgba(var(--color-base1), 1) !important;
|
||||
color: rgba(var(--color-base1), 1) !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog button:not(button[disabled]):hover svg {
|
||||
fill: rgba(var(--color-base1), 1) !important;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog button:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
@ -279,6 +288,10 @@
|
||||
padding: 0px 24px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .el-tabs .el-tabs__header {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .div-item {
|
||||
/* border-top: 1px solid rgba(204, 204, 204, 0.2); */
|
||||
padding: 12px 0;
|
||||
@ -329,7 +342,7 @@
|
||||
|
||||
.YJ-custom-base-dialog>.content input,
|
||||
.YJ-custom-base-dialog>.content textarea {
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border: 1px solid rgba(var(--color-base1), 0.5);
|
||||
border-radius: 5px;
|
||||
@ -473,6 +486,9 @@
|
||||
.YJ-custom-base-dialog>.content .table .table-body .tr:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
.YJ-custom-base-dialog>.content .table .table-body .tr:last-child {
|
||||
border-bottom: 1px solid rgba(var(--color-base1), 0.5);
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table .table-empty {
|
||||
display: flex;
|
||||
@ -1772,7 +1788,7 @@
|
||||
|
||||
/* 轨迹运动 */
|
||||
.YJ-custom-base-dialog.trajectory-motion>.content {
|
||||
width: 550px;
|
||||
width: 562px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog.trajectory-motion>.content .div-item>.row>.col {
|
||||
@ -1801,6 +1817,10 @@
|
||||
|
||||
.YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active {
|
||||
border-color: rgba(var(--color-base1));
|
||||
color: rgba(var(--color-base1));
|
||||
}
|
||||
.YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active svg {
|
||||
fill: rgba(var(--color-base1));
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog.trajectory-motion>.content .btn-group .btn.is-active>span {
|
||||
@ -1826,7 +1846,6 @@
|
||||
.YJ-custom-base-dialog.trajectory-motion>.content .icon-rubric {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog.trajectory-motion>.content .custom__popper__arrow::after {
|
||||
@ -2516,8 +2535,8 @@
|
||||
.YJ-custom-base-dialog.polygon>.content .attribute-content-vr .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog.polygon>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.polygon>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
|
||||
flex: 0 0 165px;
|
||||
width: 165px;
|
||||
flex: 0 0 175px;
|
||||
width: 175px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@ -2600,8 +2619,8 @@
|
||||
.YJ-custom-base-dialog.assemble>.content .attribute-content-vr .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog.assemble>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.assemble>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
|
||||
flex: 0 0 165px;
|
||||
width: 165px;
|
||||
flex: 0 0 175px;
|
||||
width: 175px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@ -2660,8 +2679,8 @@
|
||||
.YJ-custom-base-dialog.pincerArrow>.content .attribute-content-vr .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog.pincerArrow>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.pincerArrow>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
|
||||
flex: 0 0 165px;
|
||||
width: 165px;
|
||||
flex: 0 0 175px;
|
||||
width: 175px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@ -2743,7 +2762,7 @@
|
||||
|
||||
/* 折线 */
|
||||
.YJ-custom-base-dialog.polyline>.content {
|
||||
width: 580px;
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog.polyline>.content>div #dashTextureDom {
|
||||
@ -3778,7 +3797,7 @@
|
||||
.yj-custom-icon {
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
height: 10px;
|
||||
height: 18px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user