This commit is contained in:
zh
2025-09-08 17:27:42 +08:00
parent b84a378ab9
commit d20db7c91b
7 changed files with 154 additions and 548 deletions

View File

@ -31,6 +31,8 @@ import YJColorPicker from "../Obj/Element/yj-color-picker";
class YJEarth {
#_requestAnimationFrameEventId = undefined
#_BillboardCollection
#_LabelCollection
/**
* @constructor
* @param div_id {string} 地球所在的dom id
@ -272,6 +274,34 @@ class YJEarth {
this.viewer.scene.fxaa = true
this.viewer.scene.postProcessStages.fxaa.enabled = true
this.viewer.scene.screenSpaceCameraController.enableCollisionDetection = true //true 禁止 false 允许
const BillboardCollection = this.viewer.scene.primitives.add(new Cesium.BillboardCollection({
scene: this.viewer.scene,
}));
const labelCollection = this.viewer.scene.primitives.add(new Cesium.LabelCollection({
scene: this.viewer.scene,
}));
this.#_BillboardCollection = BillboardCollection
this.#_LabelCollection = labelCollection
createCluster(this.viewer)
keyboardMapRoamingInit(this.viewer)
let a = Cesium.viewerCesiumNavigationMixin(this.viewer, {
@ -522,6 +552,13 @@ class YJEarth {
}
get collection() {
return {
billboard: this.#_BillboardCollection,
label: this.#_LabelCollection
}
}
destroy() {
cancelAnimationFrame(this.#_requestAnimationFrameEventId)
for (let [id, obj] of this.entityMap) {