earthsdk3-cesium 3.4.7 → 3.4.8
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.
|
@@ -3772,7 +3772,7 @@ void main()
|
|
|
3772
3772
|
{
|
|
3773
3773
|
out_FragColor = u_color;
|
|
3774
3774
|
}
|
|
3775
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},at,t)}class sV extends c.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[pi.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(c.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const h=A.pick(l);if(!h||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(h,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=fv(f,d,A.normal),g=fv(A.origin,f,A.normal),v=fv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[pi.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await c.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,h=A*3/128;if(!(u>=A-h&&u<=A+h))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[pi.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ni(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function fv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const As=class As extends zn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(c.react("none")));L(this,"_movingPlaneType",this.disposeVar(c.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new tV(this)),pitch:this.disposeVar(new nV(this)),roll:this.disposeVar(new iV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new sV(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&ft(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new Ht(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(c.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(c.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(c.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=st({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Ra(e));this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([o,"debug"],[this,"debug"])),this.dispose(c.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=As.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[As.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[As.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(As,"rotationNum",{heading:0,pitch:1,roll:2}),L(As,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let pi=As;(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(pi||(pi={})),c.extendClassProps(pi.prototype,pi.createDefaultProps);const fs=class fs extends c.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??fs.defaults.positions[0],this.stopPosition??fs.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??fs.defaults.positions[0],n??fs.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Ye(n,e));o.arcType="RHUMB";const r=this.ad(new Wn(n,e));this.ad(c.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(c.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(fs,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let ns=fs;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(t.defaults.positions),width:10,color:c.reactArray([1,0,0,1])})})(ns||(ns={})),c.extendClassProps(ns.prototype,ns.createDefaultProps);class cr extends zn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.disposeVar(c.react("none")),originPosition:this.disposeVar(c.reactArray([0,0,0])),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!gs(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;ds(s,a),this._opInfo.constraintMode.value==="x"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let h=this.scale[0],f=this.scale[1];const d=c.geoDistance(A,this._opInfo.originPosition.value)-c.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?h+=p:h-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),h<=0&&(h+=p),f<=0&&(f+=p),this.scale=[h??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new c.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!_h(e.viewer.scene,ft(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const h=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=h:u-=h),u<=0&&(u+=h),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new vp(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=cr.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[h,f,d]=s;l.stopPosition=[h,f,d+this._opInfo.originDimensions.value[2]];const p=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(c.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??cr.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ap(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await c.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),h=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};h(),this.dispose(this.enabledChanged.disposableOn(h))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new ns(e));return o.width=10,this.ad(c.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),scale:c.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(cr||(cr={})),c.extendClassProps(cr.prototype,cr.createDefaultProps);const ho=class ho extends Tn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new c.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(c.react(!1)));L(this,"_status",this.disposeVar(c.react("None")));L(this,"_positionsChanged",this.ad(new c.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??ho.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??ho.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Ye(e));this.ad(c.track([i,"color"],[this,"polylineColor"])),this.ad(c.track([i,"width"],[this,"polylineWidth"])),this.ad(c.track([i,"show"],[this,"polylineShow"])),this.ad(c.track([i,"arcType"],[this,"polylineArcType"])),this.ad(c.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new c.CursorInfo(e.container,c.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(ho,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(ho,"defaults",{...Tn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:ho.baseImageUrl+"point-green.png",otherControlPointImageUrl:ho.baseImageUrl+"point-yellow.png"});let ei=ho;(t=>{t.createDefaultProps=()=>({...Tn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:c.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ei||(ei={})),c.extendClassProps(ei.prototype,ei.createDefaultProps);let aV=0;class SS extends c.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_id",aV++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new Ss(e.czmViewer));o.enabled=!1,this.ad(c.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??ei.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ei.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class ES extends SS{constructor(n,e){super(n,e)}}class Et extends ei{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new c.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Li(e));i.enabled=!1,this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Et.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Et.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(c.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new ES(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Et.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=c.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(c.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new lV(this,r)));const A=s.disposer.disposeVar(new cV(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(h=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,h(!0)):h(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,h(!0)):h(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>h(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps()})})(Et||(Et={})),c.extendClassProps(Et.prototype,Et.createDefaultProps);class lV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));const{placeEditing:o}=e;let r=new ES(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Et.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(c.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Et.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function uV(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class cV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_doEvent",this.disposeVar(new c.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(uV(e,i)))),(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class PS extends Et{constructor(n){super(n),this.loop=!1}}class BS extends Et{constructor(n){super(n),this.loop=!0}}class Hf extends SS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new yi(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??tt.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??tt.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const h=hp(u,A);if(!h)return o();h[2]-=n.czmViewer.editingHeightOffset??0,i.position=h;const f=l<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new Hf(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class tt extends ei{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"translationEditing");{const r=this.ad(c.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new c.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new hV(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new ur(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(c.step(r,async s=>{const l=s.disposer,u=l.ad(new AV(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>u.modify(h))),await s.promise(new Promise(h=>{l.dispose(u.overEvent.disposableOnce(f=>{h(f)}))}))})),a===-1)(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const h=this.editingPoints.get(u).position;if(!h)return;const f=hp(l,h);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new Hf(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new Hf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),c.extendClassProps(tt.prototype,tt.createDefaultProps);class hV extends c.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class AV extends c.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new fV(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class fV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(c.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class TS extends tt{constructor(n){super(n),this.loop=!1}}class IS extends tt{constructor(n){super(n),this.loop=!0}}class Ua extends Et{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=c.geoHeading(this.startPosition,this.endPosition),o=c.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([90,0,0]),distance:c.react(1)})})(Ua||(Ua={})),c.extendClassProps(Ua.prototype,Ua.createDefaultProps);class is extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=c.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=c.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),distance:c.react(0)})})(is||(is={})),c.extendClassProps(is.prototype,is.createDefaultProps);class FS extends Et{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class MS extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Oa extends Et{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(Oa||(Oa={})),c.extendClassProps(Oa.prototype,Oa.createDefaultProps);class La extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(La||(La={})),c.extendClassProps(La.prototype,La.createDefaultProps);class DS extends is{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class un extends c.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_currentEditing",this.disposeVar(c.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Et&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Li&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const ih=class ih extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Li(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),i.enabled=!i.position||c.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};L(ih,"type",ih.registerEditing("ESCesiumViewer",c.ESJEditingMode.Place,ih));let pv=ih;const rh=class rh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new pi(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(c.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};L(rh,"type",rh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Rotation,rh));let dv=rh;const oh=class oh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new cr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};L(oh,"type",oh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Scale,oh));let mv=oh;const sh=class sh extends un{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new ur(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=c.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=yn({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=yn({originPosition:a},[u.position])[0][0];u.position=Cr({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=yn({originPosition:a},u.points)[0];u.points=Cr({originPosition:a},A.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(c.bind([i,"position"],[n,"position"]));else if(n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=c.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=yn({originPosition:a},[r])[0][0];const l=yn({originPosition:a},o.points)[0];o.points=Cr({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};L(sh,"type",sh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Translation,sh));let Gf=sh;const ah=class ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ua(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(c.bind([i,"startPosition"],[o,"position"])),this.ad(Mt([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(c.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(c.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(c.bind([i,"distance"],[o,"distance"]));else{const r=ft(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Ni(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!c.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(ah,"type",ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsAppend,ah));let gv=ah;const lh=class lh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new is(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(c.bind([i,"startPosition"],[r,"position"])),this.ad(Mt([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(c.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(c.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(c.bind([i,"distance"],[r,"distance"]));else{const a=ft(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Ni(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(c.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(lh,"type",lh.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsModify,lh));let yv=lh;const uh=class uh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new BS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};L(uh,"type",uh.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularAppend,uh));let vv=uh;const ch=class ch extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new IS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};L(ch,"type",ch.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularInsert,ch));let wv=ch;const hh=class hh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new PS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};L(hh,"type",hh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringAppend,hh));let bv=hh;const Ah=class Ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new TS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};L(Ah,"type",Ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringInsert,Ah));let xv=Ah;const fh=class fh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new FS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};L(fh,"type",fh.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterAppend,fh));let _v=fh;const ph=class ph extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new MS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};L(ph,"type",ph.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterModify,ph));let Cv=ph;const dh=class dh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Oa(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};L(dh,"type",dh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityAppend,dh));let Sv=dh;const mh=class mh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new La(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};L(mh,"type",mh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityModify,mh));let Ev=mh;const gh=class gh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new DS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof c.ESClassification||r instanceof c.ESPolygonFence;let A=c.getMinMaxCorner(r.points).center,h=[...A],f=u?r.points[0][2]:0;l?a?h[2]=r.extrudedHeight:h[2]=r.height+f:(s&&(A[2]=r.height),a&&(h[2]=r.extrudedHeight)),i.startPosition=A,i.distance=h[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(gh,"type",gh.registerEditing("ESCesiumViewer",c.ESJEditingMode.HeightModify,gh));let Pv=gh;const Vt=class Vt extends c.Destroyable{constructor(e,i,o,r=!0){super();L(this,"czmViewer");L(this,"sceneObject");L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);L(this,"currentEditingMode");L(this,"currentEditingWrapper");L(this,"_notSupportedEditCount",this.disposeVar(c.react(0)));L(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&c.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Vt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_ESCAPE&&Vt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Vt.MOUSE_LEFT&&c.nextAnimateFrame(()=>{Vt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Vt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=c.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Vt.stop(),Vt.esEditModeInstance=new Vt(e,i,o,r)}static stop(){const e=Vt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Vt.esEditModeInstance=void 0}};L(Vt,"KEY_ESCAPE","Escape"),L(Vt,"KEY_SPACE","Space"),L(Vt,"MOUSE_LEFT",0),L(Vt,"esEditModeInstance");let Wf=Vt;function RS(){const t=c.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new Gf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class pV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n,c.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof c.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(c.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class dV extends c.Destroyable{constructor(e){super();L(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new c.ESSceneObjectWithId));this.dispose(c.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new c.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new pV(e,i)}))}}class mV extends c.Destroyable{constructor(n){super(),this.dv(new c.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new gV(n)}))}}class gV extends c.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(c.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{if(o)return new yV(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=c.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof c.ESExcavate?c.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof c.ESHole&&c.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class yV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=c.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof c.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof c.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class vV extends c.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class wV extends c.Destroyable{constructor(e){var a;super();L(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new ko(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function bV(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function xV(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=t??_.Matrix4.IDENTITY;const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function _V(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function CV(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=i??e,this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function SV(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function EV(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defined,o=t.OrientedBoundingBox,r=t.Rectangle,a=t.TaskProcessor,s=t.TerrainData,l=t.TerrainEncoding,u=t.TerrainMesh,A=t.GoogleEarthEnterpriseTerrainData,h="createVerticesFromGoogleEarthEnterpriseBuffer",f=new a(h),d=new a(h,s.maximumAsynchronousTasks),p=new r,g=new r;A.prototype.createMesh=function(v){v=v??Xe.Frozen.EMPTY_OBJECT;const y=v.tilingScheme,m=v.x,x=v.y,b=v.level,E=v.exaggeration??1,B=v.exaggerationRelativeHeight??0,P=v.throttle??!0,I=y.ellipsoid;y.tileXYToNativeRectangle(m,x,b,p),y.tileXYToRectangle(m,x,b,g);const M=I.cartographicToCartesian(r.center(g));this._skirtHeight=1.9134410999999999e6;const S=(P?d:f).scheduleTask({buffer:this._buffer,nativeRectangle:p,rectangle:r.clone(g),relativeToCenter:M,ellipsoid:I,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:B,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!i(S))return;const T=this;return S.then(function(w){return T._mesh=new u(M,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,n.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),l.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),T._minimumHeight=w.minimumHeight,T._maximumHeight=w.maximumHeight,T._buffer=void 0,T._mesh})}}function PV(){return _.VERSION.split(".").map(n=>parseInt(n))}let Bv;function BV(){return Bv||(Bv=PV()),Bv}function TV(){const t=BV();t[0]===1&&t[1]>=92?EV(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function IV(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function FV(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function MV(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const DV=`#ifdef GL_OES_standard_derivatives
|
|
3775
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},at,t)}class sV extends c.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[pi.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(c.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const h=A.pick(l);if(!h||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(h,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=fv(f,d,A.normal),g=fv(A.origin,f,A.normal),v=fv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[pi.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await c.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,h=A*3/128;if(!(u>=A-h&&u<=A+h))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[pi.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ni(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function fv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const As=class As extends zn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(c.react("none")));L(this,"_movingPlaneType",this.disposeVar(c.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new tV(this)),pitch:this.disposeVar(new nV(this)),roll:this.disposeVar(new iV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new sV(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&ft(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new Ht(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(c.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(c.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(c.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=st({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Ra(e));this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([o,"debug"],[this,"debug"])),this.dispose(c.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=As.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[As.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[As.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(As,"rotationNum",{heading:0,pitch:1,roll:2}),L(As,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let pi=As;(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(pi||(pi={})),c.extendClassProps(pi.prototype,pi.createDefaultProps);const fs=class fs extends c.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??fs.defaults.positions[0],this.stopPosition??fs.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??fs.defaults.positions[0],n??fs.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Ye(n,e));o.arcType="RHUMB";const r=this.ad(new Wn(n,e));this.ad(c.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(c.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(fs,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let ns=fs;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(t.defaults.positions),width:10,color:c.reactArray([1,0,0,1])})})(ns||(ns={})),c.extendClassProps(ns.prototype,ns.createDefaultProps);class cr extends zn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.disposeVar(c.react("none")),originPosition:this.disposeVar(c.reactArray([0,0,0])),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!gs(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;ds(s,a),this._opInfo.constraintMode.value==="x"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let h=this.scale[0],f=this.scale[1];const d=c.geoDistance(A,this._opInfo.originPosition.value)-c.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?h+=p:h-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),h<=0&&(h+=p),f<=0&&(f+=p),this.scale=[h??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new c.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!_h(e.viewer.scene,ft(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const h=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=h:u-=h),u<=0&&(u+=h),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new vp(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=cr.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[h,f,d]=s;l.stopPosition=[h,f,d+this._opInfo.originDimensions.value[2]];const p=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(c.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??cr.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ap(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await c.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),h=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};h(),this.dispose(this.enabledChanged.disposableOn(h))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new ns(e));return o.width=10,this.ad(c.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),scale:c.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(cr||(cr={})),c.extendClassProps(cr.prototype,cr.createDefaultProps);const ho=class ho extends Tn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new c.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(c.react(!1)));L(this,"_status",this.disposeVar(c.react("None")));L(this,"_positionsChanged",this.ad(new c.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??ho.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??ho.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Ye(e));this.ad(c.track([i,"color"],[this,"polylineColor"])),this.ad(c.track([i,"width"],[this,"polylineWidth"])),this.ad(c.track([i,"show"],[this,"polylineShow"])),this.ad(c.track([i,"arcType"],[this,"polylineArcType"])),this.ad(c.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new c.CursorInfo(e.container,c.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(ho,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(ho,"defaults",{...Tn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:ho.baseImageUrl+"point-green.png",otherControlPointImageUrl:ho.baseImageUrl+"point-yellow.png"});let ei=ho;(t=>{t.createDefaultProps=()=>({...Tn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:c.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ei||(ei={})),c.extendClassProps(ei.prototype,ei.createDefaultProps);let aV=0;class SS extends c.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_id",aV++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new Ss(e.czmViewer));o.enabled=!1,this.ad(c.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??ei.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ei.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class ES extends SS{constructor(n,e){super(n,e)}}class Et extends ei{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new c.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Li(e));i.enabled=!1,this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Et.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Et.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(c.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new ES(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Et.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=c.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(c.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new lV(this,r)));const A=s.disposer.disposeVar(new cV(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(h=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,h(!0)):h(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,h(!0)):h(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>h(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps()})})(Et||(Et={})),c.extendClassProps(Et.prototype,Et.createDefaultProps);class lV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));const{placeEditing:o}=e;let r=new ES(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Et.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(c.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Et.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function uV(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class cV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_doEvent",this.disposeVar(new c.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(uV(e,i)))),(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class PS extends Et{constructor(n){super(n),this.loop=!1}}class BS extends Et{constructor(n){super(n),this.loop=!0}}class Hf extends SS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new yi(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??tt.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??tt.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const h=hp(u,A);if(!h)return o();h[2]-=n.czmViewer.editingHeightOffset??0,i.position=h;const f=l<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new Hf(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class tt extends ei{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"translationEditing");{const r=this.ad(c.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new c.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new hV(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new ur(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(c.step(r,async s=>{const l=s.disposer,u=l.ad(new AV(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>u.modify(h))),await s.promise(new Promise(h=>{l.dispose(u.overEvent.disposableOnce(f=>{h(f)}))}))})),a===-1)(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const h=this.editingPoints.get(u).position;if(!h)return;const f=hp(l,h);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new Hf(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new Hf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),c.extendClassProps(tt.prototype,tt.createDefaultProps);class hV extends c.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class AV extends c.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new fV(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class fV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(c.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class TS extends tt{constructor(n){super(n),this.loop=!1}}class IS extends tt{constructor(n){super(n),this.loop=!0}}class Ua extends Et{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=c.geoHeading(this.startPosition,this.endPosition),o=c.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([90,0,0]),distance:c.react(1)})})(Ua||(Ua={})),c.extendClassProps(Ua.prototype,Ua.createDefaultProps);class is extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=c.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=c.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),distance:c.react(0)})})(is||(is={})),c.extendClassProps(is.prototype,is.createDefaultProps);class FS extends Et{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class MS extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Oa extends Et{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(Oa||(Oa={})),c.extendClassProps(Oa.prototype,Oa.createDefaultProps);class La extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(La||(La={})),c.extendClassProps(La.prototype,La.createDefaultProps);class DS extends is{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class un extends c.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_currentEditing",this.disposeVar(c.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Et&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning)){if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}}else this.currentEditing instanceof Li&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const ih=class ih extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Li(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),i.enabled=!i.position||c.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};L(ih,"type",ih.registerEditing("ESCesiumViewer",c.ESJEditingMode.Place,ih));let pv=ih;const rh=class rh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new pi(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(c.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};L(rh,"type",rh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Rotation,rh));let dv=rh;const oh=class oh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new cr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};L(oh,"type",oh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Scale,oh));let mv=oh;const sh=class sh extends un{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new ur(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=c.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=yn({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=yn({originPosition:a},[u.position])[0][0];u.position=Cr({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=yn({originPosition:a},u.points)[0];u.points=Cr({originPosition:a},A.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(c.bind([i,"position"],[n,"position"]));else if(n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=c.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=yn({originPosition:a},[r])[0][0];const l=yn({originPosition:a},o.points)[0];o.points=Cr({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};L(sh,"type",sh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Translation,sh));let Gf=sh;const ah=class ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ua(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(c.bind([i,"startPosition"],[o,"position"])),this.ad(Mt([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(c.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(c.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(c.bind([i,"distance"],[o,"distance"]));else{const r=ft(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Ni(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!c.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(ah,"type",ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsAppend,ah));let gv=ah;const lh=class lh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new is(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(c.bind([i,"startPosition"],[r,"position"])),this.ad(Mt([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(c.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(c.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(c.bind([i,"distance"],[r,"distance"]));else{const a=ft(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Ni(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(c.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(lh,"type",lh.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsModify,lh));let yv=lh;const uh=class uh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new BS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};L(uh,"type",uh.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularAppend,uh));let vv=uh;const ch=class ch extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new IS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};L(ch,"type",ch.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularInsert,ch));let wv=ch;const hh=class hh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new PS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};L(hh,"type",hh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringAppend,hh));let bv=hh;const Ah=class Ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new TS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};L(Ah,"type",Ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringInsert,Ah));let xv=Ah;const fh=class fh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new FS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};L(fh,"type",fh.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterAppend,fh));let _v=fh;const ph=class ph extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new MS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};L(ph,"type",ph.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterModify,ph));let Cv=ph;const dh=class dh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Oa(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};L(dh,"type",dh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityAppend,dh));let Sv=dh;const mh=class mh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new La(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};L(mh,"type",mh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityModify,mh));let Ev=mh;const gh=class gh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new DS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof c.ESClassification||r instanceof c.ESPolygonFence;let A=c.getMinMaxCorner(r.points).center,h=[...A],f=u?r.points[0][2]:0;l?a?h[2]=r.extrudedHeight:h[2]=r.height+f:(s&&(A[2]=r.height),a&&(h[2]=r.extrudedHeight)),i.startPosition=A,i.distance=h[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(gh,"type",gh.registerEditing("ESCesiumViewer",c.ESJEditingMode.HeightModify,gh));let Pv=gh;const Vt=class Vt extends c.Destroyable{constructor(e,i,o,r=!0){super();L(this,"czmViewer");L(this,"sceneObject");L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);L(this,"currentEditingMode");L(this,"currentEditingWrapper");L(this,"_notSupportedEditCount",this.disposeVar(c.react(0)));L(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&c.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Vt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_ESCAPE&&Vt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Vt.MOUSE_LEFT&&c.nextAnimateFrame(()=>{Vt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Vt.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=c.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Vt.stop(),Vt.esEditModeInstance=new Vt(e,i,o,r)}static stop(){const e=Vt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Vt.esEditModeInstance=void 0}};L(Vt,"KEY_ESCAPE","Escape"),L(Vt,"KEY_SPACE","Space"),L(Vt,"MOUSE_LEFT",0),L(Vt,"esEditModeInstance");let Wf=Vt;function RS(){const t=c.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new Gf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class pV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n,c.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof c.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(c.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class dV extends c.Destroyable{constructor(e){super();L(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new c.ESSceneObjectWithId));this.dispose(c.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new c.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new pV(e,i)}))}}class mV extends c.Destroyable{constructor(n){super(),this.dv(new c.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new gV(n)}))}}class gV extends c.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(c.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{if(o)return new yV(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=c.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof c.ESExcavate?c.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof c.ESHole&&c.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class yV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=c.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof c.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof c.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class vV extends c.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class wV extends c.Destroyable{constructor(e){var a;super();L(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new ko(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function bV(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function xV(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=t??_.Matrix4.IDENTITY;const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function _V(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function CV(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=i??e,this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function SV(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function EV(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defined,o=t.OrientedBoundingBox,r=t.Rectangle,a=t.TaskProcessor,s=t.TerrainData,l=t.TerrainEncoding,u=t.TerrainMesh,A=t.GoogleEarthEnterpriseTerrainData,h="createVerticesFromGoogleEarthEnterpriseBuffer",f=new a(h),d=new a(h,s.maximumAsynchronousTasks),p=new r,g=new r;A.prototype.createMesh=function(v){v=v??Xe.Frozen.EMPTY_OBJECT;const y=v.tilingScheme,m=v.x,x=v.y,b=v.level,E=v.exaggeration??1,B=v.exaggerationRelativeHeight??0,P=v.throttle??!0,I=y.ellipsoid;y.tileXYToNativeRectangle(m,x,b,p),y.tileXYToRectangle(m,x,b,g);const M=I.cartographicToCartesian(r.center(g));this._skirtHeight=1.9134410999999999e6;const S=(P?d:f).scheduleTask({buffer:this._buffer,nativeRectangle:p,rectangle:r.clone(g),relativeToCenter:M,ellipsoid:I,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:B,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!i(S))return;const T=this;return S.then(function(w){return T._mesh=new u(M,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,n.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),l.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),T._minimumHeight=w.minimumHeight,T._maximumHeight=w.maximumHeight,T._buffer=void 0,T._mesh})}}function PV(){return _.VERSION.split(".").map(n=>parseInt(n))}let Bv;function BV(){return Bv||(Bv=PV()),Bv}function TV(){const t=BV();t[0]===1&&t[1]>=92?EV(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function IV(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function FV(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function MV(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const DV=`#ifdef GL_OES_standard_derivatives
|
|
3776
3776
|
#extension GL_OES_standard_derivatives : enable
|
|
3777
3777
|
#endif
|
|
3778
3778
|
|
|
@@ -4106,10 +4106,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4106
4106
|
`;function RH(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4107
4107
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4108
4108
|
gitee地址:${t}
|
|
4109
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt 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",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new dV(this)),this.ad(new mV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new wV(this)})),this._viewerLegend=this.dv(new BH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(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 yN(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&&Qn(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=_.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:In(e),rotation:ms(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const a=_.Cartesian3.fromDegrees(...e),s=_.Cartesian3.distance(o.positionWC,a),l=_.Cartesian3.subtract(a,r,new _.Cartesian3);_.Cartesian3.normalize(l,l);const u=_.Transforms.rotationMatrixFromPositionVelocity(r,l,_.Ellipsoid.WGS84),A=_.Matrix4.fromRotationTranslation(u,r);var h=_.Transforms.eastNorthUpToFixedFrame(_.Matrix4.getTranslation(A,new _.Cartesian3),_.Ellipsoid.WGS84,new _.Matrix4),f=_.Matrix4.multiply(_.Matrix4.inverse(h,new _.Matrix4),A,new _.Matrix4),d=_.Matrix4.getMatrix3(f,new _.Matrix3),p=_.Quaternion.fromRotationMatrix(d),g=_.HeadingPitchRoll.fromQuaternion(p);const v=ms(o);return{distance:s,heading:_.Math.toDegrees(g.heading)+90,pitch:_.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(_.Math.toDegrees(g.heading)+90)),pDelta:v[1]-_.Math.toDegrees(g.pitch)}}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&&rl(s,a)}flyTo(e,i,o="default"){var d;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=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h)}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&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:In(e),rotation:ms(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,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,Nt.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 P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(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=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return yn(e,i)}localPositionsToPositions(e,i){return Cr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new _.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=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",DH,MH,!0),new c.FunctionProperty([],()=>Nt.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(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",RH),L(Nt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",vV),L(Nt,"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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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(Nt,"getHeightsScartchCarto",new _.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...FH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.4.7",e="2025-09-26T07:13:38.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="3539538c038391d429fe888eb3bf9f325dd2ea18",s=((Date.now()-1758870818e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4109
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt 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",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new dV(this)),this.ad(new mV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new wV(this)})),this._viewerLegend=this.dv(new BH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(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 yN(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&&Qn(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=_.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:In(e),rotation:ms(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const a=_.Cartesian3.fromDegrees(...e),s=_.Cartesian3.distance(o.positionWC,a),l=_.Cartesian3.subtract(a,r,new _.Cartesian3);_.Cartesian3.normalize(l,l);const u=_.Transforms.rotationMatrixFromPositionVelocity(r,l,_.Ellipsoid.WGS84),A=_.Matrix4.fromRotationTranslation(u,r);var h=_.Transforms.eastNorthUpToFixedFrame(_.Matrix4.getTranslation(A,new _.Cartesian3),_.Ellipsoid.WGS84,new _.Matrix4),f=_.Matrix4.multiply(_.Matrix4.inverse(h,new _.Matrix4),A,new _.Matrix4),d=_.Matrix4.getMatrix3(f,new _.Matrix3),p=_.Quaternion.fromRotationMatrix(d),g=_.HeadingPitchRoll.fromQuaternion(p);const v=ms(o);return{distance:s,heading:_.Math.toDegrees(g.heading)+90,pitch:_.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(_.Math.toDegrees(g.heading)+90)),pDelta:v[1]-_.Math.toDegrees(g.pitch)}}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&&rl(s,a)}flyTo(e,i,o="default"){var d;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=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h)}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&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:In(e),rotation:ms(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,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,Nt.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 P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(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=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return yn(e,i)}localPositionsToPositions(e,i){return Cr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new _.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=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",DH,MH,!0),new c.FunctionProperty([],()=>Nt.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(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",RH),L(Nt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",vV),L(Nt,"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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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(Nt,"getHeightsScartchCarto",new _.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...FH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.4.8",e="2025-10-15T02:35:37.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="be75c02bf56d7cffcdaa20633c6d5ce31c0717a3",s=((Date.now()-1760495737e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4110
4110
|
%c${o?o+`
|
|
4111
4111
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4112
|
-
`;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4112
|
+
`;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","be75c02bf56d7cffcdaa20633c6d5ce31c0717a3")},get info(){return l},get date(){return"2025-10-15T02:35:37.000Z"},get author(){return"suplyang"},get version(){return"3.4.8"},get name(){return"earthsdk3-cesium"},get commitId(){return"be75c02bf56d7cffcdaa20633c6d5ce31c0717a3"},print(){console.info(this.info,`
|
|
4113
4113
|
font-size: 18px;
|
|
4114
4114
|
font-weight: 1000;
|
|
4115
4115
|
line-height: 1;
|
package/dist/earthsdk3-cesium.js
CHANGED
|
@@ -43311,13 +43311,12 @@ class Jt extends qi {
|
|
|
43311
43311
|
this.ad(this.toDestroyEvent.don(() => {
|
|
43312
43312
|
var n;
|
|
43313
43313
|
if (this.currentEditing)
|
|
43314
|
-
if (this.currentEditing instanceof ut && ((n = this.currentEditing.currentProcess) != null && n.isRunning))
|
|
43314
|
+
if (this.currentEditing instanceof ut && ((n = this.currentEditing.currentProcess) != null && n.isRunning)) {
|
|
43315
43315
|
if (this.currentEditing.currentProcess.cancel(), e != null && e.position) {
|
|
43316
43316
|
if (this.currentEditing.positions.length > 1) return;
|
|
43317
43317
|
e.position = this.currentEditing.positions[0] ?? [0, 0, 0], e != null && e.rotation && (e.rotation = [0, 0, 0]), e != null && e.far && (e.far = 1), e != null && e.radius && (e.radius = 1), e != null && e.distance && (e.distance = 1);
|
|
43318
|
-
}
|
|
43319
|
-
|
|
43320
|
-
else this.currentEditing instanceof No && this.currentEditing.enabled && (e.position = [0, 0, 0]);
|
|
43318
|
+
}
|
|
43319
|
+
} else this.currentEditing instanceof No && this.currentEditing.enabled && (e.position = [0, 0, 0]);
|
|
43321
43320
|
}));
|
|
43322
43321
|
}
|
|
43323
43322
|
get currentEditing() {
|
|
@@ -49959,7 +49958,7 @@ let We = wt;
|
|
|
49959
49958
|
ae(We.prototype, We.createDefaultProps);
|
|
49960
49959
|
let sp;
|
|
49961
49960
|
try {
|
|
49962
|
-
const t = "earthsdk3-cesium", i = "3.4.
|
|
49961
|
+
const t = "earthsdk3-cesium", i = "3.4.8", e = "2025-10-15T02:35:37.000Z", o = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", n = "be75c02bf56d7cffcdaa20633c6d5ce31c0717a3", a = ((Date.now() - 1760495737e3) / 36e5).toFixed(1), l = `%c🌏 ${t}%c ${i}.${n.slice(0, 8)}.${e} (距今${a}个小时)
|
|
49963
49962
|
%c${s ? s + `
|
|
49964
49963
|
` : ""}当前网站正在使用${t},此软件版权归${o}所有
|
|
49965
49964
|
`;
|
|
@@ -49973,7 +49972,7 @@ try {
|
|
|
49973
49972
|
},
|
|
49974
49973
|
// @ts-ignore
|
|
49975
49974
|
get gituri() {
|
|
49976
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
49975
|
+
return GITURI_ && GITURI_.replace("${commitId}", "be75c02bf56d7cffcdaa20633c6d5ce31c0717a3");
|
|
49977
49976
|
},
|
|
49978
49977
|
// @ts-ignore
|
|
49979
49978
|
get info() {
|
|
@@ -49981,7 +49980,7 @@ try {
|
|
|
49981
49980
|
},
|
|
49982
49981
|
// @ts-ignore
|
|
49983
49982
|
get date() {
|
|
49984
|
-
return "2025-
|
|
49983
|
+
return "2025-10-15T02:35:37.000Z";
|
|
49985
49984
|
},
|
|
49986
49985
|
// @ts-ignore
|
|
49987
49986
|
get author() {
|
|
@@ -49989,7 +49988,7 @@ try {
|
|
|
49989
49988
|
},
|
|
49990
49989
|
// @ts-ignore
|
|
49991
49990
|
get version() {
|
|
49992
|
-
return "3.4.
|
|
49991
|
+
return "3.4.8";
|
|
49993
49992
|
},
|
|
49994
49993
|
// @ts-ignore
|
|
49995
49994
|
get name() {
|
|
@@ -49997,7 +49996,7 @@ try {
|
|
|
49997
49996
|
},
|
|
49998
49997
|
// @ts-ignore
|
|
49999
49998
|
get commitId() {
|
|
50000
|
-
return "
|
|
49999
|
+
return "be75c02bf56d7cffcdaa20633c6d5ce31c0717a3";
|
|
50001
50000
|
},
|
|
50002
50001
|
print() {
|
|
50003
50002
|
console.info(
|
|
@@ -1921,7 +1921,7 @@ void main()
|
|
|
1921
1921
|
{
|
|
1922
1922
|
out_FragColor = u_color;
|
|
1923
1923
|
}
|
|
1924
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},De,t)}class oF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[yi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const m=ag(f,g,d.normal),y=ag(d.origin,f,d.normal),_=ag(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[yi.rotationNum[u]]=n.startRotation+m,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=_}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[yi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Wi(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function ag(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const Xo=class Xo extends Zt{constructor(e){super();v(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));v(this,"_movingPlaneType",this.disposeVar(a.react("none")));v(this,"_circles");v(this,"_czmCameraModel");v(this,"_cartesian");v(this,"_planes",{heading:this.disposeVar(new jR(this)),pitch:this.disposeVar(new eF(this)),roll:this.disposeVar(new tF(this))});v(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new oF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Le(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new rt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new tr(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=Xo.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[Xo.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[Xo.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};v(Xo,"rotationNum",{heading:0,pitch:1,roll:2}),v(Xo,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let yi=Xo;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(yi||(yi={})),a.extendClassProps(yi.prototype,yi.createDefaultProps);const Yo=class Yo extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Yo.defaults.positions[0],this.stopPosition??Yo.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Yo.defaults.positions[0],i??Yo.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new be(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};v(Yo,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Oo=Yo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(Oo||(Oo={})),a.extendClassProps(Oo.prototype,Oo.createDefaultProps);class rn extends Zt{constructor(e){super();v(this,"_lastPosition");v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});v(this,"_scaleAxis");v(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!Jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;ko(l,r),this._opInfo.constraintMode.value==="x"?jn(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?jn(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const m=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=m:p-=m),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=m:f-=m),p<=0&&(p+=m),f<=0&&(f+=m),this.scale=[p??1,f??1,this.scale[2]??1]})})));v(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!vc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(re(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new mu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=rn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const m=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??rn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ou(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(m=>{m.pointerEvent&&u(m.pointerEvent)})),await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const m=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,m,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),m.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new Oo(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(rn||(rn={})),a.extendClassProps(rn.prototype,rn.createDefaultProps);const Kn=class Kn extends Ut{constructor(e){super();v(this,"_editingPoints",this.disposeVar(new a.ObservableArray));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_currentProcess");v(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));v(this,"_status",this.disposeVar(a.react("None")));v(this,"_positionsChanged",this.ad(new a.Event));v(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??Kn.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??Kn.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new be(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};v(Kn,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),v(Kn,"defaults",{...Ut.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Kn.baseImageUrl+"point-green.png",otherControlPointImageUrl:Kn.baseImageUrl+"point-yellow.png"});let ri=Kn;(t=>{t.createDefaultProps=()=>({...Ut.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let sF=0;class pC extends a.Destroyable{constructor(e,n){super();v(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_id",sF++);v(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new rs(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class fC extends pC{constructor(i,e){super(i,e)}}class Xe extends ri{constructor(e){super(e);v(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));v(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Ni(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Xe.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new fC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Xe.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new rF(this,s)));const d=l.disposer.disposeVar(new lF(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Xe||(Xe={})),a.extendClassProps(Xe.prototype,Xe.createDefaultProps);class rF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new fC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Xe.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Xe.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function aF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class lF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(aF(e,n)))),(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class gC extends Xe{constructor(i){super(i),this.loop=!1}}class mC extends Xe{constructor(i){super(i),this.loop=!0}}class Vh extends pC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??xe.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??xe.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??xe.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=lu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??xe.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??xe.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Vh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class xe extends ri{constructor(e){super(e);v(this,"_menuPoiCommand",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new cF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new sn(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??xe.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new hF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??xe.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??xe.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??xe.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=lu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Vh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Vh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(xe||(xe={})),a.extendClassProps(xe.prototype,xe.createDefaultProps);class cF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class hF extends a.Destroyable{constructor(e){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new uF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class uF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class vC extends xe{constructor(i){super(i),this.loop=!1}}class yC extends xe{constructor(i){super(i),this.loop=!0}}class ir extends Xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(ir||(ir={})),a.extendClassProps(ir.prototype,ir.createDefaultProps);class No extends xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);class wC extends Xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class CC extends xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class nr extends Xe{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class or extends xe{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class _C extends No{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class _t extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);v(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Xe&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;else this.currentEditing instanceof Ni&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Kl=class Kl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Ni(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};v(Kl,"type",Kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,Kl));let lg=Kl;const Jl=class Jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};v(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,Jl));let cg=Jl;const jl=class jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new rn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};v(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,jl));let hg=jl;const ec=class ec extends _t{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=Mt({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=Mt({originPosition:r},[u.position])[0][0];u.position=wn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=Mt({originPosition:r},u.points)[0];u.points=wn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=Mt({originPosition:r},[s])[0][0];const c=Mt({originPosition:r},o.points)[0];o.points=wn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};v(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,ec));let Uh=ec;const tc=class tc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new ir(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(Ke([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Le(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Wi(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};v(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,tc));let ug=tc;const ic=class ic extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new No(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(Ke([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Le(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Wi(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,ic));let dg=ic;const nc=class nc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new mC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};v(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,nc));let pg=nc;const oc=class oc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};v(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,oc));let fg=oc;const sc=class sc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new gC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};v(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,sc));let gg=sc;const rc=class rc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new vC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};v(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,rc));let mg=rc;const ac=class ac extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};v(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,ac));let vg=ac;const lc=class lc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};v(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,lc));let yg=lc;const cc=class cc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};v(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,cc));let wg=cc;const hc=class hc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};v(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,hc));let Cg=hc;const uc=class uc extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new _C(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=s instanceof a.ESClassification||s instanceof a.ESPolygonFence;let d=a.getMinMaxCorner(s.points).center,p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(m=>[m[0],m[1],m[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(uc,"type",uc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,uc));let _g=uc;const ot=class ot extends a.Destroyable{constructor(e,n,o,s=!0){super();v(this,"czmViewer");v(this,"sceneObject");v(this,"editingModes",[]);v(this,"editingID");v(this,"useKeyToSwitch");v(this,"currentIndex",0);v(this,"currentEditingMode");v(this,"currentEditingWrapper");v(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));v(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(ot.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_ESCAPE&&ot.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===ot.MOUSE_LEFT&&a.nextAnimateFrame(()=>{ot.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&ot.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){ot.stop(),ot.esEditModeInstance=new ot(e,n,o,s)}static stop(){const e=ot.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}ot.esEditModeInstance=void 0}};v(ot,"KEY_ESCAPE","Escape"),v(ot,"KEY_SPACE","Space"),v(ot,"MOUSE_LEFT",0),v(ot,"esEditModeInstance");let Wh=ot;function PC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Uh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class dF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.registerCreatedEventUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class pF extends a.Destroyable{constructor(e){super();v(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new dF(e,n)}))}}class fF extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new gF(i)}))}}class gF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new mF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class mF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class vF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class yF extends a.Destroyable{constructor(e){var r;super();v(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Co(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function wF(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.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}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function CF(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function _F(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function PF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function bF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function SF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),m=new s,y=new s;d.prototype.createMesh=function(_){_=_??ye.Frozen.EMPTY_OBJECT;const P=_.tilingScheme,C=_.x,S=_.y,E=_.level,A=_.exaggeration??1,R=_.exaggerationRelativeHeight??0,O=_.throttle??!0,N=P.ellipsoid;P.tileXYToNativeRectangle(C,S,E,m),P.tileXYToRectangle(C,S,E,y);const V=N.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const z=(O?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:m,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:N,skirtHeight:this._skirtHeight,exaggeration:A,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(z))return;const B=this;return z.then(function(w){return B._mesh=new u(V,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,i.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),c.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),B._minimumHeight=w.minimumHeight,B._maximumHeight=w.maximumHeight,B._buffer=void 0,B._mesh})}}function xF(){return h.VERSION.split(".").map(i=>parseInt(i))}let Pg;function EF(){return Pg||(Pg=xF()),Pg}function AF(){const t=EF();t[0]===1&&t[1]>=92?SF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function TF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function MF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function IF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const DF=`#ifdef GL_OES_standard_derivatives
|
|
1924
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},De,t)}class oF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[yi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const m=ag(f,g,d.normal),y=ag(d.origin,f,d.normal),_=ag(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[yi.rotationNum[u]]=n.startRotation+m,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=_}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[yi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Wi(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function ag(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const Xo=class Xo extends Zt{constructor(e){super();v(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));v(this,"_movingPlaneType",this.disposeVar(a.react("none")));v(this,"_circles");v(this,"_czmCameraModel");v(this,"_cartesian");v(this,"_planes",{heading:this.disposeVar(new jR(this)),pitch:this.disposeVar(new eF(this)),roll:this.disposeVar(new tF(this))});v(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new oF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Le(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new rt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new tr(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=Xo.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[Xo.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[Xo.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};v(Xo,"rotationNum",{heading:0,pitch:1,roll:2}),v(Xo,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let yi=Xo;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(yi||(yi={})),a.extendClassProps(yi.prototype,yi.createDefaultProps);const Yo=class Yo extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Yo.defaults.positions[0],this.stopPosition??Yo.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Yo.defaults.positions[0],i??Yo.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new be(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};v(Yo,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Oo=Yo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(Oo||(Oo={})),a.extendClassProps(Oo.prototype,Oo.createDefaultProps);class rn extends Zt{constructor(e){super();v(this,"_lastPosition");v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});v(this,"_scaleAxis");v(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!Jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;ko(l,r),this._opInfo.constraintMode.value==="x"?jn(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?jn(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const m=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=m:p-=m),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=m:f-=m),p<=0&&(p+=m),f<=0&&(f+=m),this.scale=[p??1,f??1,this.scale[2]??1]})})));v(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!vc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(re(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new mu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=rn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const m=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??rn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ou(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(m=>{m.pointerEvent&&u(m.pointerEvent)})),await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const m=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,m,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),m.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new Oo(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(rn||(rn={})),a.extendClassProps(rn.prototype,rn.createDefaultProps);const Kn=class Kn extends Ut{constructor(e){super();v(this,"_editingPoints",this.disposeVar(new a.ObservableArray));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_currentProcess");v(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));v(this,"_status",this.disposeVar(a.react("None")));v(this,"_positionsChanged",this.ad(new a.Event));v(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??Kn.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??Kn.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new be(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};v(Kn,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),v(Kn,"defaults",{...Ut.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Kn.baseImageUrl+"point-green.png",otherControlPointImageUrl:Kn.baseImageUrl+"point-yellow.png"});let ri=Kn;(t=>{t.createDefaultProps=()=>({...Ut.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let sF=0;class pC extends a.Destroyable{constructor(e,n){super();v(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_id",sF++);v(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new rs(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class fC extends pC{constructor(i,e){super(i,e)}}class Xe extends ri{constructor(e){super(e);v(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));v(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Ni(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Xe.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new fC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Xe.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new rF(this,s)));const d=l.disposer.disposeVar(new lF(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Xe||(Xe={})),a.extendClassProps(Xe.prototype,Xe.createDefaultProps);class rF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new fC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Xe.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Xe.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function aF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class lF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(aF(e,n)))),(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class gC extends Xe{constructor(i){super(i),this.loop=!1}}class mC extends Xe{constructor(i){super(i),this.loop=!0}}class Vh extends pC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??xe.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??xe.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??xe.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=lu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??xe.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??xe.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Vh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class xe extends ri{constructor(e){super(e);v(this,"_menuPoiCommand",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new cF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new sn(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??xe.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new hF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??xe.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??xe.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??xe.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=lu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Vh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Vh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(xe||(xe={})),a.extendClassProps(xe.prototype,xe.createDefaultProps);class cF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class hF extends a.Destroyable{constructor(e){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new uF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class uF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class vC extends xe{constructor(i){super(i),this.loop=!1}}class yC extends xe{constructor(i){super(i),this.loop=!0}}class ir extends Xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(ir||(ir={})),a.extendClassProps(ir.prototype,ir.createDefaultProps);class No extends xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",xe.baseImageUrl+"add.png"],["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",xe.baseImageUrl+"delete.png"],["modify","修改当前控制点","",xe.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);class wC extends Xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class CC extends xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class nr extends Xe{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class or extends xe{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class _C extends No{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class _t extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);v(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Xe&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning)){if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}}else this.currentEditing instanceof Ni&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Kl=class Kl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Ni(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};v(Kl,"type",Kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,Kl));let lg=Kl;const Jl=class Jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};v(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,Jl));let cg=Jl;const jl=class jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new rn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};v(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,jl));let hg=jl;const ec=class ec extends _t{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=Mt({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=Mt({originPosition:r},[u.position])[0][0];u.position=wn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=Mt({originPosition:r},u.points)[0];u.points=wn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=Mt({originPosition:r},[s])[0][0];const c=Mt({originPosition:r},o.points)[0];o.points=wn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};v(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,ec));let Uh=ec;const tc=class tc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new ir(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(Ke([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Le(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Wi(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};v(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,tc));let ug=tc;const ic=class ic extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new No(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(Ke([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Le(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Wi(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,ic));let dg=ic;const nc=class nc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new mC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};v(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,nc));let pg=nc;const oc=class oc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};v(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,oc));let fg=oc;const sc=class sc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new gC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};v(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,sc));let gg=sc;const rc=class rc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new vC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};v(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,rc));let mg=rc;const ac=class ac extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};v(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,ac));let vg=ac;const lc=class lc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};v(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,lc));let yg=lc;const cc=class cc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};v(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,cc));let wg=cc;const hc=class hc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};v(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,hc));let Cg=hc;const uc=class uc extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new _C(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=s instanceof a.ESClassification||s instanceof a.ESPolygonFence;let d=a.getMinMaxCorner(s.points).center,p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(m=>[m[0],m[1],m[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(uc,"type",uc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,uc));let _g=uc;const ot=class ot extends a.Destroyable{constructor(e,n,o,s=!0){super();v(this,"czmViewer");v(this,"sceneObject");v(this,"editingModes",[]);v(this,"editingID");v(this,"useKeyToSwitch");v(this,"currentIndex",0);v(this,"currentEditingMode");v(this,"currentEditingWrapper");v(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));v(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(ot.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_ESCAPE&&ot.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===ot.MOUSE_LEFT&&a.nextAnimateFrame(()=>{ot.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&ot.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){ot.stop(),ot.esEditModeInstance=new ot(e,n,o,s)}static stop(){const e=ot.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}ot.esEditModeInstance=void 0}};v(ot,"KEY_ESCAPE","Escape"),v(ot,"KEY_SPACE","Space"),v(ot,"MOUSE_LEFT",0),v(ot,"esEditModeInstance");let Wh=ot;function PC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Uh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class dF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.registerCreatedEventUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class pF extends a.Destroyable{constructor(e){super();v(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new dF(e,n)}))}}class fF extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new gF(i)}))}}class gF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new mF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class mF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class vF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class yF extends a.Destroyable{constructor(e){var r;super();v(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Co(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function wF(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.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}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function CF(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function _F(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function PF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function bF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function SF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),m=new s,y=new s;d.prototype.createMesh=function(_){_=_??ye.Frozen.EMPTY_OBJECT;const P=_.tilingScheme,C=_.x,S=_.y,E=_.level,A=_.exaggeration??1,R=_.exaggerationRelativeHeight??0,O=_.throttle??!0,N=P.ellipsoid;P.tileXYToNativeRectangle(C,S,E,m),P.tileXYToRectangle(C,S,E,y);const V=N.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const z=(O?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:m,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:N,skirtHeight:this._skirtHeight,exaggeration:A,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(z))return;const B=this;return z.then(function(w){return B._mesh=new u(V,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,i.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),c.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),B._minimumHeight=w.minimumHeight,B._maximumHeight=w.maximumHeight,B._buffer=void 0,B._mesh})}}function xF(){return h.VERSION.split(".").map(i=>parseInt(i))}let Pg;function EF(){return Pg||(Pg=xF()),Pg}function AF(){const t=EF();t[0]===1&&t[1]>=92?SF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function TF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function MF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function IF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const DF=`#ifdef GL_OES_standard_derivatives
|
|
1925
1925
|
#extension GL_OES_standard_derivatives : enable
|
|
1926
1926
|
#endif
|
|
1927
1927
|
|
|
@@ -2255,10 +2255,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2255
2255
|
`;function R4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
2256
2256
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
2257
2257
|
gitee地址:${t}
|
|
2258
|
-
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new pF(this)),this.ad(new fF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new yF(this)})),this._viewerLegend=this.dv(new E4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(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 mL(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&&kt(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],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Wt(e),rotation:Ko(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let s=o.positionWC;const r=h.Cartesian3.fromDegrees(...e),l=h.Cartesian3.distance(o.positionWC,r),c=h.Cartesian3.subtract(r,s,new h.Cartesian3);h.Cartesian3.normalize(c,c);const u=h.Transforms.rotationMatrixFromPositionVelocity(s,c,h.Ellipsoid.WGS84),d=h.Matrix4.fromRotationTranslation(u,s);var p=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(d,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),f=h.Matrix4.multiply(h.Matrix4.inverse(p,new h.Matrix4),d,new h.Matrix4),g=h.Matrix4.getMatrix3(f,new h.Matrix3),m=h.Quaternion.fromRotationMatrix(g),y=h.HeadingPitchRoll.fromQuaternion(m);const _=Ko(o);return{distance:l,heading:h.Math.toDegrees(y.heading)+90,pitch:h.Math.toDegrees(y.pitch),flyDuration:1,hDelta:-(_[0]-(h.Math.toDegrees(y.heading)+90)),pDelta:_[1]-h.Math.toDegrees(y.pitch)}}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&&xr(l,r)}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&&xr(f,p)}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&&xr(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Wt(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=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.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 bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(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=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Mt(e,n)}localPositionsToPositions(e,n){return wn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(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=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",D4,I4,!0),new a.FunctionProperty([],()=>st.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)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",R4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",vF),v(st,"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}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...M4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.4.7",e="2025-09-26T07:13:38.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="3539538c038391d429fe888eb3bf9f325dd2ea18",l=((Date.now()-1758870818e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2258
|
+
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new pF(this)),this.ad(new fF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new yF(this)})),this._viewerLegend=this.dv(new E4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(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 mL(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&&kt(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],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Wt(e),rotation:Ko(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let s=o.positionWC;const r=h.Cartesian3.fromDegrees(...e),l=h.Cartesian3.distance(o.positionWC,r),c=h.Cartesian3.subtract(r,s,new h.Cartesian3);h.Cartesian3.normalize(c,c);const u=h.Transforms.rotationMatrixFromPositionVelocity(s,c,h.Ellipsoid.WGS84),d=h.Matrix4.fromRotationTranslation(u,s);var p=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(d,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),f=h.Matrix4.multiply(h.Matrix4.inverse(p,new h.Matrix4),d,new h.Matrix4),g=h.Matrix4.getMatrix3(f,new h.Matrix3),m=h.Quaternion.fromRotationMatrix(g),y=h.HeadingPitchRoll.fromQuaternion(m);const _=Ko(o);return{distance:l,heading:h.Math.toDegrees(y.heading)+90,pitch:h.Math.toDegrees(y.pitch),flyDuration:1,hDelta:-(_[0]-(h.Math.toDegrees(y.heading)+90)),pDelta:_[1]-h.Math.toDegrees(y.pitch)}}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&&xr(l,r)}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&&xr(f,p)}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&&xr(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Wt(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=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.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 bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(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=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Mt(e,n)}localPositionsToPositions(e,n){return wn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(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=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",D4,I4,!0),new a.FunctionProperty([],()=>st.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)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",R4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",vF),v(st,"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}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...M4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.4.8",e="2025-10-15T02:35:37.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="be75c02bf56d7cffcdaa20633c6d5ce31c0717a3",l=((Date.now()-1760495737e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2259
2259
|
%c${o?o+`
|
|
2260
2260
|
`:""}当前网站正在使用${t},此软件版权归${n}所有
|
|
2261
|
-
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
2261
|
+
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","be75c02bf56d7cffcdaa20633c6d5ce31c0717a3")},get info(){return c},get date(){return"2025-10-15T02:35:37.000Z"},get author(){return"suplyang"},get version(){return"3.4.8"},get name(){return"earthsdk3-cesium"},get commitId(){return"be75c02bf56d7cffcdaa20633c6d5ce31c0717a3"},print(){console.info(this.info,`
|
|
2262
2262
|
font-size: 18px;
|
|
2263
2263
|
font-weight: 1000;
|
|
2264
2264
|
line-height: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditingWrapper.d.ts","sourceRoot":"","sources":["../../../../src/EditingSystem/wrapper/BaseEditingWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,8BAAsB,kBAAmB,SAAQ,YAAY;IACzD,OAAO,CAAC,eAAe,CAA0D;IACjF,IAAI,cAAc,IACQ,OAAO,GAAG,SAAS,CADc;IAC3D,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAAyC;IACtF,IAAI,qBAAqB,6EAA2C;gBACxD,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"BaseEditingWrapper.d.ts","sourceRoot":"","sources":["../../../../src/EditingSystem/wrapper/BaseEditingWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,8BAAsB,kBAAmB,SAAQ,YAAY;IACzD,OAAO,CAAC,eAAe,CAA0D;IACjF,IAAI,cAAc,IACQ,OAAO,GAAG,SAAS,CADc;IAC3D,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAAyC;IACtF,IAAI,qBAAqB,6EAA2C;gBACxD,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,OAAO;CA4BzF"}
|