12-17
This commit is contained in:
@ -35,7 +35,7 @@ class Profile extends Draw {
|
||||
let car = undefined
|
||||
that.event.mouse_left(async (movement, cartesian) => {
|
||||
try {
|
||||
that.tip.setText('左键点击确定终点位置,右键点击取消绘制!')
|
||||
that.tip.set_text('左键点击确定终点位置,右键点击取消绘制!')
|
||||
if (!that.entityHasCreated) {
|
||||
Profile.create_polyline(that)
|
||||
}
|
||||
|
||||
@ -1644,6 +1644,7 @@ class AssembleObject extends Base {
|
||||
let polygon = turf.polygon(points)
|
||||
let centroid = turf.pointOnFeature(polygon)
|
||||
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||
setTimeout(() => {
|
||||
this
|
||||
.getClampToHeight({
|
||||
lng: centroid.geometry.coordinates[0],
|
||||
@ -1656,6 +1657,7 @@ class AssembleObject extends Base {
|
||||
height
|
||||
]
|
||||
})
|
||||
}, 200);
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
@ -1757,6 +1757,7 @@ class AttackArrowObject extends Base {
|
||||
let polygon = turf.polygon(points)
|
||||
let centroid = turf.pointOnFeature(polygon)
|
||||
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||
setTimeout(() => {
|
||||
this
|
||||
.getClampToHeight({
|
||||
lng: centroid.geometry.coordinates[0],
|
||||
@ -1769,6 +1770,7 @@ class AttackArrowObject extends Base {
|
||||
height
|
||||
]
|
||||
})
|
||||
}, 200);
|
||||
|
||||
setTimeout(() => {
|
||||
this.event.mouse_left(leftEvent)
|
||||
|
||||
@ -466,7 +466,6 @@ class Model extends BaseModel {
|
||||
return this.options.name
|
||||
}
|
||||
set name(v) {
|
||||
console.log(v, 'vvvvvvvvv')
|
||||
this.options.name = v
|
||||
this.options.label.text = v
|
||||
this.label && (this.label.text = v)
|
||||
@ -506,14 +505,14 @@ class Model extends BaseModel {
|
||||
|
||||
set lng(v) {
|
||||
this.options.position = {
|
||||
lng: v,
|
||||
lng: Number(Number(v).toFixed(8)),
|
||||
lat: this.options.position.lat,
|
||||
alt: this.options.position.alt
|
||||
}
|
||||
this.updateModel(this.options.position.lng, this.options.position.lat, this.options.position.alt, this.options.rotate.x, this.options.rotate.y, this.options.rotate.z, this.options.scale)
|
||||
this.label && (this.label.position = [this.options.position.lng, this.options.position.lat, this.options.position.alt])
|
||||
this._elms.lng && this._elms.lng.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.position.lng
|
||||
})
|
||||
}
|
||||
|
||||
@ -524,13 +523,13 @@ class Model extends BaseModel {
|
||||
set lat(v) {
|
||||
this.options.position = {
|
||||
lng: this.options.position.lng,
|
||||
lat: v,
|
||||
lat: Number(Number(v).toFixed(8)),
|
||||
alt: this.options.position.alt
|
||||
}
|
||||
this.updateModel(this.options.position.lng, this.options.position.lat, this.options.position.alt, this.options.rotate.x, this.options.rotate.y, this.options.rotate.z, this.options.scale)
|
||||
this.label && (this.label.position = [this.options.position.lng, this.options.position.lat, this.options.position.alt])
|
||||
this._elms.lat && this._elms.lat.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.position.lat
|
||||
})
|
||||
}
|
||||
|
||||
@ -542,12 +541,12 @@ class Model extends BaseModel {
|
||||
this.options.position = {
|
||||
lng: this.options.position.lng,
|
||||
lat: this.options.position.lat,
|
||||
alt: v
|
||||
alt: Number(Number(v).toFixed(2))
|
||||
}
|
||||
this.updateModel(this.options.position.lng, this.options.position.lat, this.options.position.alt, this.options.rotate.x, this.options.rotate.y, this.options.rotate.z, this.options.scale)
|
||||
this.label && (this.label.position = [Number(this.options.position.lng), Number(this.options.position.lat), Number(this.options.position.alt)])
|
||||
this._elms.alt && this._elms.alt.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.position.alt
|
||||
})
|
||||
}
|
||||
|
||||
@ -593,10 +592,10 @@ class Model extends BaseModel {
|
||||
}
|
||||
|
||||
set rotateX(v) {
|
||||
this.options.rotate.x = v
|
||||
this.options.rotate.x = Number(Number(v).toFixed(2))
|
||||
this.updateModel(this.options.position.lng, this.options.position.lat, this.options.position.alt, this.options.rotate.x, this.options.rotate.y, this.options.rotate.z, this.options.scale)
|
||||
this._elms.rotateX && this._elms.rotateX.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.rotate.x
|
||||
})
|
||||
}
|
||||
|
||||
@ -605,10 +604,10 @@ class Model extends BaseModel {
|
||||
}
|
||||
|
||||
set rotateY(v) {
|
||||
this.options.rotate.y = v
|
||||
this.options.rotate.y = Number(Number(v).toFixed(2))
|
||||
this.updateModel(this.options.position.lng, this.options.position.lat, this.options.position.alt, this.options.rotate.x, this.options.rotate.y, this.options.rotate.z, this.options.scale)
|
||||
this._elms.rotateY && this._elms.rotateY.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.rotate.y
|
||||
})
|
||||
}
|
||||
|
||||
@ -617,10 +616,10 @@ class Model extends BaseModel {
|
||||
}
|
||||
|
||||
set rotateZ(v) {
|
||||
this.options.rotate.z = v
|
||||
this.options.rotate.z = Number(Number(v).toFixed(2))
|
||||
this.updateModel(this.options.position.lng, this.options.position.lat, this.options.position.alt, this.options.rotate.x, this.options.rotate.y, this.options.rotate.z, this.options.scale)
|
||||
this._elms.rotateZ && this._elms.rotateZ.forEach((item) => {
|
||||
item.value = v
|
||||
item.value = this.options.rotate.z
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -127,7 +127,8 @@ class BaseTileset extends BaseSource {
|
||||
progressiveResolutionHeightFraction: 0.5, // 数值偏于0能够让初始加载变得模糊
|
||||
dynamicScreenSpaceErrorDensity: 0.1, // 数值加大,能让周边加载变快
|
||||
dynamicScreenSpaceErrorFactor: 1,
|
||||
dynamicScreenSpaceError: true // 有了这个后,会在真正的全屏加载完之后才清晰化房屋
|
||||
dynamicScreenSpaceError: true, // 有了这个后,会在真正的全屏加载完之后才清晰化房屋
|
||||
backFaceCulling: false, // 开启后,会剔除掉模型的背面,提升性能体验
|
||||
}
|
||||
let tileset
|
||||
if (Number(Cesium.VERSION.split('.')[1]) >= 107) {
|
||||
|
||||
@ -72,6 +72,9 @@ class BatchModel extends Base {
|
||||
break;
|
||||
}
|
||||
Draw && Draw.start((a, positions) => {
|
||||
if(!positions) {
|
||||
return
|
||||
}
|
||||
this.options.positions = positions;
|
||||
//判断范围是否过大
|
||||
if (options.type == '面') {
|
||||
@ -156,8 +159,8 @@ class BatchModel extends Base {
|
||||
})
|
||||
})
|
||||
} else if (that.options.type == '点') {
|
||||
let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
|
||||
posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: height }]
|
||||
// let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
|
||||
posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: that.options.positions.alt }]
|
||||
// posiArr = [that.options.positions]
|
||||
that.pointArr = posiArr
|
||||
}
|
||||
|
||||
@ -1509,7 +1509,7 @@ class CircleObject extends Base {
|
||||
height
|
||||
]
|
||||
})
|
||||
}, 50);
|
||||
}, 200);
|
||||
|
||||
setTimeout(() => {
|
||||
this.event.mouse_left((movement, cartesian) => {
|
||||
|
||||
@ -1575,6 +1575,7 @@ class EllipseObject extends Base {
|
||||
})
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
that.getClampToHeight({
|
||||
lng: that.center.lng,
|
||||
lat: that.center.lat
|
||||
@ -1585,6 +1586,7 @@ class EllipseObject extends Base {
|
||||
height
|
||||
])
|
||||
})
|
||||
}, 200);
|
||||
createNodePoints(positions[0], 'semiMajorAxis')
|
||||
createNodePoints(positions[(length - 2) / 4], 'semiMinorAxis')
|
||||
createNodePoints(positions[(length - 2) / 2], 'semiMajorAxis')
|
||||
|
||||
@ -1686,6 +1686,7 @@ class PincerArrowObject extends Base {
|
||||
let polygon = turf.polygon(points)
|
||||
let centroid = turf.pointOnFeature(polygon)
|
||||
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||
setTimeout(() => {
|
||||
this
|
||||
.getClampToHeight({
|
||||
lng: centroid.geometry.coordinates[0],
|
||||
@ -1698,6 +1699,7 @@ class PincerArrowObject extends Base {
|
||||
height
|
||||
]
|
||||
})
|
||||
}, 200);
|
||||
createNodePoints()
|
||||
}, 200);
|
||||
async function createNodePoints() {
|
||||
|
||||
@ -1731,6 +1731,7 @@ class PolygonObject extends Base {
|
||||
|
||||
let added = false
|
||||
let leftEvent = async (movement, cartesian) => {
|
||||
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||
if (selectPoint) {
|
||||
this.options.positions[selectPoint.index] = this.cartesian3Towgs84(
|
||||
cartesian,
|
||||
@ -1739,7 +1740,7 @@ class PolygonObject extends Base {
|
||||
originalPosition = this.options.positions[selectPoint.index]
|
||||
added = true
|
||||
let potHeight = await this.getClampToHeight(
|
||||
this.options.positions[selectPoint.index]
|
||||
this.options.positions[selectPoint.index], objectsToExclude
|
||||
)
|
||||
let entity = this.sdk.viewer.entities.add({
|
||||
name: 'node-secondary-edit-point',
|
||||
@ -1773,7 +1774,6 @@ class PolygonObject extends Base {
|
||||
)
|
||||
newpositions = Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)
|
||||
|
||||
let objectsToExclude = [...this.sdk.viewer.entities.values]
|
||||
if (this.options.positions.length < 3) {
|
||||
this
|
||||
.getClampToHeight({
|
||||
@ -1966,6 +1966,7 @@ class PolygonObject extends Base {
|
||||
])
|
||||
let polygon = turf.polygon(positions)
|
||||
let centroid = turf.centroid(polygon)
|
||||
setTimeout(() => {
|
||||
this
|
||||
.getClampToHeight({
|
||||
lng: centroid.geometry.coordinates[0],
|
||||
@ -1978,6 +1979,7 @@ class PolygonObject extends Base {
|
||||
height
|
||||
]
|
||||
})
|
||||
}, 200);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
@ -1597,6 +1597,7 @@ class SectorObject extends Base {
|
||||
that.cartesian3Towgs84(positions[positions.length - 4], that.sdk.viewer)
|
||||
]
|
||||
let objectsToExclude = [...that.sdk.viewer.entities.values]
|
||||
setTimeout(() => {
|
||||
that
|
||||
.getClampToHeight({
|
||||
lng: that.options.center.lng,
|
||||
@ -1609,6 +1610,7 @@ class SectorObject extends Base {
|
||||
height
|
||||
]
|
||||
})
|
||||
}, 200);
|
||||
setTimeout(() => {
|
||||
createNodePoints(positions[1], 'sector-start')
|
||||
createNodePoints(positions[positions.length - 4], 'sector-end')
|
||||
|
||||
@ -2191,6 +2191,7 @@ class StraightArrowObject extends Base {
|
||||
let polygon = turf.polygon(points)
|
||||
let centroid = turf.pointOnFeature(polygon)
|
||||
let objectsToExclude = [...that.sdk.viewer.entities.values]
|
||||
setTimeout(() => {
|
||||
that
|
||||
.getClampToHeight({
|
||||
lng: centroid.geometry.coordinates[0],
|
||||
@ -2203,6 +2204,7 @@ class StraightArrowObject extends Base {
|
||||
height
|
||||
]
|
||||
})
|
||||
}, 200);
|
||||
createNodePoints()
|
||||
}, 200);
|
||||
async function createNodePoints() {
|
||||
|
||||
@ -615,14 +615,14 @@ class StandText extends Base {
|
||||
if(isAdd) {
|
||||
this.options.positions.splice(selectPoint.index, 1)
|
||||
}
|
||||
if (!that.options.positions || that.options.positions.length < 2) {
|
||||
if (!this.options.positions || this.options.positions.length < 2) {
|
||||
console.warn('最少需要两个坐标!')
|
||||
window.ELEMENT && window.ELEMENT.Message({
|
||||
message: '最少需要两个坐标!',
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
});
|
||||
that.options.positions = [...previous]
|
||||
this.options.positions = [...previous]
|
||||
}
|
||||
cb(null, this.options.positions)
|
||||
}
|
||||
|
||||
@ -642,7 +642,7 @@ class TrajectoryMotion extends Base {
|
||||
set state(v) {
|
||||
this.options.state = v
|
||||
cancelAnimationFrame(this._requestAnimationFrameEventId)
|
||||
if (this.editObj) {
|
||||
if (this.options.state && this.editObj) {
|
||||
this.editObj.destroy()
|
||||
this.editObj = null
|
||||
if (this._DialogObject && this._DialogObject._element && this._DialogObject._element.content) {
|
||||
@ -1573,11 +1573,15 @@ class TrajectoryMotion extends Base {
|
||||
animateUpdate
|
||||
)
|
||||
if (_this.options.firstPersonView) {
|
||||
let targetHeading = _this.model.heading + 90 + _this.firstPersonHeadingPitch.heading
|
||||
if(!_this.routeDirection) {
|
||||
targetHeading = 180 - targetHeading
|
||||
}
|
||||
let positionCamera = { ..._this.sdk.viewer.camera._position }
|
||||
_this.sdk.viewer.camera.setView({
|
||||
destination: positionCamera,
|
||||
orientation: {
|
||||
heading: Cesium.Math.toRadians(_this.model.heading + 90 + _this.firstPersonHeadingPitch.heading),
|
||||
heading: Cesium.Math.toRadians(targetHeading),
|
||||
pitch: Cesium.Math.toRadians(_this.firstPersonHeadingPitch.pitch),
|
||||
roll: 0
|
||||
}
|
||||
@ -1805,10 +1809,14 @@ class TrajectoryMotion extends Base {
|
||||
if (_this.viewFollow) {
|
||||
// console.log(Cesium.Math.toDegrees(_this.sdk.viewer.camera.pitch))
|
||||
if (_this.options.firstPersonView) {
|
||||
let targetHeading = heading + 90 + _this.firstPersonHeadingPitch.heading
|
||||
if(!_this.routeDirection) {
|
||||
targetHeading = 180 - targetHeading
|
||||
}
|
||||
_this.sdk.viewer.camera.setView({
|
||||
destination: positionCamera,
|
||||
orientation: {
|
||||
heading: Cesium.Math.toRadians(heading + 90 + _this.firstPersonHeadingPitch.heading),
|
||||
heading: Cesium.Math.toRadians(targetHeading),
|
||||
pitch: Cesium.Math.toRadians(_this.firstPersonHeadingPitch.pitch),
|
||||
roll: 0
|
||||
}
|
||||
@ -2296,6 +2304,7 @@ class TrajectoryMotion extends Base {
|
||||
this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].innerHTML = '开始调整'
|
||||
this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].className = 'btn model-rotate-btn'
|
||||
}
|
||||
return false
|
||||
}
|
||||
else {
|
||||
if (this.viewFollow) {
|
||||
@ -2344,6 +2353,8 @@ class TrajectoryMotion extends Base {
|
||||
Cesium.Matrix4.multiply(originalMatrix, rotationY, originalMatrix)
|
||||
Cesium.Matrix4.multiply(originalMatrix, rotationZ, this.entity.modelMatrix)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@ -2384,7 +2395,7 @@ class TrajectoryMotion extends Base {
|
||||
// maximumScale: 100000,
|
||||
}
|
||||
const getAnimationsList = () => {
|
||||
if (this.options.model.url === this.originalOptions.model.url) {
|
||||
if (this.originalOptions && this.options.model.url === this.originalOptions.model.url) {
|
||||
this.modelAnimate = this.originalOptions.model.animate
|
||||
}
|
||||
else {
|
||||
|
||||
@ -1342,7 +1342,7 @@ class WallRealStereoscopic extends Base {
|
||||
}
|
||||
|
||||
material = new Cesium.CustomMaterialSource({
|
||||
image: this.getSourceRootPath() + `/img/material/${img}.png`,
|
||||
image: this.getSourceRootPath() + `/img/material/${img}.jpg`,
|
||||
color: this.options.color,
|
||||
is2D: false,
|
||||
repeats: new Cesium.CallbackProperty(() => {
|
||||
|
||||
@ -8,7 +8,7 @@ let fontData = [
|
||||
{
|
||||
name: '思源黑体',
|
||||
value: '思源黑体',
|
||||
font: 'SourceHanSansTi',
|
||||
font: 'SourceHanSansTiM',
|
||||
key: '1'
|
||||
},
|
||||
{
|
||||
|
||||
@ -200,7 +200,7 @@ class YJEarth {
|
||||
let fontData = [
|
||||
{
|
||||
name: '思源黑体',
|
||||
value: 'SourceHanSansTi',
|
||||
value: 'SourceHanSansTiM',
|
||||
url: tools.getSourceRootPath() + '/custom/fonts/SourceHanSansCN-Medium.otf',
|
||||
format: 'opentype'
|
||||
},
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'SourceHanSansTi';
|
||||
font-family: 'SourceHanSansTiM';
|
||||
src: url('../fonts/SourceHanSansCN-Medium.otf') format('opentype');
|
||||
}
|
||||
|
||||
@ -528,6 +528,7 @@
|
||||
overflow-y: auto;
|
||||
scrollbar-gutter: stable;
|
||||
width: calc(100% + 1px);
|
||||
max-height: 233px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table .align-center,
|
||||
|
||||
Reference in New Issue
Block a user