合并
This commit is contained in:
@ -13,7 +13,6 @@ import { syncSplitData } from '../../../../../Global/SplitScreen'
|
||||
import Dialog from '../../../../Element/Dialog';
|
||||
|
||||
class Tileset extends BaseTileset {
|
||||
#updateModelTimeout;
|
||||
/**
|
||||
* @constructor
|
||||
* @description 加载Tileset模型
|
||||
@ -199,7 +198,26 @@ class Tileset extends BaseTileset {
|
||||
this.oldData.type = this.type
|
||||
this.oldData.accuracy = this.newData.accuracy
|
||||
this._DialogObject.close()
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack({ ...this.oldData, type: this.type })
|
||||
let newOptions = {
|
||||
id: this.newData.id,
|
||||
name: this.newData.name,
|
||||
height: this.newData.height,
|
||||
accuracy: this.newData.accuracy,
|
||||
transparency: this.newData.transparency,
|
||||
scale: this.newData.scale,
|
||||
url: this.newData.url,
|
||||
orientation: {
|
||||
roll: this.newData.roll,
|
||||
heading: this.newData.heading,
|
||||
pitch: this.newData.pitch
|
||||
},
|
||||
position: {
|
||||
lng: this.newData.lng,
|
||||
lat: this.newData.lat,
|
||||
alt: this.newData.height
|
||||
}
|
||||
}
|
||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack({ ...newOptions })
|
||||
syncSplitData(this.sdk, this.oldData.id)
|
||||
},
|
||||
resetCallBack: () => {
|
||||
@ -308,9 +326,9 @@ class Tileset extends BaseTileset {
|
||||
}
|
||||
this.editObj && this.editObj.update()
|
||||
|
||||
clearTimeout(this.#updateModelTimeout)
|
||||
this.#updateModelTimeout = setTimeout(() => {
|
||||
clearTimeout(this.#updateModelTimeout)
|
||||
clearTimeout(this._updateModelTimeout)
|
||||
this._updateModelTimeout = setTimeout(() => {
|
||||
clearTimeout(this._updateModelTimeout)
|
||||
let center = this.cartesian3Towgs84(this.entity.boundingSphere.center, this.sdk.viewer)
|
||||
let circle = turf.circle([center.lng, center.lat], this.entity.boundingSphere.radius / 1000, { steps: 360, units: 'kilometers' });
|
||||
for (let [key, entity] of this.sdk.entityMap) {
|
||||
|
||||
@ -32,6 +32,8 @@ class BaseTileset extends BaseSource {
|
||||
* */
|
||||
constructor(sdk, options) {
|
||||
super(sdk, options);
|
||||
this._loadEvent = void 0
|
||||
this._loaded = false
|
||||
this.setDefaultValue()
|
||||
this.watchs = []
|
||||
this.positionCallBack = null
|
||||
@ -40,6 +42,7 @@ class BaseTileset extends BaseSource {
|
||||
this._DialogObject = null
|
||||
this._element_style = null
|
||||
this.options.accuracy = options.accuracy ? Number(options.accuracy.toFixed(1)) : 1
|
||||
this.options.orientation = this.options.orientation || {}
|
||||
this.options.position = this.options.position || {}
|
||||
this.oldData = {
|
||||
id: this.options.id,
|
||||
@ -51,9 +54,9 @@ class BaseTileset extends BaseSource {
|
||||
lng: this.options.position.lng,
|
||||
lat: this.options.position.lat,
|
||||
scale: (this.options.scale || this.options.scale === 0) ? this.options.scale : 1,
|
||||
roll: this.options.roll || 0,
|
||||
heading: this.options.heading || 0,
|
||||
pitch: this.options.pitch || 0
|
||||
roll: this.options.orientation.roll || 0,
|
||||
heading: this.options.orientation.heading || 0,
|
||||
pitch: this.options.orientation.pitch || 0
|
||||
}
|
||||
this.newData = {
|
||||
id: this.options.id,
|
||||
@ -65,9 +68,9 @@ class BaseTileset extends BaseSource {
|
||||
lng: this.options.position.lng,
|
||||
lat: this.options.position.lat,
|
||||
scale: (this.options.scale || this.options.scale === 0) ? this.options.scale : 1,
|
||||
roll: this.options.roll || 0,
|
||||
heading: this.options.heading || 0,
|
||||
pitch: this.options.pitch || 0
|
||||
roll: this.options.orientation.roll || 0,
|
||||
heading: this.options.orientation.heading || 0,
|
||||
pitch: this.options.orientation.pitch || 0
|
||||
}
|
||||
this.tileset = undefined
|
||||
this.editObj = new Controller(this.sdk)
|
||||
@ -367,6 +370,12 @@ class BaseTileset extends BaseSource {
|
||||
this.pitch = this.oldData.pitch
|
||||
this.transparency = this.oldData.transparency
|
||||
|
||||
this.loaded = true
|
||||
this._loaded = true
|
||||
if (this._loadEvent) {
|
||||
this._loadEvent(this.entity)
|
||||
}
|
||||
|
||||
syncSplitData(this.sdk, this.options.id)
|
||||
|
||||
regMoveCallback(this.entity.id, this.mouseMoveCB, this)
|
||||
@ -620,6 +629,15 @@ class BaseTileset extends BaseSource {
|
||||
console.error("参数必须为boolean")
|
||||
}
|
||||
}
|
||||
|
||||
load(callback) {
|
||||
if (this._loaded) {
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
this._loadEvent = callback
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default BaseTileset
|
||||
|
||||
Reference in New Issue
Block a user