军标库 模型库
This commit is contained in:
@ -15,7 +15,6 @@ import { setSplitDirection, syncSplitData, setActiveId, getSdk } from '../../../
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../../Global/global'
|
||||
|
||||
class Model extends BaseModel {
|
||||
#timeoutEventObject = null
|
||||
/**
|
||||
* @constructor
|
||||
* @description 加载模型
|
||||
@ -88,6 +87,7 @@ class Model extends BaseModel {
|
||||
console.warn("lat is required!")
|
||||
return
|
||||
}
|
||||
this._timeoutEventObject = null
|
||||
if (this.options.earth) {
|
||||
delete this.options.earth
|
||||
}
|
||||
@ -266,8 +266,8 @@ class Model extends BaseModel {
|
||||
}, this.entity)
|
||||
}
|
||||
this.entity.isMove = true
|
||||
clearTimeout(this.#timeoutEventObject)
|
||||
this.#timeoutEventObject = setTimeout(() => {
|
||||
clearTimeout(this._timeoutEventObject)
|
||||
this._timeoutEventObject = setTimeout(() => {
|
||||
this.entity && (this.entity.isMove = false)
|
||||
}, 500);
|
||||
})
|
||||
@ -304,8 +304,8 @@ class Model extends BaseModel {
|
||||
}, this.entity)
|
||||
}
|
||||
this.entity.isMove = true
|
||||
clearTimeout(this.#timeoutEventObject)
|
||||
this.#timeoutEventObject = setTimeout(() => {
|
||||
clearTimeout(this._timeoutEventObject)
|
||||
this._timeoutEventObject = setTimeout(() => {
|
||||
this.entity && (this.entity.isMove = false)
|
||||
}, 500);
|
||||
|
||||
@ -462,6 +462,16 @@ class Model extends BaseModel {
|
||||
this.options.url = this.options.url || ""
|
||||
}
|
||||
|
||||
get name() {
|
||||
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)
|
||||
}
|
||||
|
||||
get color() {
|
||||
return this.options.color
|
||||
}
|
||||
@ -1659,8 +1669,8 @@ class Model extends BaseModel {
|
||||
this.entity.minimumPixelSize = this.scaleByDistance ? undefined : this.options.minimumPixelSize
|
||||
this.editObj && this.editObj.update()
|
||||
this.entity.isMove = true
|
||||
clearTimeout(this.#timeoutEventObject)
|
||||
this.#timeoutEventObject = setTimeout(() => {
|
||||
clearTimeout(this._timeoutEventObject)
|
||||
this._timeoutEventObject = setTimeout(() => {
|
||||
this.entity && (this.entity.isMove = false)
|
||||
}, 500);
|
||||
}
|
||||
|
||||
@ -60,8 +60,8 @@ class GroundSvg extends Base {
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
#loadEvent = void 0
|
||||
#loaded = false
|
||||
// #loadEvent = void 0
|
||||
// #loaded = false
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
let jsCode = `
|
||||
@ -79,6 +79,9 @@ class GroundSvg extends Base {
|
||||
this.loaded = false;
|
||||
this.ismove = false;
|
||||
|
||||
this._loadEvent = void 0
|
||||
this._loaded = false
|
||||
|
||||
if (this.options.position.lat > 83.5) {
|
||||
this.options.position.lat = 83.5
|
||||
}
|
||||
@ -908,9 +911,9 @@ class GroundSvg extends Base {
|
||||
}
|
||||
}
|
||||
this.loaded = true
|
||||
this.#loaded = true
|
||||
if (this.#loadEvent) {
|
||||
this.#loadEvent()
|
||||
this._loaded = true
|
||||
if (this._loadEvent) {
|
||||
this._loadEvent()
|
||||
}
|
||||
this.scale = this.scale
|
||||
GroundSvg.createText(this)
|
||||
@ -954,7 +957,7 @@ class GroundSvg extends Base {
|
||||
* @param {boolean} status=false 状态
|
||||
*/
|
||||
async edit(state) {
|
||||
if (!this.#loaded) {
|
||||
if (!this._loaded) {
|
||||
return
|
||||
}
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
@ -1210,7 +1213,7 @@ class GroundSvg extends Base {
|
||||
* 重置
|
||||
*/
|
||||
reset() {
|
||||
if (!this.#loaded) {
|
||||
if (!this._loaded) {
|
||||
return
|
||||
}
|
||||
this.options = this.deepCopyObj(this.originalOptions)
|
||||
@ -1238,7 +1241,7 @@ class GroundSvg extends Base {
|
||||
* @param {boolean} status=false 状态
|
||||
*/
|
||||
drag(status, cd) {
|
||||
if (!this.#loaded || !this.sdk || !this.sdk.viewer) {
|
||||
if (!this._loaded || !this.sdk || !this.sdk.viewer) {
|
||||
return
|
||||
}
|
||||
this.ismove = false
|
||||
@ -1597,11 +1600,11 @@ class GroundSvg extends Base {
|
||||
|
||||
this.ScreenSpaceEventHandler.setInputAction((movement) => {
|
||||
this.drag(false)
|
||||
if (!this._DialogObject) {
|
||||
// if (!this._DialogObject) {
|
||||
cd && cd(this.options)
|
||||
syncData(this.sdk, this.options.id)
|
||||
syncSplitData(this.sdk, this.options.id)
|
||||
}
|
||||
// }
|
||||
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
|
||||
|
||||
this.pointEntityCollection = new Cesium.EntityCollection()
|
||||
@ -1706,7 +1709,7 @@ class GroundSvg extends Base {
|
||||
}
|
||||
|
||||
_updateGeojson(data, x, y) {
|
||||
if (!this.#loaded) {
|
||||
if (!this._loaded) {
|
||||
return
|
||||
}
|
||||
let width = Math.abs(this.bbox[0] - this.bbox[2])
|
||||
@ -1727,7 +1730,7 @@ class GroundSvg extends Base {
|
||||
}
|
||||
|
||||
_update() {
|
||||
if (!this.#loaded) {
|
||||
if (!this._loaded) {
|
||||
return
|
||||
}
|
||||
let point = turf.point([this.position.lng, this.position.lat]);
|
||||
@ -2110,11 +2113,11 @@ class GroundSvg extends Base {
|
||||
}
|
||||
|
||||
load(callback) {
|
||||
if (this.#loaded) {
|
||||
if (this._loaded) {
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
this.#loadEvent = callback
|
||||
this._loadEvent = callback
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user