earthsdk3-cesium 3.6.0-beta.111 → 3.6.0-beta.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +3 -3
- package/dist/earthsdk3-cesium.js +27 -9
- package/dist/earthsdk3-cesium.umd.cjs +3 -3
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/AvoidanceManager.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3842,7 +3842,7 @@ return material;
|
|
|
3842
3842
|
material.alpha = fragColor.a;
|
|
3843
3843
|
|
|
3844
3844
|
return material;
|
|
3845
|
-
}`},translucent:!0}),h3(),A3(),f3(),g3(),y3(),v3(),w3(),c3(),F3(),M3(),R3(),nN(),b.Camera.DEFAULT_VIEW_RECTANGLE=b.Rectangle.fromDegrees(70,5,140,55);function oH(){return new Promise((t,n)=>b.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class sH extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Ot(s);if(l&&(l.destroy(),Qv(s,void 0)),b.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=u3;await s.promise(oH());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=b.JulianDate.fromDate(new Date(e.currentTime));b.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=b.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new dE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const aH=new b.EllipsoidTerrainProvider;class aE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??aH}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class lE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class lH extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class uH extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class cH extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new uH(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class hH extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new cH(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class uE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new lH(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new hH(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class cE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof b.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof b.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&b.defined(i.scene.globe)&&(m=await AH(i,Ze(A)));let v;if(m&&m instanceof b.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof b.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof b.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new b.JulianDate;_=m.id instanceof b.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new b.JulianDate;if(!m.id.entityCollection)return;const F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",S=((I=m.id.properties)==null?void 0:I.getValue(D))??{},T=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(w=>De(w)):_d(m.id.polygon.hierarchy.getValue(D));_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function AH(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(b.defined(o))return o}class fH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Ot(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function dH(t){const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const e=n.getBoundingClientRect();return document.body.removeChild(n),{width:e.width,height:e.height}}const hE=["label","billboard","rectangle"];class pH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",b.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class mH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a),l=this.screenManager.labelCollection.add({...i,position:a,id:r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a),l=this.screenManager.billboardCollection.add({...i,position:a,id:r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=rt(o.position),l=this.getOrCreateObject(a,s),u=this.screenManager.rectangleCollection.add({...dH(i.element),...i,id:a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of hE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(this.screenManager.labelCollection.remove(r.label),r.label=void 0),r.billboard&&(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0),r.rectangle&&(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new pH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function gH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&hE.includes(i)){const o=n[i];if(!o)continue;const r=o.computeScreenSpacePosition(t.scene);let a=b[o instanceof b.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}return new b.Rectangle(...e)}class yH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new b.RectangleCollisionChecker);L(this,"screenManager");L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,i){i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=b.Cartesian3.distanceSquared(i,r),l=b.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=b.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=b.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=b.Cartesian3.clone(e.position);let a;o&&b.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6)?a=o.rect:(a=gH(this.screenManager.viewer,e),this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})),this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class AE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class fE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new AE));L(this,"canvasCollection",this.ad(new AE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new yH(this)),this.labelCollection=new b.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new b.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new mH(this),this.layers.set(e,i)),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Ot(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class dE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new uE(this.viewer)),this._terrainManager=this.dv(new aE(this.viewer)),this._labelManager=this.dv(new lE(this.viewer)),this._poiContext=this.disposeVar(new N0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new fH(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new cE(i)),this._screenManager=this.ad(new fE(i)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var pE=new b.Cartesian3,mE=new b.Cartesian3;function gE(t,n,e){let i=b.Matrix4.clone(t.transform);t.lookAtTransform(b.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=b.Cartesian3.normalize(r,pE),s=b.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=b.Cartesian3.cross(t.direction,a,mE);else var l=b.Cartesian3.cross(t.up,a,mE);var u=l;if(e){var A=b.Cartesian3.cross(a,l,pE);u=A}var h=b.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;b.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function yE(t,n){gE(t,n,!1)}function vE(t,n){gE(t,-n,!0)}class vH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&yE(r,A*h),a.MoveBackword&&yE(r,-A*h),a.MoveLeft&&vE(r,-A*h),a.MoveRight&&vE(r,A*h));{const{rotateSpeed:f}=this.controller,p=b.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Yf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3845
|
+
}`},translucent:!0}),h3(),A3(),f3(),g3(),y3(),v3(),w3(),c3(),F3(),M3(),R3(),nN(),b.Camera.DEFAULT_VIEW_RECTANGLE=b.Rectangle.fromDegrees(70,5,140,55);function oH(){return new Promise((t,n)=>b.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class sH extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Ot(s);if(l&&(l.destroy(),Qv(s,void 0)),b.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=u3;await s.promise(oH());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=b.JulianDate.fromDate(new Date(e.currentTime));b.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=b.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new dE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const aH=new b.EllipsoidTerrainProvider;class aE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??aH}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class lE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class lH extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class uH extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class cH extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new uH(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class hH extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new cH(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class uE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new lH(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new hH(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class cE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof b.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof b.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&b.defined(i.scene.globe)&&(m=await AH(i,Ze(A)));let v;if(m&&m instanceof b.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof b.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof b.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new b.JulianDate;_=m.id instanceof b.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new b.JulianDate;if(!m.id.entityCollection)return;const F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",S=((I=m.id.properties)==null?void 0:I.getValue(D))??{},T=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(w=>De(w)):_d(m.id.polygon.hierarchy.getValue(D));_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function AH(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(b.defined(o))return o}class fH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Ot(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function dH(t){const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const e=n.getBoundingClientRect();return document.body.removeChild(n),{width:e.width,height:e.height}}const hE=["label","billboard","rectangle"];class pH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",b.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class mH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.label)return r;const l=this.screenManager.labelCollection.add({...i,position:a,id:r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.billboard)return r;const l=this.screenManager.billboardCollection.add({...i,position:a,id:r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=rt(o.position),l=this.getOrCreateObject(a,s);if(l.rectangle)return a;const u=this.screenManager.rectangleCollection.add({...dH(i.element),...i,id:a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of hE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(this.screenManager.labelCollection.remove(r.label),r.label=void 0),r.billboard&&(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0),r.rectangle&&(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new pH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function gH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&hE.includes(i)){const o=n[i];if(!o)continue;const r=o.computeScreenSpacePosition(t.scene);let a=b[o instanceof b.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}return new b.Rectangle(...e)}class yH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new b.RectangleCollisionChecker);L(this,"screenManager");L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,i){i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=b.Cartesian3.distanceSquared(i,r),l=b.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=b.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=b.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=b.Cartesian3.clone(e.position);let a;if(o&&b.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6))a=o.rect,this.rectangleCollisionCheck.remove(i,a);else{if(a=gH(this.screenManager.viewer,e),isNaN(a.width)||isNaN(a.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class AE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class fE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new AE));L(this,"canvasCollection",this.ad(new AE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new yH(this)),this.labelCollection=new b.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new b.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new mH(this),this.layers.set(e,i)),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Ot(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class dE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new uE(this.viewer)),this._terrainManager=this.dv(new aE(this.viewer)),this._labelManager=this.dv(new lE(this.viewer)),this._poiContext=this.disposeVar(new N0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new fH(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new cE(i)),this._screenManager=this.ad(new fE(i)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var pE=new b.Cartesian3,mE=new b.Cartesian3;function gE(t,n,e){let i=b.Matrix4.clone(t.transform);t.lookAtTransform(b.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=b.Cartesian3.normalize(r,pE),s=b.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=b.Cartesian3.cross(t.direction,a,mE);else var l=b.Cartesian3.cross(t.up,a,mE);var u=l;if(e){var A=b.Cartesian3.cross(a,l,pE);u=A}var h=b.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;b.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function yE(t,n){gE(t,n,!1)}function vE(t,n){gE(t,-n,!0)}class vH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&yE(r,A*h),a.MoveBackword&&yE(r,-A*h),a.MoveLeft&&vE(r,-A*h),a.MoveRight&&vE(r,A*h));{const{rotateSpeed:f}=this.controller,p=b.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Yf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3846
3846
|
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class wH extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Yf(this)),this._cameraOp=this.dv(new vH(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const od=class od extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(od.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new wH(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(od,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let Jf=od;function bH(t,n){t.lookRight(b.Math.toRadians(n.movementX)*.1),t.lookDown(b.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=b.Math.clamp(e,-b.Math.PI_OVER_TWO,b.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class xH extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;bH(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const sd=class sd extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new xH(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=sd.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(sd,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=sd;class _H extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class CH extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new _H(this)));L(this,"_keyboardCameraController",this.dv(new Jf(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function wE(t){t.removeInputAction(b.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(b.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new b.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new b.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let p=b.Cartesian3.dot(h,f);p<1&&(A=Math.acos(p)),A=n.startPosition.x>n.endPosition.x?A:-A;const d=e._horizontalRotationAxis;if(b.defined(i)?r.look(i,-A):b.defined(d)?r.look(d,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,!(!l||!u))if(r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),p=b.Cartesian3.dot(h,f),p<1&&(A=Math.acos(p)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??d,b.defined(i)){const m=r.direction,v=b.Cartesian3.negate(i,new b.Cartesian3),y=b.Cartesian3.equalsEpsilon(m,i,b.Math.EPSILON2),g=b.Cartesian3.equalsEpsilon(m,v,b.Math.EPSILON2);if(!y&&!g){p=b.Cartesian3.dot(m,i);let _=b.Math.acosClamped(p);A>0&&A>_&&(A=_-b.Math.EPSILON4),p=b.Cartesian3.dot(m,v),_=b.Math.acosClamped(p),A<0&&-A>_&&(A=-_+b.Math.EPSILON4);const x=b.Cartesian3.cross(i,m,new b.Cartesian3);r.look(x,A)}else(y&&A<0||g&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class SH extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=rt(n.position),f=i.camera.positionWC,p=b.Cartesian3.distance(h,f);n.viewDistance=p}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new SH(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=gs(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class xu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new aa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new EH(this,e);if(this.lineMode==="manual")return new PH(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(xu||(xu={})),c.extendClassProps(xu.prototype,xu.createDefaultProps);class EH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class PH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class BH extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class TH extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new BH(r,e)}))}}class _u extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new TH(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(_u||(_u={})),c.extendClassProps(_u.prototype,_u.createDefaultProps);class IH extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new b.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},b.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:b.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*b.Math.PI*2/this.cycle;e.setView({destination:b.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class FH extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new IH(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class MH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new b.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new b.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=b.Cartesian3.fromDegrees(...this.position);a&&(this._transform=b.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=b.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=b.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new b.Cartesian3(0,i,o);e.flyTo({destination:b.Matrix4.multiplyByPoint(this._transform,r,new b.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*b.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new b.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(b.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class DH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new MH(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class RH extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new CH(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=Jf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new FH(e)),this._rotatePoint=this.dv(new DH(e)),this._followController=this.dv(new _u(e)),this._pathCameraController=this.dv(new xu(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=b.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const p=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||p==!1?[0]:p.map(d=>d/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new b.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&wE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&wE(o),r.lookEventTypes=b.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=b.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[b.CameraEventType.MIDDLE_DRAG,b.CameraEventType.PINCH,{eventType:b.CameraEventType.LEFT_DRAG,modifier:b.KeyboardEventModifier.CTRL},{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.CTRL}],r.translateEventTypes=b.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[b.CameraEventType.WHEEL,b.CameraEventType.PINCH,{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.SHIFT}])}}const UH=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class OH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new b.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:rt(s.position)});(()=>{o.removeAll();for(let s of UH)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Cu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(b.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Cu||(Cu={})),c.extendClassProps(Cu.prototype,Cu.createDefaultProps);const LH=`
|
|
3847
3847
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
3848
3848
|
{
|
|
@@ -4142,10 +4142,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4142
4142
|
`;function P7(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4143
4143
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4144
4144
|
gitee地址:${t}
|
|
4145
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",$f);L(this,"_moveObjectsProcess",this.ad(jS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new i3(this)),this.ad(new r3(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new l3(this)})),this._viewerLegend=this.dv(new b7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new sH(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ot(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:b.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(rt(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof b.Cartesian3?e:rt(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",E7,S7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",P7),L(Gt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",a3),L(Gt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(Gt,"getHeightsScartchCarto",new b.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...C7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.111",e="2025-11-04T00:57:31.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="e01e606acce477f3ffb79a237b21982a606516f4",s=((Date.now()-1762217851e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4145
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",$f);L(this,"_moveObjectsProcess",this.ad(jS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new i3(this)),this.ad(new r3(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new l3(this)})),this._viewerLegend=this.dv(new b7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new sH(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ot(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:b.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(rt(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof b.Cartesian3?e:rt(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",E7,S7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",P7),L(Gt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",a3),L(Gt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(Gt,"getHeightsScartchCarto",new b.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...C7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.112",e="2025-11-04T07:08:24.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="f414a145e6204a2d8a0b511ec4636c035d8718a6",s=((Date.now()-1762240104e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4146
4146
|
%c${o?o+`
|
|
4147
4147
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4148
|
-
`;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4148
|
+
`;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f414a145e6204a2d8a0b511ec4636c035d8718a6")},get info(){return l},get date(){return"2025-11-04T07:08:24.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.112"},get name(){return"earthsdk3-cesium"},get commitId(){return"f414a145e6204a2d8a0b511ec4636c035d8718a6"},print(){console.info(this.info,`
|
|
4149
4149
|
font-size: 18px;
|
|
4150
4150
|
font-weight: 1000;
|
|
4151
4151
|
line-height: 1;
|
package/dist/earthsdk3-cesium.js
CHANGED
|
@@ -46726,7 +46726,10 @@ class P5 extends F {
|
|
|
46726
46726
|
* 4. 绑定响应式变量以支持动态更新
|
|
46727
46727
|
*/
|
|
46728
46728
|
addLabel(e, s, o) {
|
|
46729
|
-
const n = this.makeScreenObjectId(e, o.index ?? We()), r = Xe(o.position), a = this.getOrCreateObject(n, r)
|
|
46729
|
+
const n = this.makeScreenObjectId(e, o.index ?? We()), r = Xe(o.position), a = this.getOrCreateObject(n, r);
|
|
46730
|
+
if (a.label)
|
|
46731
|
+
return n;
|
|
46732
|
+
const l = this.screenManager.labelCollection.add({
|
|
46730
46733
|
...s,
|
|
46731
46734
|
position: r,
|
|
46732
46735
|
id: n,
|
|
@@ -46747,7 +46750,10 @@ class P5 extends F {
|
|
|
46747
46750
|
* 4. 绑定响应式变量以支持动态更新
|
|
46748
46751
|
*/
|
|
46749
46752
|
addImage(e, s, o) {
|
|
46750
|
-
const n = this.makeScreenObjectId(e, o.index ?? We()), r = Xe(o.position), a = this.getOrCreateObject(n, r)
|
|
46753
|
+
const n = this.makeScreenObjectId(e, o.index ?? We()), r = Xe(o.position), a = this.getOrCreateObject(n, r);
|
|
46754
|
+
if (a.billboard)
|
|
46755
|
+
return n;
|
|
46756
|
+
const l = this.screenManager.billboardCollection.add({
|
|
46751
46757
|
...s,
|
|
46752
46758
|
position: r,
|
|
46753
46759
|
id: n
|
|
@@ -46768,7 +46774,10 @@ class P5 extends F {
|
|
|
46768
46774
|
* 4. 记录矩形与场景对象的关联关系
|
|
46769
46775
|
*/
|
|
46770
46776
|
addRectangle(e, s, o, n) {
|
|
46771
|
-
const r = this.makeScreenObjectId(e, o.index ?? We()), a = Xe(o.position), l = this.getOrCreateObject(r, a)
|
|
46777
|
+
const r = this.makeScreenObjectId(e, o.index ?? We()), a = Xe(o.position), l = this.getOrCreateObject(r, a);
|
|
46778
|
+
if (l.rectangle)
|
|
46779
|
+
return r;
|
|
46780
|
+
const c = this.screenManager.rectangleCollection.add({
|
|
46772
46781
|
...C5(s.element),
|
|
46773
46782
|
...s,
|
|
46774
46783
|
id: r,
|
|
@@ -46940,7 +46949,16 @@ class b5 extends F {
|
|
|
46940
46949
|
}
|
|
46941
46950
|
const s = e.id.toString(), o = this._cache.get(s), n = h.Cartesian3.clone(e.position);
|
|
46942
46951
|
let r;
|
|
46943
|
-
o && h.Cartesian3.equalsEpsilon(o.worldPos, n, 1e-6)
|
|
46952
|
+
if (o && h.Cartesian3.equalsEpsilon(o.worldPos, n, 1e-6))
|
|
46953
|
+
r = o.rect, this.rectangleCollisionCheck.remove(s, r);
|
|
46954
|
+
else {
|
|
46955
|
+
if (r = x5(this.screenManager.viewer, e), isNaN(r.width) || isNaN(r.height)) {
|
|
46956
|
+
e.show(!1), this._cache.has(e.id.toString()) && this._cache.delete(e.id.toString());
|
|
46957
|
+
return;
|
|
46958
|
+
}
|
|
46959
|
+
this._cache.set(s, { rect: r, worldPos: n, lastFrame: Date.now() });
|
|
46960
|
+
}
|
|
46961
|
+
this.rectangleCollisionCheck.collides(r) ? e.show(!1) : (e.show(!0), this.rectangleCollisionCheck.insert(e.id.toString(), r));
|
|
46944
46962
|
} catch (s) {
|
|
46945
46963
|
console.error("ScreenManager update object error", s);
|
|
46946
46964
|
}
|
|
@@ -50936,7 +50954,7 @@ let Ye = _t;
|
|
|
50936
50954
|
le(Ye.prototype, Ye.createDefaultProps);
|
|
50937
50955
|
let rp;
|
|
50938
50956
|
try {
|
|
50939
|
-
const t = "earthsdk3-cesium", i = "3.6.0-beta.
|
|
50957
|
+
const t = "earthsdk3-cesium", i = "3.6.0-beta.112", e = "2025-11-04T07:08:24.000Z", s = "北京西部世界科技有限公司", o = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", n = "f414a145e6204a2d8a0b511ec4636c035d8718a6", a = ((Date.now() - 1762240104e3) / 36e5).toFixed(1), l = `%c🌏 ${t}%c ${i}.${n.slice(0, 8)}.${e} (距今${a}个小时)
|
|
50940
50958
|
%c${o ? o + `
|
|
50941
50959
|
` : ""}当前网站正在使用${t},此软件版权归${s}所有
|
|
50942
50960
|
`;
|
|
@@ -50950,7 +50968,7 @@ try {
|
|
|
50950
50968
|
},
|
|
50951
50969
|
// @ts-ignore
|
|
50952
50970
|
get gituri() {
|
|
50953
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
50971
|
+
return GITURI_ && GITURI_.replace("${commitId}", "f414a145e6204a2d8a0b511ec4636c035d8718a6");
|
|
50954
50972
|
},
|
|
50955
50973
|
// @ts-ignore
|
|
50956
50974
|
get info() {
|
|
@@ -50958,7 +50976,7 @@ try {
|
|
|
50958
50976
|
},
|
|
50959
50977
|
// @ts-ignore
|
|
50960
50978
|
get date() {
|
|
50961
|
-
return "2025-11-
|
|
50979
|
+
return "2025-11-04T07:08:24.000Z";
|
|
50962
50980
|
},
|
|
50963
50981
|
// @ts-ignore
|
|
50964
50982
|
get author() {
|
|
@@ -50966,7 +50984,7 @@ try {
|
|
|
50966
50984
|
},
|
|
50967
50985
|
// @ts-ignore
|
|
50968
50986
|
get version() {
|
|
50969
|
-
return "3.6.0-beta.
|
|
50987
|
+
return "3.6.0-beta.112";
|
|
50970
50988
|
},
|
|
50971
50989
|
// @ts-ignore
|
|
50972
50990
|
get name() {
|
|
@@ -50974,7 +50992,7 @@ try {
|
|
|
50974
50992
|
},
|
|
50975
50993
|
// @ts-ignore
|
|
50976
50994
|
get commitId() {
|
|
50977
|
-
return "
|
|
50995
|
+
return "f414a145e6204a2d8a0b511ec4636c035d8718a6";
|
|
50978
50996
|
},
|
|
50979
50997
|
print() {
|
|
50980
50998
|
console.info(
|
|
@@ -1991,7 +1991,7 @@ return material;
|
|
|
1991
1991
|
material.alpha = fragColor.a;
|
|
1992
1992
|
|
|
1993
1993
|
return material;
|
|
1994
|
-
}`},translucent:!0}),TF(),MF(),IF(),zF(),LF(),OF(),NF(),AF(),ZF(),QF(),KF(),wz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function PL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class bL extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=et(l);if(c&&(c.destroy(),Ag(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=xF;await l.promise(PL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new qC(d,e);Ag(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const SL=new h.EllipsoidTerrainProvider;class BC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??SL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class VC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof He?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof He?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof He?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof He&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class EL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class xL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class AL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new xL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class TL extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new AL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new EL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new TL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class WC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let A;if(p?A=await v.pickFromRayMostDetailed(P,this.objectsToExclude):A=v.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=se(A.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const L=se(R);return L?(this.pickHeightMustGreaterThanZero&&L[2]<0&&(L[2]=0),f(L)):g(new Error("positionFromCartesian failed"))}}const C=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),C);if(!S)return g(new Error("Pick failed"));const x=se(S);return x?f(x):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var A,R,L,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await ML(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(G=>{w&&(w[G]=y.getProperty(G))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:G}=e.container.getBoundingClientRect();y=(A=document.elementFromPoint(d[0]+V,d[1]+G))==null?void 0:A.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:vr(y.id.position.getValue(V))}:(L=y.id)==null?void 0:L.map(G=>{var O;return{name:G.id,properties:(O=G.properties)==null?void 0:O.getValue(V),coordinates:vr(G.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;if(!y.id.entityCollection)return;const G=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",O=((B=y.id.properties)==null?void 0:B.getValue(V))??{},N=G=="Point"?se(y.id.position.getValue(V)):G=="LineString"?y.id.polyline.positions.getValue(V).map(_=>se(_)):gu(y.id.polygon.hierarchy.getValue(V));S=C.pickedInfoType=="FeatureCollection"||C.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:G,coordinates:N},properties:O}:{type:G,coordinates:N,properties:O}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,w,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const x=new a.ESJPickedResult(y,C,w,S,f,d);g(x)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function ML(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class IL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=et(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function DL(t){const i=t.cloneNode(!0);i.style.position="absolute",i.style.top="0",i.style.zIndex="-1",document.body.appendChild(i);const e=i.getBoundingClientRect();return document.body.removeChild(i),{width:e.width,height:e.height}}const GC=["label","billboard","rectangle"];class RL extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class FL extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r),c=this.screenManager.labelCollection.add({...n,position:r,id:s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r),c=this.screenManager.billboardCollection.add({...n,position:r,id:s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Ie(o.position),c=this.getOrCreateObject(r,l),u=this.screenManager.rectangleCollection.add({...DL(n.element),...n,id:r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Array.isArray(e)?e:[e];for(const s of o){const r=this.objects.get(s);if(r)for(const l of GC){const c=Object.assign({},n[l],(n==null?void 0:n.all)??{});if(!c)continue;const u=r[l];if(u)for(const d in c)d!=="position"&&d!=="id"&&(u[d]=c[d])}}return!0}remove(e){const n=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(n)){for(const o of n){const s=this.objects.get(o);s&&(s.label&&(this.screenManager.labelCollection.remove(s.label),s.label=void 0),s.billboard&&(this.screenManager.billboardCollection.remove(s.billboard),s.billboard=void 0),s.rectangle&&(this.screenManager.rectangleCollection.remove(s.rectangle),s.rectangle=void 0),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(n)){const s=Array.isArray(n[o])?n[o]:[n[o]];for(const r of s){if(!r)continue;const l=this.objects.get(r);if(!l)continue;const c=l[o];c&&(this.screenManager.collectionMap[o].remove(c),l[o]=void 0),this.tryDeleteEmpty(r)}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new RL(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function zL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&GC.includes(n)){const o=i[n];if(!o)continue;const s=o.computeScreenSpacePosition(t.scene);let r=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,s),{x:l,y:c,width:u,height:d}=r;e[0]=Math.min(e[0],l),e[1]=Math.min(e[1],c),e[2]=Math.max(e[2],l+u),e[3]=Math.max(e[3],c+d)}return new h.Rectangle(...e)}class LL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,n){n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6)?r=o.rect:(r=zL(this.screenManager.viewer,e),this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})),this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class HC extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class $C extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new HC));m(this,"canvasCollection",this.ad(new HC));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new LL(this)),this.labelCollection=new h.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new h.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(n=>n.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new FL(this),this.layers.set(e,n)),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return!o||o.length===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o){const s=this.getLayer(e);if(!s.remove(o)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!s.layerIsEffective()&&!s.isDestroyed()&&(s.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function et(t){return a.getExtProp(t,"_viewerExtensions")}function Ag(t,i){a.setExtProp(t,"_viewerExtensions",i)}class qC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new BC(this.viewer)),this._labelManager=this.dv(new VC(this.viewer)),this._poiContext=this.disposeVar(new Dm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new IL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new WC(n)),this._screenManager=this.ad(new $C(n)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var XC=new h.Cartesian3,YC=new h.Cartesian3;function ZC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,XC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,YC);else var c=h.Cartesian3.cross(t.up,r,YC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,XC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function QC(t,i){ZC(t,i,!1)}function kC(t,i){ZC(t,-i,!0)}class OL extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&QC(s,d*p),r.MoveBackword&&QC(s,-d*p),r.MoveLeft&&kC(s,-d*p),r.MoveRight&&kC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Hh extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
|
|
1994
|
+
}`},translucent:!0}),TF(),MF(),IF(),zF(),LF(),OF(),NF(),AF(),ZF(),QF(),KF(),wz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function PL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class bL extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=et(l);if(c&&(c.destroy(),Ag(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=xF;await l.promise(PL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new qC(d,e);Ag(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const SL=new h.EllipsoidTerrainProvider;class BC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??SL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class VC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof He?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof He?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof He?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof He&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class EL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class xL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class AL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new xL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class TL extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new AL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new EL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new TL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class WC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let A;if(p?A=await v.pickFromRayMostDetailed(P,this.objectsToExclude):A=v.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=se(A.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const L=se(R);return L?(this.pickHeightMustGreaterThanZero&&L[2]<0&&(L[2]=0),f(L)):g(new Error("positionFromCartesian failed"))}}const C=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),C);if(!S)return g(new Error("Pick failed"));const x=se(S);return x?f(x):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var A,R,L,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await ML(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(G=>{w&&(w[G]=y.getProperty(G))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:G}=e.container.getBoundingClientRect();y=(A=document.elementFromPoint(d[0]+V,d[1]+G))==null?void 0:A.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:vr(y.id.position.getValue(V))}:(L=y.id)==null?void 0:L.map(G=>{var O;return{name:G.id,properties:(O=G.properties)==null?void 0:O.getValue(V),coordinates:vr(G.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;if(!y.id.entityCollection)return;const G=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",O=((B=y.id.properties)==null?void 0:B.getValue(V))??{},N=G=="Point"?se(y.id.position.getValue(V)):G=="LineString"?y.id.polyline.positions.getValue(V).map(_=>se(_)):gu(y.id.polygon.hierarchy.getValue(V));S=C.pickedInfoType=="FeatureCollection"||C.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:G,coordinates:N},properties:O}:{type:G,coordinates:N,properties:O}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,w,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const x=new a.ESJPickedResult(y,C,w,S,f,d);g(x)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function ML(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class IL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=et(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function DL(t){const i=t.cloneNode(!0);i.style.position="absolute",i.style.top="0",i.style.zIndex="-1",document.body.appendChild(i);const e=i.getBoundingClientRect();return document.body.removeChild(i),{width:e.width,height:e.height}}const GC=["label","billboard","rectangle"];class RL extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class FL extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r);if(l.label)return s;const c=this.screenManager.labelCollection.add({...n,position:r,id:s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Ie(o.position),l=this.getOrCreateObject(s,r);if(l.billboard)return s;const c=this.screenManager.billboardCollection.add({...n,position:r,id:s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Ie(o.position),c=this.getOrCreateObject(r,l);if(c.rectangle)return r;const u=this.screenManager.rectangleCollection.add({...DL(n.element),...n,id:r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Array.isArray(e)?e:[e];for(const s of o){const r=this.objects.get(s);if(r)for(const l of GC){const c=Object.assign({},n[l],(n==null?void 0:n.all)??{});if(!c)continue;const u=r[l];if(u)for(const d in c)d!=="position"&&d!=="id"&&(u[d]=c[d])}}return!0}remove(e){const n=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(n)){for(const o of n){const s=this.objects.get(o);s&&(s.label&&(this.screenManager.labelCollection.remove(s.label),s.label=void 0),s.billboard&&(this.screenManager.billboardCollection.remove(s.billboard),s.billboard=void 0),s.rectangle&&(this.screenManager.rectangleCollection.remove(s.rectangle),s.rectangle=void 0),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(n)){const s=Array.isArray(n[o])?n[o]:[n[o]];for(const r of s){if(!r)continue;const l=this.objects.get(r);if(!l)continue;const c=l[o];c&&(this.screenManager.collectionMap[o].remove(c),l[o]=void 0),this.tryDeleteEmpty(r)}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new RL(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function zL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&GC.includes(n)){const o=i[n];if(!o)continue;const s=o.computeScreenSpacePosition(t.scene);let r=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,s),{x:l,y:c,width:u,height:d}=r;e[0]=Math.min(e[0],l),e[1]=Math.min(e[1],c),e[2]=Math.max(e[2],l+u),e[3]=Math.max(e[3],c+d)}return new h.Rectangle(...e)}class LL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,n){n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;if(o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6))r=o.rect,this.rectangleCollisionCheck.remove(n,r);else{if(r=zL(this.screenManager.viewer,e),isNaN(r.width)||isNaN(r.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class HC extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class $C extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new HC));m(this,"canvasCollection",this.ad(new HC));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new LL(this)),this.labelCollection=new h.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new h.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(n=>n.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new FL(this),this.layers.set(e,n)),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return!o||o.length===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o){const s=this.getLayer(e);if(!s.remove(o)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!s.layerIsEffective()&&!s.isDestroyed()&&(s.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function et(t){return a.getExtProp(t,"_viewerExtensions")}function Ag(t,i){a.setExtProp(t,"_viewerExtensions",i)}class qC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new BC(this.viewer)),this._labelManager=this.dv(new VC(this.viewer)),this._poiContext=this.disposeVar(new Dm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new IL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new WC(n)),this._screenManager=this.ad(new $C(n)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var XC=new h.Cartesian3,YC=new h.Cartesian3;function ZC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,XC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,YC);else var c=h.Cartesian3.cross(t.up,r,YC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,XC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function QC(t,i){ZC(t,i,!1)}function kC(t,i){ZC(t,-i,!0)}class OL extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&QC(s,d*p),r.MoveBackword&&QC(s,-d*p),r.MoveLeft&&kC(s,-d*p),r.MoveRight&&kC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Hh extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
|
|
1995
1995
|
`))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)&&(this._currentKeyIds.delete(r),this._currentKeyIdsChanged.emit())};this.d(n.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(n.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class NL extends a.Destroyable{constructor(e){super();m(this,"_keyStatus");m(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Hh(this)),this._cameraOp=this.dv(new OL(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const kh=class kh extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"_keyStatusMap",this.dv(a.react(kh.defaultKeyStatusMap)));m(this,"_speed",this.dv(a.react(1)));m(this,"_rotateSpeed",this.dv(a.react(.01)));m(this,"_alwaysWithCamera",this.dv(a.react(!1)));m(this,"_keyDownEvent",this.dv(new a.Event));m(this,"_keyUpEvent",this.dv(new a.Event));m(this,"_abortEvent",this.dv(new a.Event));this._firstPersonController=e,this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new NL(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};m(kh,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let $h=kh;function BL(t,i){t.lookRight(h.Math.toRadians(i.movementX)*.1),t.lookDown(h.Math.toRadians(i.movementY)*.1);const e=t.pitch,n=h.Math.clamp(e,-h.Math.PI_OVER_TWO,h.Math.PI_OVER_TWO);n!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:n,roll:t.roll}})}class VL extends a.Destroyable{constructor(i,e){super(),this._firstPersonController=i,this._mouseCameraController=e;const{canvas:n}=this._firstPersonController.viewer;{const o=s=>{const{camera:r}=this._firstPersonController.viewer.scene;BL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const Kh=class Kh extends a.Destroyable{constructor(e){super();m(this,"_mouseMoving",this.dv(new VL(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:n}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Kh.origin_setPointerCapture);const o=n.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const s=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",s,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",s,!1))}{const s=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",s)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};m(Kh,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Tg=Kh;class UL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});m(this,"_mouseResetting",this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Tg(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class WL extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"_mouseCameraController",this.dv(new UL(this)));m(this,"_keyboardCameraController",this.dv(new $h(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function KC(t){t.removeInputAction(h.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(h.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)}function Mg(t,i,e,n=void 0){const s=t.camera,r=new h.Cartesian2;r.x=i.startPosition.x,r.y=0;const l=new h.Cartesian2;l.x=i.endPosition.x,l.y=0;let c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,p,f;if(!c||!u)return;s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction);let g=h.Cartesian3.dot(p,f);g<1&&(d=Math.acos(g)),d=i.startPosition.x>i.endPosition.x?d:-d;const v=e._horizontalRotationAxis;if(h.defined(n)?s.look(n,-d):h.defined(v)?s.look(v,-d):s.lookLeft(d),r.x=0,r.y=i.startPosition.y,l.x=0,l.y=i.endPosition.y,c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,!(!c||!u))if(s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction),g=h.Cartesian3.dot(p,f),g<1&&(d=Math.acos(g)),d=i.startPosition.y>i.endPosition.y?d:-d,n=n??v,h.defined(n)){const y=s.direction,w=h.Cartesian3.negate(n,new h.Cartesian3),P=h.Cartesian3.equalsEpsilon(y,n,h.Math.EPSILON2),C=h.Cartesian3.equalsEpsilon(y,w,h.Math.EPSILON2);if(!P&&!C){g=h.Cartesian3.dot(y,n);let S=h.Math.acosClamped(g);d>0&&d>S&&(d=S-h.Math.EPSILON4),g=h.Cartesian3.dot(y,w),S=h.Math.acosClamped(g),d<0&&-d>S&&(d=-S+h.Math.EPSILON4);const x=h.Cartesian3.cross(n,y,new h.Cartesian3);s.look(x,d)}else(P&&d<0||C&&d>0)&&s.look(s.right,-d)}else s.lookUp(d)}class GL extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("viewer is undefined");let o=!0;this.d(i.positionChanged.don(()=>o=!0)),this.d(i.rotationChanged.don(()=>o=!0)),this.d(i.offsetHeightChanged.don(()=>o=!0)),this.d(i.viewDistanceChanged.don(()=>o=!0)),this.d(i.offsetRotationChanged.don(()=>o=!0)),this.d(i.relativeRotationChanged.don(()=>o=!0));const s=[0,0,0],r=[0,0,0];this.d(n.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!i.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(i.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const p=Ie(i.position),f=n.camera.positionWC,g=h.Cartesian3.distance(p,f);i.viewDistance=g}a.Vector.clone(i.position,r),i.offsetHeight&&(r[2]+=i.offsetHeight);const{rotation:l,offsetRotation:c=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.defaults.relativeRotation)&&(a.Vector.add(l,s,s),u[0]+=90),a.Vector.add(u,s,s);const d={distance:i.viewDistance,heading:s[0],pitch:s[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(d,r)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;if(c&&i.enabledRotationInput&&(c.buttons===1||c.buttons===2)){const{movementX:u,movementY:d}=c;i.offsetRotation=a.Vector.add(i.offsetRotation??Bi.defaults.offsetRotation,[u*.2,d*-.2,0])}})),this.d(e.wheelEvent.don(l=>{if(!i.enabledScaleInput)return;const c=l.deltaY,d=Math.max(1,i.viewDistance)*(c*.001);i.viewDistance=i.viewDistance+d}))}}class Bi extends a.Destroyable{constructor(e){super();m(this,"_resetWithCameraEvent",this.dv(new a.Event));const n=e.viewer;if(!n)throw new Error("viewer is undefined");const o=this;let s;const r=()=>{s&&(s.destroy(),s=void 0)};this.d(r);const l=()=>{r(),o.enabled&&(s=new GL(o,e))};l(),this.d(o.enabledChanged.don(l)),this.d(o.resetWithCameraEvent.don(c=>{if(!e.actived)return;const u=Ko(n.camera);if(!u)return;const d=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?d[0]:90),u[1]-(o.relativeRotation?d[1]:0),u[2]-(o.relativeRotation?d[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}m(Bi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class pa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");m(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const n=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};n(),this.d(this._geoPolylinePath.currentPositionChanged.don(n)),this.d(this._geoPolylinePath.currentRotationChanged.don(n)),this.dispose(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(a.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(a.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(a.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(a.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(a.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new a.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new HL(this,e);if(this.lineMode==="manual")return new $L(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(pa||(pa={})),a.extendClassProps(pa.prototype,pa.createDefaultProps);class HL extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class $L extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=s=>{(s.key==="w"||s.key==="s")&&(i.polylinePath.playing=s.type==="keydown",i.polylinePath.speed=s.key==="w"||s.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class qL extends a.Destroyable{constructor(i,e){super();const n=e.positionPropertyName??"position",o=e.positionChangedPropertyName??n+"Changed",s=e.rotationPropertyName??"rotation",r=e.rotationChangedPropertyName??s+"Changed",l=(e.positionTracking??!0)&&Reflect.has(i,n)&&Reflect.has(i,o),c=(e.rotationTracking??!0)&&Reflect.has(i,s)&&Reflect.has(i,r);if(!(!l&&!c)){if(l){const u=()=>{e.geoCameraController.position=i[n]};u();const d=i[o];this.d(d.don(u))}if(c){const u=()=>{e.geoCameraController.rotation=i[s]};u();const d=i[o];this.d(d.don(u))}}}}class XL extends a.Destroyable{constructor(i,e){super();const n=this.dv(new a.ESSceneObjectWithId);n.id=i;const o=this.dv(a.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,n.sceneObjectChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{const{sceneObject:s}=n;if(!(!e.enabled||!s))return new qL(s,e)}))}}class fa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new XL(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(fa||(fa={})),a.extendClassProps(fa.prototype,fa.createDefaultProps);class YL extends a.Destroyable{constructor(e){super();m(this,"height",1e7);m(this,"cycle",60);m(this,"latitude",38*3.1415926/18);m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");m(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new h.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},h.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,n=e.positionCartographic;e.flyTo({destination:h.Cartesian3.fromRadians(n.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,r)=>{if(!o){o=new Date().getTime();return}const l=(new Date().getTime()-o)/1e3,c=e.positionCartographic.longitude+l*h.Math.PI*2/this.cycle;e.setView({destination:h.Cartesian3.fromRadians(c,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class ZL extends a.Destroyable{constructor(e){super();m(this,"_height",this.dv(a.react(1e7)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_latitude",this.dv(a.react(38)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("未初始化viewer");this._inner=this.dv(new YL(n)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class QL extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_transform");m(this,"_headingRadius");m(this,"_pitchRadius");m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");this._viewer=e;const n=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new h.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const s=()=>{let r;if(this.position==null){var l=o.getPickRay(new h.Cartesian2(n.canvas.width*.5,n.canvas.height*.5));if(!l)return;r=n.globe.pick(l,n)}else r=h.Cartesian3.fromDegrees(...this.position);r&&(this._transform=h.Transforms.eastNorthUpToFixedFrame(r),this.start())};s(),this.d(this.positionChanged.don(s))}{const s=()=>{this._headingRadius=h.Math.toRadians(this.heading)};s(),this.d(this.headingChanged.don(s))}{const s=()=>{this._pitchRadius=h.Math.toRadians(this.pitch)};s(),this.d(this.pitchChanged.don(s))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var n=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),s=new h.Cartesian3(0,n,o);e.flyTo({destination:h.Matrix4.multiplyByPoint(this._transform,s,new h.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let r;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((l,c)=>{if(!r){r=new Date().getTime();return}const u=(new Date().getTime()-r)/1e3;this._headingRadius+=u*h.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new h.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),r=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(h.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class kL extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("viewer is undefined");this._inner=this.dv(new QL(n));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class KL extends a.Destroyable{constructor(e){super();m(this,"_firstPersonController");m(this,"_rotateGlobe");m(this,"_rotatePoint");m(this,"_followController");m(this,"_pathCameraController");m(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new WL(e)),this.d(this._viewer.keyDownEvent.don(n=>this._firstPersonController.keyboardCameraController.keyDown(n))),this.d(this._viewer.keyUpEvent.don(n=>this._firstPersonController.keyboardCameraController.keyUp(n)));{const{subContainer:n}=this._viewer;if(!n)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();n.addEventListener("blur",o,!1),this.d(()=>n.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=$h.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new ZL(e)),this._rotatePoint=this.dv(new kL(e)),this._followController=this.dv(new fa(e)),this._pathCameraController=this.dv(new pa(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,n=4.2,o=1.6){this.resetNavigation();const s=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),l=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(c=>{s?this._viewer.flyIn([e[0],e[1],(c??0)+o],l):this._viewer.viewer&&(this._viewer.viewer.camera.position=h.Cartesian3.fromDegrees(e[0],e[1],(c??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,n=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=n,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,n=5e4,o=60,s=0,r=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=n,this._rotatePoint.cycle=o,this._rotatePoint.heading=s,this._rotatePoint.pitch=r,this._rotatePoint.start()}changeToFollow(e,n=0,o=0,s=-30,r=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,s,0],this._followController.geoCameraController.relativeRotation=r,n!==0?this._followController.geoCameraController.viewDistance=n:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,n=10,o=10,s=!0,r=10,l="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const c=l==="auto",u=a.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:d}=u;if(!d)return;const p=a.getDistancesFromPositions(d,"NONE"),f=p[p.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...d],this._pathCameraController.polylinePath.duration=f/n*1e3,this._pathCameraController.polylinePath.loop=s,this._pathCameraController.offsetHeight=o;const g=um(d);this._pathCameraController.polylinePath.rotationRadius=!c||g==!1?[0]:g.map(v=>v/r*n),this._pathCameraController.enabledRotationInput=!c,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=c,this._pathCameraController.lineMode=l,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const n=this._viewer.viewer;if(!n)return;this._handler||(this._handler=new h.ScreenSpaceEventHandler(n.scene.canvas));const o=this._handler,s=n.scene.screenSpaceCameraController;this.d(()=>{o&&KC(o)}),e=="Walk"||e=="RotateGlobe"?(s.lookEventTypes=void 0,s.rotateEventTypes=void 0,s.tiltEventTypes=void 0,s.zoomEventTypes=void 0,s.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&KC(o),s.lookEventTypes=h.CameraEventType.RIGHT_DRAG,s.rotateEventTypes=h.CameraEventType.LEFT_DRAG,s.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],s.translateEventTypes=h.CameraEventType.LEFT_DRAG,s.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}])}}const JL=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class jL extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"cloudsPostProcess");const n=e.viewer;if(!n)throw new Error("Cesium Viewer is not initialized");const o=new h.CloudCollection;n.scene.primitives.add(o),this.dispose(()=>n.scene.primitives.remove(o));{const s=()=>{o.show=this.show};s(),this.dispose(this.showChanged.disposableOn(s))}{const s=l=>({slice:l.slice,brightness:l.brightness,scale:Pe(l.scale),maximumSize:hi(l.maximumSize),color:te(l.color),position:Ie(l.position)});(()=>{o.removeAll();for(let l of JL)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ga extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.postProcessStages.add(h.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(n));{const o=()=>{n.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{n.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{n.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{n.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{n.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const e4=`
|
|
1996
1996
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
1997
1997
|
{
|
|
@@ -2291,10 +2291,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2291
2291
|
`;function $4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
2292
2292
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
2293
2293
|
gitee地址:${t}
|
|
2294
|
-
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const at=class at extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",Wh);m(this,"_moveObjectsProcess",this.ad(bC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new CF(this)),this.ad(new _F(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new EF(this)})),this._viewerLegend=this.dv(new B4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Rg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new bL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&et(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],at.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Ko(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,at.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Pm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ie(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=at.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!at.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=at.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Ie(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=at.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",H4,G4,!0),new a.FunctionProperty([],()=>at.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(at,"type",at.register("ESCesiumViewer",at)),m(at,"getCesiumIonToken",$4),m(at,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(at,"latestDefaultAccessToken"),m(at,"ObjectsToExcludeWrapper",SF),m(at,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(at,"getHeightsScartchCarto",new h.Cartographic);let Re=at;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...W4()})})(Re||(Re={})),a.extendClassProps(Re.prototype,Re.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.0-beta.111",e="2025-11-04T00:57:31.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="e01e606acce477f3ffb79a237b21982a606516f4",l=((Date.now()-1762217851e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2294
|
+
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const at=class at extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",Wh);m(this,"_moveObjectsProcess",this.ad(bC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new CF(this)),this.ad(new _F(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new EF(this)})),this._viewerLegend=this.dv(new B4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Rg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new bL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&et(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],at.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Ko(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Ko(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,at.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Pm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ie(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=at.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!at.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=at.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Ie(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=at.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",H4,G4,!0),new a.FunctionProperty([],()=>at.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(at,"type",at.register("ESCesiumViewer",at)),m(at,"getCesiumIonToken",$4),m(at,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(at,"latestDefaultAccessToken"),m(at,"ObjectsToExcludeWrapper",SF),m(at,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(at,"getHeightsScartchCarto",new h.Cartographic);let Re=at;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...W4()})})(Re||(Re={})),a.extendClassProps(Re.prototype,Re.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.0-beta.112",e="2025-11-04T07:08:24.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="f414a145e6204a2d8a0b511ec4636c035d8718a6",l=((Date.now()-1762240104e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2295
2295
|
%c${o?o+`
|
|
2296
2296
|
`:""}当前网站正在使用${t},此软件版权归${n}所有
|
|
2297
|
-
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
2297
|
+
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f414a145e6204a2d8a0b511ec4636c035d8718a6")},get info(){return c},get date(){return"2025-11-04T07:08:24.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.112"},get name(){return"earthsdk3-cesium"},get commitId(){return"f414a145e6204a2d8a0b511ec4636c035d8718a6"},print(){console.info(this.info,`
|
|
2298
2298
|
font-size: 18px;
|
|
2299
2299
|
font-weight: 1000;
|
|
2300
2300
|
line-height: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvoidanceManager.d.ts","sourceRoot":"","sources":["../../../../../src/ESCesiumViewer/ViewerExtensions/ScreenManager/AvoidanceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAGlC;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC7C,uBAAuB,mCAA0C;IACjE,aAAa,EAAE,aAAa,CAAC;IAE7B,gBAAgB,UAAS;IACzB,eAAe,EAAE,MAAM,EAAE,CAAM;IAG/B,OAAO,CAAC,gBAAgB,CAA2B;IACnD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,UAAU,CAAQ;IAG1B,OAAO,CAAC,MAAM,CAAoF;IAGlG,OAAO,CAAC,gBAAgB,CAAuE;IAC/F,OAAO,CAAC,qBAAqB,CAAU;gBAC3B,aAAa,EAAE,aAAa;IASxC,MAAM;IAYN,iBAAiB;IAajB,oBAAoB,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC;IAoBhG,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,mBAAmB;
|
|
1
|
+
{"version":3,"file":"AvoidanceManager.d.ts","sourceRoot":"","sources":["../../../../../src/ESCesiumViewer/ViewerExtensions/ScreenManager/AvoidanceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAGlC;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC7C,uBAAuB,mCAA0C;IACjE,aAAa,EAAE,aAAa,CAAC;IAE7B,gBAAgB,UAAS;IACzB,eAAe,EAAE,MAAM,EAAE,CAAM;IAG/B,OAAO,CAAC,gBAAgB,CAA2B;IACnD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,UAAU,CAAQ;IAG1B,OAAO,CAAC,MAAM,CAAoF;IAGlG,OAAO,CAAC,gBAAgB,CAAuE;IAC/F,OAAO,CAAC,qBAAqB,CAAU;gBAC3B,aAAa,EAAE,aAAa;IASxC,MAAM;IAYN,iBAAiB;IAajB,oBAAoB,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC;IAoBhG,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,mBAAmB;CAuC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenLayer.d.ts","sourceRoot":"","sources":["../../../../../src/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEpG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AACnF;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,WAAW;IACxC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAC/C,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACV,aAAa,EAAE,aAAa;IAUxC;;;OAGG;IACH,gBAAgB;IAIhB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB;
|
|
1
|
+
{"version":3,"file":"ScreenLayer.d.ts","sourceRoot":"","sources":["../../../../../src/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEpG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AACnF;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,WAAW;IACxC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAC/C,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACV,aAAa,EAAE,aAAa;IAUxC;;;OAGG;IACH,gBAAgB;IAIhB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB;IAqB7E;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB;IAoBjF;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ;IAqBhH;;;;;;;;OAQG;IACH,MAAM,CACF,eAAe,EAAE,MAAM,EAAE,GAAG,MAAM,EAClC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,GAAG,KAAK,EAAE,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAwBtG;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IA2C3F,gBAAgB;IAChB,OAAO,CAAC,kBAAkB;IAG1B,yBAAyB;IACzB,OAAO,CAAC,iBAAiB;IAQzB,qCAAqC;IACrC,OAAO,CAAC,cAAc;CAOzB"}
|