earthsdk3-cesium 3.10.0 → 3.10.1
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.
|
@@ -1432,7 +1432,7 @@ ${qL}
|
|
|
1432
1432
|
|
|
1433
1433
|
out_FragColor = finalColor;
|
|
1434
1434
|
}
|
|
1435
|
-
`,this._clampedIntensity=Math.max(1,e.fireHeight),this._totalDistance=A,this._startTime=performance.now(),this._preRenderListener&&this._preRenderListener(),this._preRenderListener=(I=this.czmViewer.viewer)==null?void 0:I.scene.preRender.addEventListener(()=>{const F=(performance.now()-this._startTime)*.001;r.setUniformMap({u_time:F,u_totalDistance:this._totalDistance,u_height:e.fireHeight})})}flyTo(e,n){const{sceneObject:r,czmViewer:s,geoPolygon:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):r.points&&r.points.length>=3?(xe(s,r,n,r.points,e),!0):!1:!1}};w(qg,"type",qg.register("ESCesiumViewer",u.ESGeoPolygonWithFire.type,qg));let hb=qg;const kg=class kg extends mn{constructor(e,n){super(e,n);w(this,"_czmGeoESRectangle");w(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new vt(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Fo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,o=this._geoPolyline;o.arcType="RHUMB",this.dispose(u.track([o,"color"],[e,"strokeColor"])),this.dispose(u.track([o,"width"],[e,"strokeWidth"])),this.dispose(u.track([o,"ground"],[e,"strokeGround"])),this.dispose(u.track([s,"ground"],[e,"fillGround"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"]));{const a=()=>{o.show=e.show&&e.stroked,s.show=e.show&&e.filled};a();const l=this.disposeVar(u.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};a();const l=this.disposeVar(u.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:A}=u.getMinMaxCorner(l);s.rectangle=[c[0],c[1],A[0],A[1]],s.height=l[0][2],s.extrudedHeight=l[0][2];const f=l.map(v=>(l&&(v[2]=l[0][2]),v)),d=f[0],g=f[1],m=[d,[d[0],g[1],d[2]],g,[g[0],d[1],g[2]]];o.positions=[...m,d]}else s.rectangle=void 0,o.positions=void 0,s.height=0,s.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:r,czmViewer:s}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):r.points?(xe(s,r,n,r.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,czmGeoESRectangle:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):r.points?(xe(s,r,n,r.points,e),!0):!1:!1}};w(kg,"type",kg.register("ESCesiumViewer",u.ESGeoRectangle.type,kg));let fb=kg;class Ld extends u.Destroyable{constructor(e,n){super();w(this,"_flyToEvent",this.disposeVar(new u.Event));w(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Wl(e,n));const{geoPolygon:r}=this;this.dispose(u.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(o=>{r.flyTo(o)})),this.dispose(u.bind([r,"show"],[this,"show"])),this.dispose(u.bind([r,"fill"],[this,"filled"])),this.dispose(u.bind([r,"strokeGround"],[this,"strokeGround"])),this.dispose(u.bind([r,"ground"],[this,"ground"])),this.dispose(u.bind([r,"outline"],[this,"outline"])),this.dispose(u.bind([r,"outlineColor"],[this,"outlineColor"])),this.dispose(u.bind([r,"outlineWidth"],[this,"outlineWidth"])),this.dispose(u.bind([r,"color"],[this,"color"])),this.dispose(u.bind([r,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const o=fx([...this.positions,this.positions[0]]);r.positions=o}else r.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:u.reactArray([1,1,1,1]),outlineWidth:1,color:u.reactArrayWithUndefined([1,1,1,.5]),positions:u.reactPositions(void 0),depth:0})})(Ld||(Ld={})),u.extendClassProps(Ld.prototype,Ld.createDefaultProps);const Xg=class Xg extends mn{constructor(e,n){super(e,n);w(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Ld(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.bind([s,"positions"],[e,"points"])),this.dispose(u.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(u.track([s,"outline"],[e,"stroked"])),this.dispose(u.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(u.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(u.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(u.track([s,"filled"],[e,"filled"])),this.dispose(u.track([s,"color"],[e,"fillColor"])),this.dispose(u.track([s,"ground"],[e,"ground"]));{const o=()=>{s.ground=e.ground||e.fillGround};o();const a=this.dv(u.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(o))}{const o=()=>{s.color=e.filled?e.fillColor:Rd.defaults.fillStyle.color};o();const a=this.disposeVar(u.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(o))}this.dispose(u.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:r,czmViewer:s,geoSmoothPolygon:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,geoSmoothPolygon:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}};w(Xg,"type",Xg.register("ESCesiumViewer",Rd.type,Xg));let pb=Xg;const Yg=class Yg extends He{constructor(e,n){super(e,n);w(this,"_czmModel");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new An(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(a=>{var l;s.activeAnimationsJson=(l=s.gltf.animations)==null?void 0:l.map((c,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"})),e.czmModelReadyEvent.emit(a),e.readyEvent.emit(a)})),this.ad(new Iy(r,this._czmModel)),this.d(u.track([s,"show"],[e,"show"])),this.d(u.track([s,"color"],[e,"czmColor"])),this.d(u.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(u.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.ad(u.createEventsCallFunc([e.positionChanged,e.positionOffsetChanged],()=>{s.position=u.geoDestination(e.position,e.positionOffset)},{immediate:!0})),this.d(u.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(u.track([s,"scale"],[e,"scale"])),this.ad(u.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(u.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>a(l)))}{const a=()=>{var l,c;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(c=e.czmEnvironmentMapManager)==null?void 0:c.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=l};a(),this.d(e.rotationChanged.don(a));{const l=()=>{if(a(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(c=>{const A=JSON.parse(JSON.stringify(c));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(a=>{s.setMaterial(a)}));{const a=()=>{const l=[...s.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};a(),this.d(s.rotationChanged.don(a))}{const a=this.dv(u.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};l(),this.d(a.don(l))}const o=()=>{var a;s.url=u.ESSceneObject.context.getStrFromEnv(My(typeof e.url=="string"?e.url:((a=e.url)==null?void 0:a.url)??u.ESGltfModel.defaults.url))};o(),this.d(e.urlChanged.don(o)),this.d(e.setNodePositionEvent.don((a,l)=>{s.setNodeTranslation(a,l)})),this.d(e.setNodeRotationEvent.don((a,l)=>{s.setNodeRotation(a,l)})),this.d(e.setNodeScaleEvent.don((a,l)=>{s.setNodeScale(a,l)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:r,czmViewer:s,model:o}=this;return s.actived?r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(o&&Ni(s,r,n,e,o,!0),!!o):!1}};w(Yg,"type",Yg.register("ESCesiumViewer",u.ESGltfModel.type,Yg));let db=Yg;function XL(i,t){const e=i[0]-t[0],n=i[1]-t[1],r=i[2]-t[2];return Math.sqrt(e*e+n*n+r*r)}class Ud extends u.Destroyable{constructor(e,n){super();w(this,"_pickedEvent",this.disposeVar(new u.Event));w(this,"_flyToEvent",this.disposeVar(new u.Event));w(this,"_distance",this.disposeVar(u.react(0)));w(this,"_surfaceDistance",this.disposeVar(u.react(0)));w(this,"_height",this.disposeVar(u.react(0)));w(this,"_middlePosition",this.disposeVar(u.reactArrayWithUndefined(void 0)));w(this,"_heightPosition",this.disposeVar(u.reactArrayWithUndefined(void 0)));const r=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const o=this._surfaceDistance.value=u.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(o*o+a*a)}else if(this.arcType==="RHUMB"){const o=this._surfaceDistance.value=u.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(o*o+a*a)}else if(this.arcType==="NONE"){const o=u.lbhToXyz(this.positions[0]),a=u.lbhToXyz(this.positions[1]);this._distance.value=XL(o,a),this._surfaceDistance.value=XL(u.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};r();const s=this.disposeVar(u.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(r));{const o=this.disposeVar(new vt(e,n));o.ground=!1,o.loop=!1,this.dispose(u.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(u.bind([o,"arcType"],[this,"arcType"])),this.dispose(u.bind([o,"color"],[this,"color"])),this.dispose(u.bind([o,"dashLength"],[this,"dashLength"])),this.dispose(u.bind([o,"dashPattern"],[this,"dashPattern"])),this.dispose(u.bind([o,"gapColor"],[this,"gapColor"])),this.dispose(u.bind([o,"hasArrow"],[this,"hasArrow"])),this.dispose(u.bind([o,"hasDash"],[this,"hasDash"])),this.dispose(u.bind([o,"show"],[this,"show"])),this.dispose(u.bind([o,"width"],[this,"width"])),this.dispose(u.bind([o,"depthTest"],[this,"depthTest"]));{o.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[c,A]=this.positions;o.positions=[c,A,[c[0],c[1],A[2]]]}else o.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&o.flyTo(l)}));const a=this.disposeVar(new hi(e,n));this.dispose(u.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(u.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(u.track([a,"show"],[this,"show"]));{const l=()=>{a.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{a.innerHTML=tc(`高度: ${Ry(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(a.pickedEvent.don(l=>{ya(l)===0&&this.pickedEvent.emit(l)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:u.reactPositions(void 0),width:1,color:u.reactArray([1,1,1,1]),hasDash:!1,gapColor:u.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Ud||(Ud={})),u.extendClassProps(Ud.prototype,Ud.createDefaultProps);const $g=class $g extends mn{constructor(e,n){super(e,n);w(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Ud(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(u.bind([s,"positions"],[e,"points"]));{const o=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):c==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const f=A.materialParams;Reflect.has(f,"gapColor")&&(s.gapColor=f.gapColor??[0,0,0,0]),Reflect.has(f,"dashLength")&&(s.dashLength=f.dashLength),Reflect.has(f,"dashPattern")&&(s.dashPattern=f.dashPattern)}catch(f){console.error(f)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};o();const a=this.disposeVar(u.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(o))}this.dispose(s.pickedEvent.disposableOn(o=>{ya(o)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(o)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:r,czmViewer:s,czmHeightMeasurement:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,czmHeightMeasurement:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}};w($g,"type",$g.register("ESCesiumViewer",u.ESHeightMeasurement.type,$g));let gb=$g;const VZ={standing:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],walking:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],running:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Zg=class Zg extends He{constructor(e,n){super(e,n);w(this,"_czmModelPrimitive");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new An(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(u.track([s,"show"],[e,"show"])),this.ad(u.createEventsCallFunc([e.positionChanged,e.positionOffsetChanged],()=>{s.position=u.geoDestination(e.position,e.positionOffset)},{immediate:!0}));{const f=()=>{const d=[...e.rotation??[0,0,0]];d[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=d};f(),this.d(e.rotationChanged.don(f));{const d=()=>{if(f(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(g=>{const m=JSON.parse(JSON.stringify(g));return!m.rotation&&(m.rotation=[0,0,0]),m.rotation[0]+=90,m})};d(),this.ad(e.instancesChanged.don(d))}}{const f=()=>{const d=[...s.rotation];d[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=d};f(),this.d(s.rotationChanged.don(f))}this.dispose(u.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(f=>{e.readyEvent.emit(f)}));{const f=this.dv(u.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),d=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};d(),this.d(f.don(d))}const o={worker:"worker.glb",police:"police.glb",pedestrian:"pedestrian.glb",stranger:"Stranger.glb",suitMan:"SuitsMan.glb",suitWoman:"SuitsWoman.glb",repairMan:"repairman.glb",fireMan:"fireMan.glb",firefighterWithWaterPump:"firefighterWithWaterPump.glb",firefighterWithFirestick:"firefighterWithFirestick.glb",firefighterWithDripIgniter:"firefighterWithDripIgniter.glb",firefighterWithBlower:"firefighterWithBlower.glb",firefighterWithHose:"firefighterWithHose.glb",firefighterWithThrowable:"firefighterWithThrowable.glb",firefighterWithToolkit:"firefighterWithToolkit.glb",firefighterWalking:"firefighterWalking.glb",firefighterUniform:"firefighterUniform.glb"},a=f=>u.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/"+f),l=()=>{s.activeAnimationsJson=void 0,s.url=a(o[e.mode]??o.worker)};this.dispose(e.modeChanged.disposableOn(()=>{l()})),l();const c=()=>{const f=e.animation??u.ESHuman.defaults.animation,d=VZ[f];if(!e.show||s.ready&&!s.gltf.animations||d[0].index&&d[0].index>=s.gltf.animations.length){s.activeAnimationsJson=void 0;return}s.activeAnimationsJson=d};c();const A=this.ad(u.createNextAnimateFrameEvent(s.readyEvent,e.showChanged,e.animationChanged));this.dispose(A.disposableOn(()=>c())),this.ad(new Iy(r,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:r,czmViewer:s,czmModelPrimitive:o}=this;return!s.actived||!s.viewer?!1:r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(o&&Ni(s,r,n,e,o,!0),!!o)}};w(Zg,"type",Zg.register("ESCesiumViewer",u.ESHuman.type,Zg));let mb=Zg;class YL extends u.Destroyable{constructor(e,n){super();w(this,"_czmGeoCanvasImagePoi");w(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){_e(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Qr,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new So(n,e.id));const r=this._czmGeoCanvasImagePoi;r.pickOnClick=!0,this.d(r.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=A=>{let f=A;return A.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),u.ESSceneObject.context.getStrFromEnv(My(f))},o=()=>{const A=s(typeof e.url=="string"?e.url:e.url.url);if(r.imageUri=A,e.sizeByContent){const d=new Image;d.src=A,d.onload=()=>{r.size=[d.width,d.height]}}else{const d=e.size;r.size=[...d]}},a=this.disposeVar(u.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>o())),o(),this.d(u.track([r,"zOrder"],[e,"zOrder"])),this.dispose(u.track([r,"show"],[e,"show"])),this.dispose(u.bind([r,"position"],[e,"position"])),this.ad(u.bind([r,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(u.bind([r,"hoverHighlight"],[e,"hoverHighlight"]));{const A=()=>{r.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,f=e.offset;A?r.originRatioAndOffset=[...A,-f[0],-f[1]]:r.originRatioAndOffset=[0,0,0,0]},c=this.ad(u.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(c.disposableOn(()=>l())),l(),this.dispose(r.clickEvent.disposableOn(A=>{const{offsetX:f,offsetY:d}=A,m={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[f,d]}};e.widgetEvent.emit(m)})),this.dispose(r.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const f={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(f)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class $L extends u.Destroyable{constructor(e,n,r){super();w(this,"_czmGeoImageModel");w(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});w(this,"_isPointEvent",!1);w(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Hr(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new ba(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(d=>{const g=d==null?void 0:d.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(d=>{var g,m,v;d.screenPosition&&this._isPointEvent&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(d.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(d.screenPosition[1]-((v=this._eventInfo.add)==null?void 0:v.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),u.engineObjectCreatedUpdate(this,e,()=>{const d=n.getEngineObject(e);this.ad(d.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const o=e.sizeByContent,l=(d=>{let g=d;return d.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),u.ESSceneObject.context.getStrFromEnv(My(g))})(typeof r.sceneObject.url=="string"?r.sceneObject.url:r.sceneObject.url.url),c=new Image;c.src=l,c.onload=()=>{if(o)s.size=[c.width/100,c.height/100];else{const d=e.size;s.size=[d[0]/100,d[1]/100]}},s.uri=l,this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.bind([s,"position"],[e,"position"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const d=()=>{s.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(bi([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}const A=()=>{const d=e.anchor,g=e.offset;d?s.originRatioAndOffset=[...d,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},f=this.ad(u.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(f.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const Jg=class Jg extends vc{constructor(e,n){super(e,n);w(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(u.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new u.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new YL(this.sceneObject,this.czmViewer):new $L(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:r,czmViewer:s,resetting:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(o&&o.obj&&o.obj.flyTo(e,n),r.flyOverEvent.emit(n,"over",s),!0):!1}};w(Jg,"type",Jg.register("ESCesiumViewer",u.ESImageLabel.type,Jg));let yb=Jg;const jg=class jg extends rs{constructor(e,n){super(e,n);w(this,"_czmImagery");w(this,"_innerUrl",this.ad(u.react("")));if(this._czmImagery=this.dv(new tu(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(u.track([s,"show"],[e,"show"])),this.d(u.bind([s,"alpha"],[e,"opacity"])),this.d(u.bind([s,"alpha"],[e,"czmAlpha"])),this.d(u.track([s,"splitDirection"],[e,"splitDirection"])),this.d(u.track([s,"brightness"],[e,"czmBrightness"])),this.d(u.track([s,"contrast"],[e,"czmContrast"])),this.d(u.track([s,"hue"],[e,"czmHue"])),this.d(u.track([s,"saturation"],[e,"czmSaturation"])),this.d(u.track([s,"gamma"],[e,"czmGamma"])),this.d(u.track([s,"rectangle"],[e,"rectangle"])),this.d(u.track([s,"zIndex"],[e,"zIndex"])),this.ad(u.track([s,"targetID"],[e,"targetID"])),this.ad(u.createEventsCallFunc(e.urlChanged,()=>{this.updateUrl()},{immediate:!0})),this.ad(u.createEventsCallFunc([this.innerUrlChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged],()=>{this.updateImageryProvider()},{immediate:!0}))}get czmImagery(){return this._czmImagery}get innerUrl(){return this._innerUrl.value}set innerUrl(e){this._innerUrl.value=e}get innerUrlChanged(){return this._innerUrl.changed}getOptionsType(e){switch(e){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}updateUrl(){const{sceneObject:e}=this;if(typeof e.url=="string")this.innerUrl=u.ESSceneObject.context.getStrFromEnv(e.url);else{const n=e.url;n.url=u.ESSceneObject.context.getStrFromEnv(n.url),this.innerUrl=n}}updateImageryProvider(){var c;const{sceneObject:e,czmImagery:n}=this;if(!this.innerUrl)return;const r=(((c=e.options)==null?void 0:c.type)??"auto").toLowerCase(),s=e.options??{};let o={type:"",url:this.innerUrl,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...s},a=this.innerUrl,l=typeof a=="string"?a:a.url;if(r==="auto"){const A=l.toLowerCase();if(A.startsWith("ion://")){const d=+A.substring(6);o={...s,assetId:d,type:"IonImageryProvider"}}else if(A.includes("{x}")||A.includes("{y}")||A.includes("{z}"))o.type="UrlTemplateImageryProvider";else if(A.includes("wmts"))o.type="WebMapTileServiceImageryProvider";else if(A.includes("wms"))o.type="WebMapServiceImageryProvider";else if(l.includes("/tilemapresource.xml")){const f=l.split("/tilemapresource.xml").join("");typeof a=="string"?a=f:a.url=f,o.url=a,o.type="TileMapServiceImageryProvider"}}else{if(r==="tms"&&l.includes("/tilemapresource.xml")){const A=l.split("/tilemapresource.xml").join("");typeof a=="string"?a=A:a.url=A,o.url=a}else if(r==="ion"&&l.startsWith("ion://")){const f=+l.substring(6);o={...s,assetId:f,type:"IonImageryProvider"}}o.type=this.getOptionsType(r)}console.log("imageryProvider",o),o.type&&(n.imageryProvider=o)}flyTo(e,n){const{sceneObject:r,czmViewer:s,czmImagery:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(o.flyTo(e&&e),r.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,czmImagery:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):(o.flyTo(e&&e),r.flyOverEvent.emit(n,"over",s),!0):!1}};w(jg,"type",jg.register("ESCesiumViewer",u.ESImageryLayer.type,jg));let Bw=jg;class GZ extends u.Destroyable{constructor(e,n,r,s){super();w(this,"_show");w(this,"_czmESCustomPrimitive");w(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(u.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new rt(n,this._sceneObject.id)),this._czmTexture=this.dv(new pt(n));const o=e,a=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(u.track([a,"show"],[this,"show"])),this.dispose(u.track([a,"show"],[o,"show"])),this.dispose(u.track([a,"allowPicking"],[o,"allowPicking"])),this.dispose(u.track([a,"rotation"],[o,"rotation"])),this.dispose(u.track([a,"position"],[o,"position"])),this.dispose(u.track([a,"scale"],[o,"scale"])),this.ad(o.allowPickingChanged.don(()=>{a.allowPicking=o.allowPicking,a.pass=o.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const c=()=>{const f=o.size/2,d=s[0].map(M=>M*f),g=s[1].map(M=>M*f),m=s[2].map(M=>M*f),v=s[3].map(M=>M*f),C=[...d,...g,...m,...v];let y=[0,3,2,0,2,1];(r=="north"||r=="west"||r=="bottom")&&(y=y.reverse());const x=[0,0],_=[1,0],E=[1,1],S=[0,1];let P=[];r=="east"||r=="south"?P=[..._,...x,...S,...E]:r=="west"?P=[..._,...E,...S,...x]:r=="top"?P=[...S,...E,..._,...x]:P=[...x,..._,...E,...S],a.indexTypedArray=new Uint16Array(y),a.attributes={position:{typedArray:new Float32Array(C),componentsPerAttribute:3},st:{typedArray:new Float32Array(P),componentsPerAttribute:2}},l.uri=u.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/${r}.${o.mode!="blueSky"?"png":"jpg"}`);const B=n.getCameraInfo();if(B!=null){const L=u.getDistancesFromPositions([o.position,B.position],"NONE")[0]/(o.size/2*o.autoOpacityFactor);this.changeOpacity(o.autoFollow?1:L)}const I=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:F,max:R}=I;a.setLocalAxisedBoundingBox(F,R)};c();const A=this.disposeVar(u.createNextAnimateFrameEvent(o.sizeChanged,o.modeChanged));this.dispose(A.disposableOn(c))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class WZ extends u.Destroyable{constructor(t,e,n){if(super(),!e.viewer)return;let r=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{o()}));function o(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const a=e.getCameraInfo();if(a!=null&&(s==null||s.position[0]!=a.position[0]||s.position[1]!=a.position[1]||s.position[2]!=a.position[2]||s.rotation[0]!=a.rotation[0]||s.rotation[1]!=a.rotation[1]||s.rotation[2]!=a.rotation[2])){s=a;const A=u.getDistancesFromPositions([t.position,s.position],"NONE")[0]/(t.size/2*t.autoOpacityFactor);t.autoFollow?(t.position=s.position,r&&(r=!1,n.forEach(f=>{f.changeOpacity(1)}))):n.forEach(f=>{f.changeOpacity(A)})}}o()}}const Ei=class Ei extends He{constructor(e,n){super(e,n);w(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ei._defaultLocalBox&&Ei._firstLoad&&(Ei._firstLoad=!1,Ei._defaultLocalBox=n.xbsjLocalBoxSources),Ei._eSLocalSkyBoxArr.push(e),this.d(()=>{Ei._eSLocalSkyBoxArr.includes(e)&&Ei._eSLocalSkyBoxArr.splice(Ei._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const o in s)if(Object.prototype.hasOwnProperty.call(s,o)){const a=s[o];this._czmSkyBoxComponents.push(this.dv(new GZ(e,n,o,a)))}{const o=this.disposeVar(u.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new u.ObjResettingWithEvent(o,()=>(this.ChangeAutoFollow(),new WZ(e,n,this._czmSkyBoxComponents))))}{const o=()=>{this.ChangeAutoFollow()},a=this.disposeVar(u.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(o))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ei._eSLocalSkyBoxArr.length-1;n>=0;n--){const r=Ei._eSLocalSkyBoxArr[n];if(r.autoFollow&&r.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/east.${r.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/west.${r.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/bottom.${r.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/top.${r.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/north.${r.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/south.${r.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ei._defaultLocalBox)}Ei._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ei._defaultLocalBox)}flyTo(e,n){const{sceneObject:r,czmViewer:s}=this;if(!s.actived)return!1;if(r.flyToParam||r.flyInParam)return super.flyTo(e,n);{const o=r.size??u.ESLocalSkyBox.defaults.size;return r.position?(Hr(s,r,n,r.position,o,e,!0),!0):!1}}};w(Ei,"type",Ei.register("ESCesiumViewer",u.ESLocalSkyBox.type,Ei)),w(Ei,"_defaultLocalBox"),w(Ei,"_firstLoad",!0),w(Ei,"_eSLocalSkyBoxArr",[]);let vb=Ei;const Ws=class Ws extends He{constructor(e,n){super(e,n);w(this,"_geoCustomDivPoi");w(this,"_textFunc",this.disposeVar(u.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new hi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.bind([s,"position"],[e,"position"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(o=>{(e.allowPicking??u.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(o)})),this.dispose(s.innerHtmlMounted.disposableOn(o=>{const a=o.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=l=>s.pickFromDiv(a,{type:"viewerPicking",pointerEvent:l}))}));{const o=()=>{if(!e.position)return;const l=(this.textFunc??Ws.defaultTextFunc_度格式)(e.position);s.innerHTML=tc(l)};o();const a=this.disposeVar(u.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(o))}{const o=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?Ws.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?Ws.defaultTextFunc_度分格式:Ws.defaultTextFunc_度分秒格式};o(),this.d(n.lonLatFormatChanged.don(()=>{o()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:r,czmViewer:s,geoCustomDivPoi:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(o.flyTo(e),r.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,geoCustomDivPoi:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):(o.flyTo(e),r.flyOverEvent.emit(n,"over",s),!0):!1}};w(Ws,"type",Ws.register("ESCesiumViewer",u.ESLocationMeasurement.type,Ws)),w(Ws,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,r=0,s=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1435
|
+
`,this._clampedIntensity=Math.max(1,e.fireHeight),this._totalDistance=A,this._startTime=performance.now(),this._preRenderListener&&this._preRenderListener(),this._preRenderListener=(I=this.czmViewer.viewer)==null?void 0:I.scene.preRender.addEventListener(()=>{const F=(performance.now()-this._startTime)*.001;r.setUniformMap({u_time:F,u_totalDistance:this._totalDistance,u_height:e.fireHeight})})}flyTo(e,n){const{sceneObject:r,czmViewer:s,geoPolygon:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):r.points&&r.points.length>=3?(xe(s,r,n,r.points,e),!0):!1:!1}};w(qg,"type",qg.register("ESCesiumViewer",u.ESGeoPolygonWithFire.type,qg));let hb=qg;const kg=class kg extends mn{constructor(e,n){super(e,n);w(this,"_czmGeoESRectangle");w(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new vt(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Fo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,o=this._geoPolyline;o.arcType="RHUMB",this.dispose(u.track([o,"color"],[e,"strokeColor"])),this.dispose(u.track([o,"width"],[e,"strokeWidth"])),this.dispose(u.track([o,"ground"],[e,"strokeGround"])),this.dispose(u.track([s,"ground"],[e,"fillGround"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"]));{const a=()=>{o.show=e.show&&e.stroked,s.show=e.show&&e.filled};a();const l=this.disposeVar(u.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};a();const l=this.disposeVar(u.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:A}=u.getMinMaxCorner(l);s.rectangle=[c[0],c[1],A[0],A[1]],s.height=l[0][2],s.extrudedHeight=l[0][2];const f=l.map(v=>(l&&(v[2]=l[0][2]),v)),d=f[0],g=f[1],m=[d,[d[0],g[1],d[2]],g,[g[0],d[1],g[2]]];o.positions=[...m,d]}else s.rectangle=void 0,o.positions=void 0,s.height=0,s.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:r,czmViewer:s}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):r.points?(xe(s,r,n,r.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,czmGeoESRectangle:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):r.points?(xe(s,r,n,r.points,e),!0):!1:!1}};w(kg,"type",kg.register("ESCesiumViewer",u.ESGeoRectangle.type,kg));let fb=kg;class Ld extends u.Destroyable{constructor(e,n){super();w(this,"_flyToEvent",this.disposeVar(new u.Event));w(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Wl(e,n));const{geoPolygon:r}=this;this.dispose(u.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(o=>{r.flyTo(o)})),this.dispose(u.bind([r,"show"],[this,"show"])),this.dispose(u.bind([r,"fill"],[this,"filled"])),this.dispose(u.bind([r,"strokeGround"],[this,"strokeGround"])),this.dispose(u.bind([r,"ground"],[this,"ground"])),this.dispose(u.bind([r,"outline"],[this,"outline"])),this.dispose(u.bind([r,"outlineColor"],[this,"outlineColor"])),this.dispose(u.bind([r,"outlineWidth"],[this,"outlineWidth"])),this.dispose(u.bind([r,"color"],[this,"color"])),this.dispose(u.bind([r,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const o=fx([...this.positions,this.positions[0]]);r.positions=o}else r.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:u.reactArray([1,1,1,1]),outlineWidth:1,color:u.reactArrayWithUndefined([1,1,1,.5]),positions:u.reactPositions(void 0),depth:0})})(Ld||(Ld={})),u.extendClassProps(Ld.prototype,Ld.createDefaultProps);const Xg=class Xg extends mn{constructor(e,n){super(e,n);w(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Ld(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.bind([s,"positions"],[e,"points"])),this.dispose(u.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(u.track([s,"outline"],[e,"stroked"])),this.dispose(u.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(u.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(u.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(u.track([s,"filled"],[e,"filled"])),this.dispose(u.track([s,"color"],[e,"fillColor"])),this.dispose(u.track([s,"ground"],[e,"ground"]));{const o=()=>{s.ground=e.ground||e.fillGround};o();const a=this.dv(u.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(o))}{const o=()=>{s.color=e.filled?e.fillColor:Rd.defaults.fillStyle.color};o();const a=this.disposeVar(u.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(o))}this.dispose(u.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:r,czmViewer:s,geoSmoothPolygon:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,geoSmoothPolygon:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}};w(Xg,"type",Xg.register("ESCesiumViewer",Rd.type,Xg));let pb=Xg;const Yg=class Yg extends He{constructor(e,n){super(e,n);w(this,"_czmModel");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new An(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(a=>{var l;s.activeAnimationsJson=(l=s.gltf.animations)==null?void 0:l.map((c,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"})),e.czmModelReadyEvent.emit(a),e.readyEvent.emit(a)})),this.ad(new Iy(r,this._czmModel)),this.d(u.track([s,"show"],[e,"show"])),this.d(u.track([s,"color"],[e,"czmColor"])),this.d(u.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(u.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.ad(u.createEventsCallFunc([e.positionChanged,e.positionOffsetChanged],()=>{s.position=u.geoDestination(e.position,e.positionOffset)},{immediate:!0})),this.d(u.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(u.track([s,"scale"],[e,"scale"])),this.ad(u.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(u.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>a(l)))}{const a=()=>{var l,c;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(c=e.czmEnvironmentMapManager)==null?void 0:c.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=l};a(),this.d(e.rotationChanged.don(a));{const l=()=>{if(a(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(c=>{const A=JSON.parse(JSON.stringify(c));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(a=>{s.setMaterial(a)}));{const a=()=>{const l=[...s.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};a(),this.d(s.rotationChanged.don(a))}{const a=this.dv(u.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};l(),this.d(a.don(l))}const o=()=>{var a;s.url=u.ESSceneObject.context.getStrFromEnv(My(typeof e.url=="string"?e.url:((a=e.url)==null?void 0:a.url)??u.ESGltfModel.defaults.url))};o(),this.d(e.urlChanged.don(o)),this.d(e.setNodePositionEvent.don((a,l)=>{s.setNodeTranslation(a,l)})),this.d(e.setNodeRotationEvent.don((a,l)=>{s.setNodeRotation(a,l)})),this.d(e.setNodeScaleEvent.don((a,l)=>{s.setNodeScale(a,l)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:r,czmViewer:s,model:o}=this;return s.actived?r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(o&&Ni(s,r,n,e,o,!0),!!o):!1}};w(Yg,"type",Yg.register("ESCesiumViewer",u.ESGltfModel.type,Yg));let db=Yg;function XL(i,t){const e=i[0]-t[0],n=i[1]-t[1],r=i[2]-t[2];return Math.sqrt(e*e+n*n+r*r)}class Ud extends u.Destroyable{constructor(e,n){super();w(this,"_pickedEvent",this.disposeVar(new u.Event));w(this,"_flyToEvent",this.disposeVar(new u.Event));w(this,"_distance",this.disposeVar(u.react(0)));w(this,"_surfaceDistance",this.disposeVar(u.react(0)));w(this,"_height",this.disposeVar(u.react(0)));w(this,"_middlePosition",this.disposeVar(u.reactArrayWithUndefined(void 0)));w(this,"_heightPosition",this.disposeVar(u.reactArrayWithUndefined(void 0)));const r=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const o=this._surfaceDistance.value=u.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(o*o+a*a)}else if(this.arcType==="RHUMB"){const o=this._surfaceDistance.value=u.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(o*o+a*a)}else if(this.arcType==="NONE"){const o=u.lbhToXyz(this.positions[0]),a=u.lbhToXyz(this.positions[1]);this._distance.value=XL(o,a),this._surfaceDistance.value=XL(u.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};r();const s=this.disposeVar(u.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(r));{const o=this.disposeVar(new vt(e,n));o.ground=!1,o.loop=!1,this.dispose(u.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(u.bind([o,"arcType"],[this,"arcType"])),this.dispose(u.bind([o,"color"],[this,"color"])),this.dispose(u.bind([o,"dashLength"],[this,"dashLength"])),this.dispose(u.bind([o,"dashPattern"],[this,"dashPattern"])),this.dispose(u.bind([o,"gapColor"],[this,"gapColor"])),this.dispose(u.bind([o,"hasArrow"],[this,"hasArrow"])),this.dispose(u.bind([o,"hasDash"],[this,"hasDash"])),this.dispose(u.bind([o,"show"],[this,"show"])),this.dispose(u.bind([o,"width"],[this,"width"])),this.dispose(u.bind([o,"depthTest"],[this,"depthTest"]));{o.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[c,A]=this.positions;o.positions=[c,A,[c[0],c[1],A[2]]]}else o.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&o.flyTo(l)}));const a=this.disposeVar(new hi(e,n));this.dispose(u.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(u.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(u.track([a,"show"],[this,"show"]));{const l=()=>{a.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{a.innerHTML=tc(`高度: ${Ry(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(a.pickedEvent.don(l=>{ya(l)===0&&this.pickedEvent.emit(l)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:u.reactPositions(void 0),width:1,color:u.reactArray([1,1,1,1]),hasDash:!1,gapColor:u.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Ud||(Ud={})),u.extendClassProps(Ud.prototype,Ud.createDefaultProps);const $g=class $g extends mn{constructor(e,n){super(e,n);w(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Ud(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(u.bind([s,"positions"],[e,"points"]));{const o=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):c==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const f=A.materialParams;Reflect.has(f,"gapColor")&&(s.gapColor=f.gapColor??[0,0,0,0]),Reflect.has(f,"dashLength")&&(s.dashLength=f.dashLength),Reflect.has(f,"dashPattern")&&(s.dashPattern=f.dashPattern)}catch(f){console.error(f)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};o();const a=this.disposeVar(u.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(o))}this.dispose(s.pickedEvent.disposableOn(o=>{ya(o)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(o)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:r,czmViewer:s,czmHeightMeasurement:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,czmHeightMeasurement:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):o.positions?(xe(s,r,n,o.positions,e),!0):!1:!1}};w($g,"type",$g.register("ESCesiumViewer",u.ESHeightMeasurement.type,$g));let gb=$g;const VZ={standing:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],walking:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],running:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Zg=class Zg extends He{constructor(e,n){super(e,n);w(this,"_czmModelPrimitive");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new An(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(u.track([s,"show"],[e,"show"])),this.ad(u.createEventsCallFunc([e.positionChanged,e.positionOffsetChanged],()=>{s.position=u.geoDestination(e.position,e.positionOffset)},{immediate:!0}));{const f=()=>{const d=[...e.rotation??[0,0,0]];d[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=d};f(),this.d(e.rotationChanged.don(f));{const d=()=>{if(f(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(g=>{const m=JSON.parse(JSON.stringify(g));return!m.rotation&&(m.rotation=[0,0,0]),m.rotation[0]+=90,m})};d(),this.ad(e.instancesChanged.don(d))}}{const f=()=>{const d=[...s.rotation];d[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=d};f(),this.d(s.rotationChanged.don(f))}this.dispose(u.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(f=>{e.readyEvent.emit(f)}));{const f=this.dv(u.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),d=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};d(),this.d(f.don(d))}const o={worker:"worker.glb",police:"police.glb",pedestrian:"pedestrian.glb",stranger:"Stranger.glb",suitMan:"SuitsMan.glb",suitWoman:"SuitsWoman.glb",repairMan:"repairman.glb",fireMan:"fireMan.glb",firefighterWithWaterPump:"firefighterWithWaterPump.glb",firefighterWithFirestick:"firefighterWithFirestick.glb",firefighterWithDripIgniter:"firefighterWithDripIgniter.glb",firefighterWithBlower:"firefighterWithBlower.glb",firefighterWithHose:"firefighterWithHose.glb",firefighterWithThrowable:"firefighterWithThrowable.glb",firefighterWithToolkit:"firefighterWithToolkit.glb",firefighterWalking:"firefighterWalking.glb",firefighterUniform:"firefighterUniform.glb"},a=f=>u.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/"+f),l=()=>{s.activeAnimationsJson=void 0,s.url=a(o[e.mode]??o.worker)};this.dispose(e.modeChanged.disposableOn(()=>{l()})),l();const c=()=>{var g,m;const f=e.animation??u.ESHuman.defaults.animation,d=VZ[f];if(!e.show||!s.ready||!((g=s.gltf)!=null&&g.animations)||d[0].index&&d[0].index>=((m=s.gltf)==null?void 0:m.animations.length)){s.activeAnimationsJson=void 0;return}s.activeAnimationsJson=d};c();const A=this.ad(u.createNextAnimateFrameEvent(s.readyEvent,e.showChanged,e.animationChanged));this.dispose(A.disposableOn(()=>c())),this.ad(new Iy(r,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:r,czmViewer:s,czmModelPrimitive:o}=this;return!s.actived||!s.viewer?!1:r.flyToParam||r.flyInParam?(super.flyTo(e,n),!0):(o&&Ni(s,r,n,e,o,!0),!!o)}};w(Zg,"type",Zg.register("ESCesiumViewer",u.ESHuman.type,Zg));let mb=Zg;class YL extends u.Destroyable{constructor(e,n){super();w(this,"_czmGeoCanvasImagePoi");w(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){_e(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Qr,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new So(n,e.id));const r=this._czmGeoCanvasImagePoi;r.pickOnClick=!0,this.d(r.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=A=>{let f=A;return A.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),u.ESSceneObject.context.getStrFromEnv(My(f))},o=()=>{const A=s(typeof e.url=="string"?e.url:e.url.url);if(r.imageUri=A,e.sizeByContent){const d=new Image;d.src=A,d.onload=()=>{r.size=[d.width,d.height]}}else{const d=e.size;r.size=[...d]}},a=this.disposeVar(u.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>o())),o(),this.d(u.track([r,"zOrder"],[e,"zOrder"])),this.dispose(u.track([r,"show"],[e,"show"])),this.dispose(u.bind([r,"position"],[e,"position"])),this.ad(u.bind([r,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(u.bind([r,"hoverHighlight"],[e,"hoverHighlight"]));{const A=()=>{r.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,f=e.offset;A?r.originRatioAndOffset=[...A,-f[0],-f[1]]:r.originRatioAndOffset=[0,0,0,0]},c=this.ad(u.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(c.disposableOn(()=>l())),l(),this.dispose(r.clickEvent.disposableOn(A=>{const{offsetX:f,offsetY:d}=A,m={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[f,d]}};e.widgetEvent.emit(m)})),this.dispose(r.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const f={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(f)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class $L extends u.Destroyable{constructor(e,n,r){super();w(this,"_czmGeoImageModel");w(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});w(this,"_isPointEvent",!1);w(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Hr(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new ba(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(d=>{const g=d==null?void 0:d.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(d=>{var g,m,v;d.screenPosition&&this._isPointEvent&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(d.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(d.screenPosition[1]-((v=this._eventInfo.add)==null?void 0:v.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),u.engineObjectCreatedUpdate(this,e,()=>{const d=n.getEngineObject(e);this.ad(d.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const o=e.sizeByContent,l=(d=>{let g=d;return d.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),u.ESSceneObject.context.getStrFromEnv(My(g))})(typeof r.sceneObject.url=="string"?r.sceneObject.url:r.sceneObject.url.url),c=new Image;c.src=l,c.onload=()=>{if(o)s.size=[c.width/100,c.height/100];else{const d=e.size;s.size=[d[0]/100,d[1]/100]}},s.uri=l,this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.bind([s,"position"],[e,"position"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const d=()=>{s.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(bi([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}const A=()=>{const d=e.anchor,g=e.offset;d?s.originRatioAndOffset=[...d,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},f=this.ad(u.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(f.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const Jg=class Jg extends vc{constructor(e,n){super(e,n);w(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(u.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new u.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new YL(this.sceneObject,this.czmViewer):new $L(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:r,czmViewer:s,resetting:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(o&&o.obj&&o.obj.flyTo(e,n),r.flyOverEvent.emit(n,"over",s),!0):!1}};w(Jg,"type",Jg.register("ESCesiumViewer",u.ESImageLabel.type,Jg));let yb=Jg;const jg=class jg extends rs{constructor(e,n){super(e,n);w(this,"_czmImagery");w(this,"_innerUrl",this.ad(u.react("")));if(this._czmImagery=this.dv(new tu(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(u.track([s,"show"],[e,"show"])),this.d(u.bind([s,"alpha"],[e,"opacity"])),this.d(u.bind([s,"alpha"],[e,"czmAlpha"])),this.d(u.track([s,"splitDirection"],[e,"splitDirection"])),this.d(u.track([s,"brightness"],[e,"czmBrightness"])),this.d(u.track([s,"contrast"],[e,"czmContrast"])),this.d(u.track([s,"hue"],[e,"czmHue"])),this.d(u.track([s,"saturation"],[e,"czmSaturation"])),this.d(u.track([s,"gamma"],[e,"czmGamma"])),this.d(u.track([s,"rectangle"],[e,"rectangle"])),this.d(u.track([s,"zIndex"],[e,"zIndex"])),this.ad(u.track([s,"targetID"],[e,"targetID"])),this.ad(u.createEventsCallFunc(e.urlChanged,()=>{this.updateUrl()},{immediate:!0})),this.ad(u.createEventsCallFunc([this.innerUrlChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged],()=>{this.updateImageryProvider()},{immediate:!0}))}get czmImagery(){return this._czmImagery}get innerUrl(){return this._innerUrl.value}set innerUrl(e){this._innerUrl.value=e}get innerUrlChanged(){return this._innerUrl.changed}getOptionsType(e){switch(e){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}updateUrl(){const{sceneObject:e}=this;if(typeof e.url=="string")this.innerUrl=u.ESSceneObject.context.getStrFromEnv(e.url);else{const n=e.url;n.url=u.ESSceneObject.context.getStrFromEnv(n.url),this.innerUrl=n}}updateImageryProvider(){var c;const{sceneObject:e,czmImagery:n}=this;if(!this.innerUrl)return;const r=(((c=e.options)==null?void 0:c.type)??"auto").toLowerCase(),s=e.options??{};let o={type:"",url:this.innerUrl,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...s},a=this.innerUrl,l=typeof a=="string"?a:a.url;if(r==="auto"){const A=l.toLowerCase();if(A.startsWith("ion://")){const d=+A.substring(6);o={...s,assetId:d,type:"IonImageryProvider"}}else if(A.includes("{x}")||A.includes("{y}")||A.includes("{z}"))o.type="UrlTemplateImageryProvider";else if(A.includes("wmts"))o.type="WebMapTileServiceImageryProvider";else if(A.includes("wms"))o.type="WebMapServiceImageryProvider";else if(l.includes("/tilemapresource.xml")){const f=l.split("/tilemapresource.xml").join("");typeof a=="string"?a=f:a.url=f,o.url=a,o.type="TileMapServiceImageryProvider"}}else{if(r==="tms"&&l.includes("/tilemapresource.xml")){const A=l.split("/tilemapresource.xml").join("");typeof a=="string"?a=A:a.url=A,o.url=a}else if(r==="ion"&&l.startsWith("ion://")){const f=+l.substring(6);o={...s,assetId:f,type:"IonImageryProvider"}}o.type=this.getOptionsType(r)}console.log("imageryProvider",o),o.type&&(n.imageryProvider=o)}flyTo(e,n){const{sceneObject:r,czmViewer:s,czmImagery:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(o.flyTo(e&&e),r.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,czmImagery:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):(o.flyTo(e&&e),r.flyOverEvent.emit(n,"over",s),!0):!1}};w(jg,"type",jg.register("ESCesiumViewer",u.ESImageryLayer.type,jg));let Bw=jg;class GZ extends u.Destroyable{constructor(e,n,r,s){super();w(this,"_show");w(this,"_czmESCustomPrimitive");w(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(u.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new rt(n,this._sceneObject.id)),this._czmTexture=this.dv(new pt(n));const o=e,a=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(u.track([a,"show"],[this,"show"])),this.dispose(u.track([a,"show"],[o,"show"])),this.dispose(u.track([a,"allowPicking"],[o,"allowPicking"])),this.dispose(u.track([a,"rotation"],[o,"rotation"])),this.dispose(u.track([a,"position"],[o,"position"])),this.dispose(u.track([a,"scale"],[o,"scale"])),this.ad(o.allowPickingChanged.don(()=>{a.allowPicking=o.allowPicking,a.pass=o.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const c=()=>{const f=o.size/2,d=s[0].map(M=>M*f),g=s[1].map(M=>M*f),m=s[2].map(M=>M*f),v=s[3].map(M=>M*f),C=[...d,...g,...m,...v];let y=[0,3,2,0,2,1];(r=="north"||r=="west"||r=="bottom")&&(y=y.reverse());const x=[0,0],_=[1,0],E=[1,1],S=[0,1];let P=[];r=="east"||r=="south"?P=[..._,...x,...S,...E]:r=="west"?P=[..._,...E,...S,...x]:r=="top"?P=[...S,...E,..._,...x]:P=[...x,..._,...E,...S],a.indexTypedArray=new Uint16Array(y),a.attributes={position:{typedArray:new Float32Array(C),componentsPerAttribute:3},st:{typedArray:new Float32Array(P),componentsPerAttribute:2}},l.uri=u.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/${r}.${o.mode!="blueSky"?"png":"jpg"}`);const B=n.getCameraInfo();if(B!=null){const L=u.getDistancesFromPositions([o.position,B.position],"NONE")[0]/(o.size/2*o.autoOpacityFactor);this.changeOpacity(o.autoFollow?1:L)}const I=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:F,max:R}=I;a.setLocalAxisedBoundingBox(F,R)};c();const A=this.disposeVar(u.createNextAnimateFrameEvent(o.sizeChanged,o.modeChanged));this.dispose(A.disposableOn(c))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class WZ extends u.Destroyable{constructor(t,e,n){if(super(),!e.viewer)return;let r=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{o()}));function o(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const a=e.getCameraInfo();if(a!=null&&(s==null||s.position[0]!=a.position[0]||s.position[1]!=a.position[1]||s.position[2]!=a.position[2]||s.rotation[0]!=a.rotation[0]||s.rotation[1]!=a.rotation[1]||s.rotation[2]!=a.rotation[2])){s=a;const A=u.getDistancesFromPositions([t.position,s.position],"NONE")[0]/(t.size/2*t.autoOpacityFactor);t.autoFollow?(t.position=s.position,r&&(r=!1,n.forEach(f=>{f.changeOpacity(1)}))):n.forEach(f=>{f.changeOpacity(A)})}}o()}}const Ei=class Ei extends He{constructor(e,n){super(e,n);w(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ei._defaultLocalBox&&Ei._firstLoad&&(Ei._firstLoad=!1,Ei._defaultLocalBox=n.xbsjLocalBoxSources),Ei._eSLocalSkyBoxArr.push(e),this.d(()=>{Ei._eSLocalSkyBoxArr.includes(e)&&Ei._eSLocalSkyBoxArr.splice(Ei._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const o in s)if(Object.prototype.hasOwnProperty.call(s,o)){const a=s[o];this._czmSkyBoxComponents.push(this.dv(new GZ(e,n,o,a)))}{const o=this.disposeVar(u.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new u.ObjResettingWithEvent(o,()=>(this.ChangeAutoFollow(),new WZ(e,n,this._czmSkyBoxComponents))))}{const o=()=>{this.ChangeAutoFollow()},a=this.disposeVar(u.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(o))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ei._eSLocalSkyBoxArr.length-1;n>=0;n--){const r=Ei._eSLocalSkyBoxArr[n];if(r.autoFollow&&r.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/east.${r.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/west.${r.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/bottom.${r.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/top.${r.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/north.${r.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/south.${r.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ei._defaultLocalBox)}Ei._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ei._defaultLocalBox)}flyTo(e,n){const{sceneObject:r,czmViewer:s}=this;if(!s.actived)return!1;if(r.flyToParam||r.flyInParam)return super.flyTo(e,n);{const o=r.size??u.ESLocalSkyBox.defaults.size;return r.position?(Hr(s,r,n,r.position,o,e,!0),!0):!1}}};w(Ei,"type",Ei.register("ESCesiumViewer",u.ESLocalSkyBox.type,Ei)),w(Ei,"_defaultLocalBox"),w(Ei,"_firstLoad",!0),w(Ei,"_eSLocalSkyBoxArr",[]);let vb=Ei;const Ws=class Ws extends He{constructor(e,n){super(e,n);w(this,"_geoCustomDivPoi");w(this,"_textFunc",this.disposeVar(u.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new hi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(u.track([s,"show"],[e,"show"])),this.dispose(u.bind([s,"position"],[e,"position"])),this.dispose(u.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(o=>{(e.allowPicking??u.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(o)})),this.dispose(s.innerHtmlMounted.disposableOn(o=>{const a=o.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=l=>s.pickFromDiv(a,{type:"viewerPicking",pointerEvent:l}))}));{const o=()=>{if(!e.position)return;const l=(this.textFunc??Ws.defaultTextFunc_度格式)(e.position);s.innerHTML=tc(l)};o();const a=this.disposeVar(u.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(o))}{const o=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?Ws.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?Ws.defaultTextFunc_度分格式:Ws.defaultTextFunc_度分秒格式};o(),this.d(n.lonLatFormatChanged.don(()=>{o()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:r,czmViewer:s,geoCustomDivPoi:o}=this;return s.actived?r.flyToParam||r.flyInParam?super.flyTo(e,n):(o.flyTo(e),r.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:r,czmViewer:s,geoCustomDivPoi:o}=this;return s.actived?r.flyInParam?super.flyIn(e,n):(o.flyTo(e),r.flyOverEvent.emit(n,"over",s),!0):!1}};w(Ws,"type",Ws.register("ESCesiumViewer",u.ESLocationMeasurement.type,Ws)),w(Ws,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,r=0,s=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1436
1436
|
纬度: ${r.toFixed(5)}°
|
|
1437
1437
|
高度: ${s.toFixed(2)}m`}),w(Ws,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[n,r,s]=Ax(e,!0);return`经度: ${n}
|
|
1438
1438
|
纬度: ${r}
|
|
@@ -4074,10 +4074,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4074
4074
|
`;function _ue(){const i="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4075
4075
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4076
4076
|
gitee地址:${i}
|
|
4077
|
-
`;console.log(e);const n=window.prompt(e,i);n&&window.open(n,"_blank")}const cn=class cn extends u.ESViewer{constructor(e){super(e);w(this,"_disabledInputStack",this.disposeVar(u.react(0)));w(this,"_viewer",this.dv(u.react(void 0)));w(this,"_viewerInstance");w(this,"_viewerLegend");w(this,"pickCustomAttachedInfo");w(this,"_fps",this.dv(u.react(0)));w(this,"_notSupportEditingCount",this.disposeVar(u.react(0)));w(this,"_editingSystem",$w);w(this,"_moveObjectsProcess",this.ad(VN()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new Rie(this)),this.ad(new Lie(this)),this.dv(new u.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Qie(this)})),this._viewerLegend=this.dv(new mue(this)),this._viewerInstance=this.dv(new u.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new AP(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=fe([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new u.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new dse(this.subContainer,this,r=>this._viewer.value=r,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&&gi(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,r,s){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(e,void 0,n,s)}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){var o;const{viewer:n}=this;if(!n)return;const r=p.Cartographic.fromDegrees(e[0],e[1],e[2],cn.getHeightsScartchCarto),s=n.scene.globe.terrainProvider;return s instanceof p.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(o=(await p.sampleTerrainMostDetailed(s,[r]))[0])==null?void 0:o.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Or(e),rotation:_A(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const r=p.Cartesian3.fromDegrees(...e),s=p.Transforms.eastNorthUpToFixedFrame(r),o=p.Matrix4.inverse(s,new p.Matrix4),a=p.Matrix4.multiplyByPoint(o,n.positionWC,new p.Cartesian3),l=p.Cartesian3.magnitude(a);let c=-Math.asin(a.z/l);c=p.Math.toDegrees(c);let A=p.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(A+=a.y<0?-p.Math.PI:p.Math.PI),A=p.Math.toDegrees(A);const f=_A(n),d=f[0]-A,g=f[1]-c;return{distance:l,heading:A,pitch:c,flyDuration:1,hDelta:d,pDelta:g}}flyIn(e,n,r,s="default"){var l;const o={position:e,rotation:n,duration:(r??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&rp(a,o,s)}flyTo(e,n,r="default"){var g;const{distance:s,heading:o,pitch:a,flyDuration:l,hDelta:c,pDelta:A}=e,f={position:n,viewDistance:s,rotation:[o,a,0],duration:l*1e3,hdelta:c,pdelta:A},d=(g=this.viewer)==null?void 0:g.camera;return d&&rp(d,f,r)}flyToBoundingSphere(e,n,r=1){var f;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],o=u.getGeoBoundingSphereFromPositions(s);if(!o)return;const{center:a,radius:l}=o,c={position:a,viewDistance:n??l,rotation:[0,-90,0],duration:r*1e3},A=(f=this.viewer)==null?void 0:f.camera;return A&&rp(A,c)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Or(e),rotation:_A(e)}}transformFlyParam(e,n){if("position"in n){const r=p.Cartesian3.fromDegrees(...e),s=p.Transforms.eastNorthUpToFixedFrame(r),o=p.Matrix4.inverse(s,new p.Matrix4),a=p.Matrix4.multiplyByPoint(o,Ue(n.position),new p.Cartesian3),l=p.Cartesian3.magnitude(a);let c=-Math.asin(a.z/l);c=p.Math.toDegrees(c);let A=p.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(A+=a.y<0?-p.Math.PI:p.Math.PI),A=p.Math.toDegrees(A);const f=n.rotation[0]-A,d=n.rotation[1]-c;return{distance:l,heading:A,pitch:c,flyDuration:n.flyDuration??1,hDelta:f,pDelta:d}}else{const r=Ue(e);let s={heading:p.Math.toRadians(n.heading),pitch:p.Math.toRadians(n.pitch),roll:0};const o=new p.HeadingPitchRoll;if(n.distance){o.heading=s.heading,o.pitch=s.pitch,o.roll=0,o.heading-=p.Math.PI_OVER_TWO;const l=p.Transforms.headingPitchRollToFixedFrame(r,o,void 0,void 0),c=p.Matrix4.multiplyByPointAsVector(l,p.Cartesian3.UNIT_X,new p.Cartesian3);p.Cartesian3.multiplyByScalar(c,n.distance,c),p.Cartesian3.subtract(r,c,r)}n.hDelta&&(s.heading+=p.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=p.Math.toRadians(n.pDelta));const a=Ee(r);return a?{position:a,rotation:[p.Math.toDegrees(s.heading),p.Math.toDegrees(s.pitch),p.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,r=1.6){var s,o;(o=(s=this._viewerInstance)==null?void 0:s.obj)==null||o.navigationManager.changeToWalk(e,n,r),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,r){var s,o;(o=(s=this._viewerInstance)==null?void 0:s.obj)==null||o.navigationManager.changeToRotateGlobe(e,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,r,s,o,a){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToLine(e,n,r,s,o,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,r,s,o){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,n,r,s,o),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,r,s,o){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,n,r,s,o),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:p.VERSION},e}async getHeightByLonLat(e,n,r){if(!this.viewer)return null;const s=p.Cartographic.fromDegrees(e,n,void 0,cn.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const r=e.map(o=>this.getHeightByLonLat(...o));return await Promise.all(r)}async capture(e,n){if(this.viewer)return await sT(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ue(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,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${r.callSource}_${u.createGuid()}`,this._editingSystem.create(this,s,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],r=u.createGuid();for(let s=0;s<e.length;s++){const o=e[s],a=o.components.main??o;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=cn.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!cn.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=cn.latestDefaultAccessToken}positionsToLocalPositions(e,n){return $n(e,n)}localPositionsToPositions(e,n){return Fl(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof p.Cartesian3?e:Ue(e),r=new p.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.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=cn.defaults;return{...e,more:[...e.more,new u.DivideProperty("通用"),new u.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",xue,Cue,!0),new u.MethodProperty("获取Cesium官方TOKEN",()=>cn.getCesiumIonToken(),[],"获取官方token"),new u.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new u.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new u.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new u.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new u.DivideProperty("Viewer"),new u.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new u.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new u.BooleanProperty([this,"shadows"]),new u.DivideProperty("比例尺"),new u.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new u.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new u.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new u.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new u.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new u.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new u.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new u.DivideProperty("场景"),new u.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new u.DivideProperty("Globe"),new u.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new u.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new u.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new u.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new u.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new u.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new u.BooleanProperty([this,"sceneGlobeShowSkirts"]),new u.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new u.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new u.JsonProperty([this,"sceneGlobeClippingPlanes"]),new u.StringProperty([this,"sceneGlobeClippingPlanesId"]),new u.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new u.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new u.DivideProperty("underground"),new u.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new u.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new u.DivideProperty("Translucency"),new u.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new u.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new u.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new u.DivideProperty("Sun"),new u.BooleanProperty([this,"sun"],"sun",n.sun,!0),new u.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new u.DivideProperty("Moon"),new u.BooleanProperty([this,"moon"],"moon",n.moon,!0),new u.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new u.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new u.DivideProperty("SkyBox"),new u.BooleanProperty([this,"sceneSkyBoxShow"]),new u.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new u.DivideProperty("Background"),new u.BooleanProperty([this,"xbsjUseBackground"]),new u.StringProperty([this,"xbsjBackgroundImageUri"]),new u.ColorProperty([this,"xbsjBackgroundColor"]),new u.DivideProperty("SkyAtmosphere"),new u.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new u.DivideProperty("Fog"),new u.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new u.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new u.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new u.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new u.DivideProperty("Sscc"),new u.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new u.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new u.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new u.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new u.DivideProperty("后处理"),new u.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new u.DivideProperty("环境遮蔽"),new u.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new u.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new u.DivideProperty("Bloom"),new u.BooleanProperty([this,"scenePpsBloomEnabled"]),new u.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new u.NumberProperty([this,"scenePpsBloomContrast"]),new u.NumberProperty([this,"scenePpsBloomBrightness"]),new u.NumberProperty([this,"scenePpsBloomDelta"]),new u.NumberProperty([this,"scenePpsBloomSigma"]),new u.NumberProperty([this,"scenePpsBloomStepSize"]),new u.DivideProperty("调试"),new u.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new u.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new u.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new u.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new u.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new u.DivideProperty("Inspector"),new u.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new u.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new u.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};w(cn,"type",cn.register("ESCesiumViewer",cn)),w(cn,"getCesiumIonToken",_ue),w(cn,"currentDefaultAccessToken",p.Ion.defaultAccessToken),w(cn,"latestDefaultAccessToken"),w(cn,"ObjectsToExcludeWrapper",Oie),w(cn,"defaults",{...u.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:p.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:p.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}),w(cn,"getHeightsScartchCarto",new p.Cartographic);let Ct=cn;(i=>{i.createDefaultProps=()=>({...u.ESViewer.createDefaultProps(),...wue()})})(Ct||(Ct={})),u.extendClassProps(Ct.prototype,Ct.createDefaultProps),O.copyright=void 0;try{const i="earthsdk3-cesium",t="3.10.0",e="2026-05-22T08:04:00.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="6819366b74fba501f9110e7ccac6e0b85b00e439",a=((Date.now()-177943704e4)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
|
|
4077
|
+
`;console.log(e);const n=window.prompt(e,i);n&&window.open(n,"_blank")}const cn=class cn extends u.ESViewer{constructor(e){super(e);w(this,"_disabledInputStack",this.disposeVar(u.react(0)));w(this,"_viewer",this.dv(u.react(void 0)));w(this,"_viewerInstance");w(this,"_viewerLegend");w(this,"pickCustomAttachedInfo");w(this,"_fps",this.dv(u.react(0)));w(this,"_notSupportEditingCount",this.disposeVar(u.react(0)));w(this,"_editingSystem",$w);w(this,"_moveObjectsProcess",this.ad(VN()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new Rie(this)),this.ad(new Lie(this)),this.dv(new u.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Qie(this)})),this._viewerLegend=this.dv(new mue(this)),this._viewerInstance=this.dv(new u.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new AP(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=fe([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new u.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new dse(this.subContainer,this,r=>this._viewer.value=r,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&&gi(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,r,s){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(e,void 0,n,s)}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){var o;const{viewer:n}=this;if(!n)return;const r=p.Cartographic.fromDegrees(e[0],e[1],e[2],cn.getHeightsScartchCarto),s=n.scene.globe.terrainProvider;return s instanceof p.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(o=(await p.sampleTerrainMostDetailed(s,[r]))[0])==null?void 0:o.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Or(e),rotation:_A(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const r=p.Cartesian3.fromDegrees(...e),s=p.Transforms.eastNorthUpToFixedFrame(r),o=p.Matrix4.inverse(s,new p.Matrix4),a=p.Matrix4.multiplyByPoint(o,n.positionWC,new p.Cartesian3),l=p.Cartesian3.magnitude(a);let c=-Math.asin(a.z/l);c=p.Math.toDegrees(c);let A=p.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(A+=a.y<0?-p.Math.PI:p.Math.PI),A=p.Math.toDegrees(A);const f=_A(n),d=f[0]-A,g=f[1]-c;return{distance:l,heading:A,pitch:c,flyDuration:1,hDelta:d,pDelta:g}}flyIn(e,n,r,s="default"){var l;const o={position:e,rotation:n,duration:(r??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&rp(a,o,s)}flyTo(e,n,r="default"){var g;const{distance:s,heading:o,pitch:a,flyDuration:l,hDelta:c,pDelta:A}=e,f={position:n,viewDistance:s,rotation:[o,a,0],duration:l*1e3,hdelta:c,pdelta:A},d=(g=this.viewer)==null?void 0:g.camera;return d&&rp(d,f,r)}flyToBoundingSphere(e,n,r=1){var f;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],o=u.getGeoBoundingSphereFromPositions(s);if(!o)return;const{center:a,radius:l}=o,c={position:a,viewDistance:n??l,rotation:[0,-90,0],duration:r*1e3},A=(f=this.viewer)==null?void 0:f.camera;return A&&rp(A,c)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Or(e),rotation:_A(e)}}transformFlyParam(e,n){if("position"in n){const r=p.Cartesian3.fromDegrees(...e),s=p.Transforms.eastNorthUpToFixedFrame(r),o=p.Matrix4.inverse(s,new p.Matrix4),a=p.Matrix4.multiplyByPoint(o,Ue(n.position),new p.Cartesian3),l=p.Cartesian3.magnitude(a);let c=-Math.asin(a.z/l);c=p.Math.toDegrees(c);let A=p.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(A+=a.y<0?-p.Math.PI:p.Math.PI),A=p.Math.toDegrees(A);const f=n.rotation[0]-A,d=n.rotation[1]-c;return{distance:l,heading:A,pitch:c,flyDuration:n.flyDuration??1,hDelta:f,pDelta:d}}else{const r=Ue(e);let s={heading:p.Math.toRadians(n.heading),pitch:p.Math.toRadians(n.pitch),roll:0};const o=new p.HeadingPitchRoll;if(n.distance){o.heading=s.heading,o.pitch=s.pitch,o.roll=0,o.heading-=p.Math.PI_OVER_TWO;const l=p.Transforms.headingPitchRollToFixedFrame(r,o,void 0,void 0),c=p.Matrix4.multiplyByPointAsVector(l,p.Cartesian3.UNIT_X,new p.Cartesian3);p.Cartesian3.multiplyByScalar(c,n.distance,c),p.Cartesian3.subtract(r,c,r)}n.hDelta&&(s.heading+=p.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=p.Math.toRadians(n.pDelta));const a=Ee(r);return a?{position:a,rotation:[p.Math.toDegrees(s.heading),p.Math.toDegrees(s.pitch),p.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,r=1.6){var s,o;(o=(s=this._viewerInstance)==null?void 0:s.obj)==null||o.navigationManager.changeToWalk(e,n,r),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,r){var s,o;(o=(s=this._viewerInstance)==null?void 0:s.obj)==null||o.navigationManager.changeToRotateGlobe(e,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,r,s,o,a){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToLine(e,n,r,s,o,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,r,s,o){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,n,r,s,o),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,r,s,o){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,n,r,s,o),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:p.VERSION},e}async getHeightByLonLat(e,n,r){if(!this.viewer)return null;const s=p.Cartographic.fromDegrees(e,n,void 0,cn.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const r=e.map(o=>this.getHeightByLonLat(...o));return await Promise.all(r)}async capture(e,n){if(this.viewer)return await sT(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ue(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,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${r.callSource}_${u.createGuid()}`,this._editingSystem.create(this,s,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],r=u.createGuid();for(let s=0;s<e.length;s++){const o=e[s],a=o.components.main??o;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=cn.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!cn.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=cn.latestDefaultAccessToken}positionsToLocalPositions(e,n){return $n(e,n)}localPositionsToPositions(e,n){return Fl(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof p.Cartesian3?e:Ue(e),r=new p.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.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=cn.defaults;return{...e,more:[...e.more,new u.DivideProperty("通用"),new u.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",xue,Cue,!0),new u.MethodProperty("获取Cesium官方TOKEN",()=>cn.getCesiumIonToken(),[],"获取官方token"),new u.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new u.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new u.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new u.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new u.DivideProperty("Viewer"),new u.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new u.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new u.BooleanProperty([this,"shadows"]),new u.DivideProperty("比例尺"),new u.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new u.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new u.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new u.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new u.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new u.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new u.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new u.DivideProperty("场景"),new u.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new u.DivideProperty("Globe"),new u.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new u.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new u.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new u.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new u.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new u.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new u.BooleanProperty([this,"sceneGlobeShowSkirts"]),new u.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new u.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new u.JsonProperty([this,"sceneGlobeClippingPlanes"]),new u.StringProperty([this,"sceneGlobeClippingPlanesId"]),new u.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new u.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new u.DivideProperty("underground"),new u.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new u.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new u.DivideProperty("Translucency"),new u.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new u.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new u.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new u.DivideProperty("Sun"),new u.BooleanProperty([this,"sun"],"sun",n.sun,!0),new u.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new u.DivideProperty("Moon"),new u.BooleanProperty([this,"moon"],"moon",n.moon,!0),new u.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new u.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new u.DivideProperty("SkyBox"),new u.BooleanProperty([this,"sceneSkyBoxShow"]),new u.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new u.DivideProperty("Background"),new u.BooleanProperty([this,"xbsjUseBackground"]),new u.StringProperty([this,"xbsjBackgroundImageUri"]),new u.ColorProperty([this,"xbsjBackgroundColor"]),new u.DivideProperty("SkyAtmosphere"),new u.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new u.DivideProperty("Fog"),new u.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new u.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new u.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new u.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new u.DivideProperty("Sscc"),new u.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new u.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new u.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new u.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new u.DivideProperty("后处理"),new u.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new u.DivideProperty("环境遮蔽"),new u.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new u.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new u.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new u.DivideProperty("Bloom"),new u.BooleanProperty([this,"scenePpsBloomEnabled"]),new u.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new u.NumberProperty([this,"scenePpsBloomContrast"]),new u.NumberProperty([this,"scenePpsBloomBrightness"]),new u.NumberProperty([this,"scenePpsBloomDelta"]),new u.NumberProperty([this,"scenePpsBloomSigma"]),new u.NumberProperty([this,"scenePpsBloomStepSize"]),new u.DivideProperty("调试"),new u.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new u.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new u.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new u.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new u.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new u.DivideProperty("Inspector"),new u.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new u.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new u.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};w(cn,"type",cn.register("ESCesiumViewer",cn)),w(cn,"getCesiumIonToken",_ue),w(cn,"currentDefaultAccessToken",p.Ion.defaultAccessToken),w(cn,"latestDefaultAccessToken"),w(cn,"ObjectsToExcludeWrapper",Oie),w(cn,"defaults",{...u.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:p.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:p.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:p.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}),w(cn,"getHeightsScartchCarto",new p.Cartographic);let Ct=cn;(i=>{i.createDefaultProps=()=>({...u.ESViewer.createDefaultProps(),...wue()})})(Ct||(Ct={})),u.extendClassProps(Ct.prototype,Ct.createDefaultProps),O.copyright=void 0;try{const i="earthsdk3-cesium",t="3.10.1",e="2026-05-28T01:04:39.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="4c6c768074961ea20aab5957ae109d64d3f9e2e0",a=((Date.now()-1779930279e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
|
|
4078
4078
|
%c${r?r+`
|
|
4079
4079
|
`:""}当前网站正在使用${i},此软件版权归${n}所有
|
|
4080
|
-
`;O.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4080
|
+
`;O.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","4c6c768074961ea20aab5957ae109d64d3f9e2e0")},get info(){return l},get date(){return"2026-05-28T01:04:39.000Z"},get author(){return"suplyang"},get version(){return"3.10.1"},get name(){return"earthsdk3-cesium"},get commitId(){return"4c6c768074961ea20aab5957ae109d64d3f9e2e0"},print(){console.info(this.info,`
|
|
4081
4081
|
font-size: 18px;
|
|
4082
4082
|
font-weight: 1000;
|
|
4083
4083
|
line-height: 1;
|
package/dist/earthsdk3-cesium.js
CHANGED
|
@@ -50158,8 +50158,9 @@ const Y6 = {
|
|
|
50158
50158
|
l();
|
|
50159
50159
|
})), l();
|
|
50160
50160
|
const u = () => {
|
|
50161
|
+
var g, m;
|
|
50161
50162
|
const p = t.animation ?? _C.defaults.animation, f = Y6[p];
|
|
50162
|
-
if (!t.show || r.ready
|
|
50163
|
+
if (!t.show || !r.ready || !((g = r.gltf) != null && g.animations) || f[0].index && f[0].index >= ((m = r.gltf) == null ? void 0 : m.animations.length)) {
|
|
50163
50164
|
r.activeAnimationsJson = void 0;
|
|
50164
50165
|
return;
|
|
50165
50166
|
}
|
|
@@ -73151,7 +73152,7 @@ let Te = Ni;
|
|
|
73151
73152
|
ut(Te.prototype, Te.createDefaultProps);
|
|
73152
73153
|
let Py;
|
|
73153
73154
|
try {
|
|
73154
|
-
const i = "earthsdk3-cesium", e = "3.10.
|
|
73155
|
+
const i = "earthsdk3-cesium", e = "3.10.1", t = "2026-05-28T01:04:39.000Z", n = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", r = "4c6c768074961ea20aab5957ae109d64d3f9e2e0", a = ((Date.now() - 1779930279e3) / 36e5).toFixed(1), l = `%c🌏 ${i}%c ${e}.${r.slice(0, 8)}.${t} (距今${a}个小时)
|
|
73155
73156
|
%c${s ? s + `
|
|
73156
73157
|
` : ""}当前网站正在使用${i},此软件版权归${n}所有
|
|
73157
73158
|
`;
|
|
@@ -73165,7 +73166,7 @@ try {
|
|
|
73165
73166
|
},
|
|
73166
73167
|
// @ts-ignore
|
|
73167
73168
|
get gituri() {
|
|
73168
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
73169
|
+
return GITURI_ && GITURI_.replace("${commitId}", "4c6c768074961ea20aab5957ae109d64d3f9e2e0");
|
|
73169
73170
|
},
|
|
73170
73171
|
// @ts-ignore
|
|
73171
73172
|
get info() {
|
|
@@ -73173,7 +73174,7 @@ try {
|
|
|
73173
73174
|
},
|
|
73174
73175
|
// @ts-ignore
|
|
73175
73176
|
get date() {
|
|
73176
|
-
return "2026-05-
|
|
73177
|
+
return "2026-05-28T01:04:39.000Z";
|
|
73177
73178
|
},
|
|
73178
73179
|
// @ts-ignore
|
|
73179
73180
|
get author() {
|
|
@@ -73181,7 +73182,7 @@ try {
|
|
|
73181
73182
|
},
|
|
73182
73183
|
// @ts-ignore
|
|
73183
73184
|
get version() {
|
|
73184
|
-
return "3.10.
|
|
73185
|
+
return "3.10.1";
|
|
73185
73186
|
},
|
|
73186
73187
|
// @ts-ignore
|
|
73187
73188
|
get name() {
|
|
@@ -73189,7 +73190,7 @@ try {
|
|
|
73189
73190
|
},
|
|
73190
73191
|
// @ts-ignore
|
|
73191
73192
|
get commitId() {
|
|
73192
|
-
return "
|
|
73193
|
+
return "4c6c768074961ea20aab5957ae109d64d3f9e2e0";
|
|
73193
73194
|
},
|
|
73194
73195
|
print() {
|
|
73195
73196
|
console.info(
|
|
@@ -1411,7 +1411,7 @@ ${sA}
|
|
|
1411
1411
|
|
|
1412
1412
|
out_FragColor = finalColor;
|
|
1413
1413
|
}
|
|
1414
|
-
`,this._clampedIntensity=Math.max(1,t.fireHeight),this._totalDistance=p,this._startTime=performance.now(),this._preRenderListener&&this._preRenderListener(),this._preRenderListener=(M=this.czmViewer.viewer)==null?void 0:M.scene.preRender.addEventListener(()=>{const L=(performance.now()-this._startTime)*.001;r.setUniformMap({u_time:L,u_totalDistance:this._totalDistance,u_height:t.fireHeight})})}flyTo(t,n){const{sceneObject:r,czmViewer:o,geoPolygon:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):r.points&&r.points.length>=3?(gt(o,r,n,r.points,t),!0):!1:!1}};y(jp,"type",jp.register("ESCesiumViewer",l.ESGeoPolygonWithFire.type,jp));let N_=jp;const td=class td extends Ni{constructor(t,n){super(t,n);y(this,"_czmGeoESRectangle");y(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new se(n,t.id)),this._czmGeoESRectangle=this.disposeVar(new uo(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(l.track([s,"color"],[t,"strokeColor"])),this.dispose(l.track([s,"width"],[t,"strokeWidth"])),this.dispose(l.track([s,"ground"],[t,"strokeGround"])),this.dispose(l.track([o,"ground"],[t,"fillGround"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"]));{const a=()=>{s.show=t.show&&t.stroked,o.show=t.show&&t.filled};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.strokedChanged,t.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{t.filled?o.material={type:"Color",color:t.fillColor}:o.material=void 0};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(t.fillStyleChanged,t.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{const c=t.points;if(c&&c.length>=2){const{minPos:h,maxPos:p}=l.getMinMaxCorner(c);o.rectangle=[h[0],h[1],p[0],p[1]],o.height=c[0][2],o.extrudedHeight=c[0][2];const f=c.map(_=>(c&&(_[2]=c[0][2]),_)),g=f[0],m=f[1],v=[g,[g[0],m[1],g[2]],m,[m[0],g[1],m[2]]];s.positions=[...v,g]}else o.rectangle=void 0,s.positions=void 0,o.height=0,o.extrudedHeight=0};a(),this.dispose(t.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(t,n){const{sceneObject:r,czmViewer:o}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):r.points?(gt(o,r,n,r.points,t),!0):!1:!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,czmGeoESRectangle:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):r.points?(gt(o,r,n,r.points,t),!0):!1:!1}};y(td,"type",td.register("ESCesiumViewer",l.ESGeoRectangle.type,td));let O_=td;class up extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Vs(t,n));const{geoPolygon:r}=this;this.dispose(l.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{r.flyTo(s)})),this.dispose(l.bind([r,"show"],[this,"show"])),this.dispose(l.bind([r,"fill"],[this,"filled"])),this.dispose(l.bind([r,"strokeGround"],[this,"strokeGround"])),this.dispose(l.bind([r,"ground"],[this,"ground"])),this.dispose(l.bind([r,"outline"],[this,"outline"])),this.dispose(l.bind([r,"outlineColor"],[this,"outlineColor"])),this.dispose(l.bind([r,"outlineWidth"],[this,"outlineWidth"])),this.dispose(l.bind([r,"color"],[this,"color"])),this.dispose(l.bind([r,"depth"],[this,"depth"]));const o=()=>{if(this.positions&&this.positions.length>=2){const s=zv([...this.positions,this.positions[0]]);r.positions=s}else r.positions=void 0};o(),this.dispose(this.positionsChanged.disposableOn(o))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get geoPolygon(){return this._geoPolygon}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:1,color:l.reactArrayWithUndefined([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0})})(up||(up={})),l.extendClassProps(up.prototype,up.createDefaultProps);const ed=class ed extends Ni{constructor(t,n){super(t,n);y(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new up(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._geoSmoothPolygon;this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.bind([o,"positions"],[t,"points"])),this.dispose(l.track([o,"strokeGround"],[t,"strokeGround"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),this.dispose(l.track([o,"outline"],[t,"stroked"])),this.dispose(l.track([o,"outlineColor"],[t,"strokeColor"])),this.dispose(l.track([o,"outlineWidth"],[t,"strokeWidth"])),this.dispose(l.track([o,"strokeGround"],[t,"strokeGround"])),this.dispose(l.track([o,"filled"],[t,"filled"])),this.dispose(l.track([o,"color"],[t,"fillColor"])),this.dispose(l.track([o,"ground"],[t,"ground"]));{const s=()=>{o.ground=t.ground||t.fillGround};s();const a=this.dv(l.createNextAnimateFrameEvent(t.groundChanged,t.fillGroundChanged));this.d(a.don(s))}{const s=()=>{o.color=t.filled?t.fillColor:cp.defaults.fillStyle.color};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.fillStyleChanged,t.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([o,"depth"],[t,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(t,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}};y(ed,"type",ed.register("ESCesiumViewer",cp.type,ed));let B_=ed;const id=class id extends Mt{constructor(t,n){super(t,n);y(this,"_czmModel");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Mi(n,t.id));const o=this._czmModel;this.d(o.readyEvent.don(a=>{var c;o.activeAnimationsJson=(c=o.gltf.animations)==null?void 0:c.map((h,p)=>({index:p,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"})),t.czmModelReadyEvent.emit(a),t.readyEvent.emit(a)})),this.ad(new zf(r,this._czmModel)),this.d(l.track([o,"show"],[t,"show"])),this.d(l.track([o,"color"],[t,"czmColor"])),this.d(l.track([o,"nativeMaximumScale"],[t,"czmMaximumScale"])),this.d(l.track([o,"nativeMinimumPixelSize"],[t,"czmMinimumPixelSize"])),this.ad(l.createEventsCallFunc([t.positionChanged,t.positionOffsetChanged],()=>{o.position=l.geoDestination(t.position,t.positionOffset)},{immediate:!0})),this.d(l.track([o,"nativeScale"],[t,"czmNativeScale"])),this.d(l.track([o,"scale"],[t,"scale"])),this.ad(l.track([o,"imageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(l.track([o,"environmentMapManager"],[t,"czmEnvironmentMapManager"]));{const a=c=>{t.czmEnvironmentMapManager=t.czmEnvironmentMapManager?{...t.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};a(t.czmAtmosphereScatteringIntensity),this.ad(t.czmAtmosphereScatteringIntensityChanged.don(c=>a(c)))}{const a=()=>{var c,h;(c=t.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(t.czmAtmosphereScatteringIntensity=(h=t.czmEnvironmentMapManager)==null?void 0:h.atmosphereScatteringIntensity)};a(),this.ad(t.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const c=[...t.rotation??[0,0,0]];c[0]+=t.instances&&t.instances.length!=0?0:90,o.rotation=c};a(),this.d(t.rotationChanged.don(a));{const c=()=>{if(a(),!t.instances||t.instances.length==0){o.instances=void 0;return}o.instances=t.instances.map(h=>{const p=JSON.parse(JSON.stringify(h));return!p.rotation&&(p.rotation=[0,0,0]),p.rotation[0]+=90,p})};c(),this.ad(t.instancesChanged.don(c))}}this.ad(t.setMaterialEvent.don(a=>{o.setMaterial(a)}));{const a=()=>{const c=[...o.rotation];c[0]-=t.instances&&t.instances.length!=0?0:90,t.rotation=c};a(),this.d(o.rotationChanged.don(a))}{const a=this.dv(l.createNextAnimateFrameEvent(t.allowPickingChanged,t.editingChanged)),c=()=>{t.allowPicking&&!t.editing?o.allowPicking=!0:o.allowPicking=!1};c(),this.d(a.don(c))}const s=()=>{var a;o.url=l.ESSceneObject.context.getStrFromEnv(Gf(typeof t.url=="string"?t.url:((a=t.url)==null?void 0:a.url)??l.ESGltfModel.defaults.url))};s(),this.d(t.urlChanged.don(s)),this.d(t.setNodePositionEvent.don((a,c)=>{o.setNodeTranslation(a,c)})),this.d(t.setNodeRotationEvent.don((a,c)=>{o.setNodeRotation(a,c)})),this.d(t.setNodeScaleEvent.don((a,c)=>{o.setNodeScale(a,c)})),this.d(t.printDebugInfoEvent.don(()=>{o.printDebugInfo()}))}get model(){return this._czmModel}flyTo(t,n){const{sceneObject:r,czmViewer:o,model:s}=this;return o.actived?r.flyToParam||r.flyInParam?(super.flyTo(t,n),!0):(s&&ai(o,r,n,t,s,!0),!!s):!1}};y(id,"type",id.register("ESCesiumViewer",l.ESGltfModel.type,id));let z_=id;function lA(i,e){const t=i[0]-e[0],n=i[1]-e[1],r=i[2]-e[2];return Math.sqrt(t*t+n*n+r*r)}class hp extends l.Destroyable{constructor(t,n){super();y(this,"_pickedEvent",this.disposeVar(new l.Event));y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_distance",this.disposeVar(l.react(0)));y(this,"_surfaceDistance",this.disposeVar(l.react(0)));y(this,"_height",this.disposeVar(l.react(0)));y(this,"_middlePosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));y(this,"_heightPosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));const r=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=l.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=l.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=l.lbhToXyz(this.positions[0]),a=l.lbhToXyz(this.positions[1]);this._distance.value=lA(s,a),this._surfaceDistance.value=lA(l.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};r();const o=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(o.disposableOn(r));{const s=this.disposeVar(new se(t,n));s.ground=!1,s.loop=!1,this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([s,"arcType"],[this,"arcType"])),this.dispose(l.bind([s,"color"],[this,"color"])),this.dispose(l.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(l.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(l.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(l.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(l.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(l.bind([s,"show"],[this,"show"])),this.dispose(l.bind([s,"width"],[this,"width"])),this.dispose(l.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[h,p]=this.positions;s.positions=[h,p,[h[0],h[1],p[2]]]}else s.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{t.actived&&s.flyTo(c)}));const a=this.disposeVar(new Ue(t,n));this.dispose(l.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(l.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(l.track([a,"show"],[this,"show"]));{const c=()=>{a.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{a.innerHTML=qa(`高度: ${Wf(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(a.pickedEvent.don(c=>{Xo(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:l.reactPositions(void 0),width:1,color:l.reactArray([1,1,1,1]),hasDash:!1,gapColor:l.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(hp||(hp={})),l.extendClassProps(hp.prototype,hp.createDefaultProps);const nd=class nd extends Ni{constructor(t,n){super(t,n);y(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new hp(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:o}=this;this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),this.dispose(l.bind([o,"positions"],[t,"points"]));{const s=()=>{if(t.stroked)o.width=t.strokeWidth;else{o.width=0;return}o.width=t.strokeWidth,o.color=t.strokeColor;const h=t.strokeMaterial??"normal";h==="hasDash"?(o.hasDash=!0,o.hasArrow=!1):h==="hasArrow"?(o.hasDash=!1,o.hasArrow=!0):(o.hasDash=!1,o.hasArrow=!1);const p=t.strokeStyle;if(p.material==="hasDash"&&p.materialParams)try{const f=p.materialParams;Reflect.has(f,"gapColor")&&(o.gapColor=f.gapColor??[0,0,0,0]),Reflect.has(f,"dashLength")&&(o.dashLength=f.dashLength),Reflect.has(f,"dashPattern")&&(o.dashPattern=f.dashPattern)}catch(f){console.error(f)}else o.gapColor=[0,0,0,0],o.dashLength=0,o.dashPattern=0};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.strokeStyleChanged,t.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(o.pickedEvent.disposableOn(s=>{Xo(s)===0&&(t.allowPicking??!1)&&t.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(t,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}};y(nd,"type",nd.register("ESCesiumViewer",l.ESHeightMeasurement.type,nd));let V_=nd;const cV={standing:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],walking:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],running:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},rd=class rd extends Mt{constructor(t,n){super(t,n);y(this,"_czmModelPrimitive");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Mi(n,this.sceneObject.id));const o=this._czmModelPrimitive;this.dispose(l.track([o,"show"],[t,"show"])),this.ad(l.createEventsCallFunc([t.positionChanged,t.positionOffsetChanged],()=>{o.position=l.geoDestination(t.position,t.positionOffset)},{immediate:!0}));{const f=()=>{const g=[...t.rotation??[0,0,0]];g[0]+=t.instances&&t.instances.length!=0?0:90,o.rotation=g};f(),this.d(t.rotationChanged.don(f));{const g=()=>{if(f(),!t.instances||t.instances.length==0){o.instances=void 0;return}o.instances=t.instances.map(m=>{const v=JSON.parse(JSON.stringify(m));return!v.rotation&&(v.rotation=[0,0,0]),v.rotation[0]+=90,v})};g(),this.ad(t.instancesChanged.don(g))}}{const f=()=>{const g=[...o.rotation];g[0]-=t.instances&&t.instances.length!=0?0:90,t.rotation=g};f(),this.d(o.rotationChanged.don(f))}this.dispose(l.bind([o,"scale"],[t,"scale"])),this.d(o.readyEvent.don(f=>{t.readyEvent.emit(f)}));{const f=this.dv(l.createNextAnimateFrameEvent(t.allowPickingChanged,t.editingChanged)),g=()=>{t.allowPicking&&!t.editing?o.allowPicking=!0:o.allowPicking=!1};g(),this.d(f.don(g))}const s={worker:"worker.glb",police:"police.glb",pedestrian:"pedestrian.glb",stranger:"Stranger.glb",suitMan:"SuitsMan.glb",suitWoman:"SuitsWoman.glb",repairMan:"repairman.glb",fireMan:"fireMan.glb",firefighterWithWaterPump:"firefighterWithWaterPump.glb",firefighterWithFirestick:"firefighterWithFirestick.glb",firefighterWithDripIgniter:"firefighterWithDripIgniter.glb",firefighterWithBlower:"firefighterWithBlower.glb",firefighterWithHose:"firefighterWithHose.glb",firefighterWithThrowable:"firefighterWithThrowable.glb",firefighterWithToolkit:"firefighterWithToolkit.glb",firefighterWalking:"firefighterWalking.glb",firefighterUniform:"firefighterUniform.glb"},a=f=>l.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/"+f),c=()=>{o.activeAnimationsJson=void 0,o.url=a(s[t.mode]??s.worker)};this.dispose(t.modeChanged.disposableOn(()=>{c()})),c();const h=()=>{const f=t.animation??l.ESHuman.defaults.animation,g=cV[f];if(!t.show||o.ready&&!o.gltf.animations||g[0].index&&g[0].index>=o.gltf.animations.length){o.activeAnimationsJson=void 0;return}o.activeAnimationsJson=g};h();const p=this.ad(l.createNextAnimateFrameEvent(o.readyEvent,t.showChanged,t.animationChanged));this.dispose(p.disposableOn(()=>h())),this.ad(new zf(r,o))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(t,n){const{sceneObject:r,czmViewer:o,czmModelPrimitive:s}=this;return!o.actived||!o.viewer?!1:r.flyToParam||r.flyInParam?(super.flyTo(t,n),!0):(s&&ai(o,r,n,t,s,!0),!!s)}};y(rd,"type",rd.register("ESCesiumViewer",l.ESHuman.type,rd));let U_=rd;class cA extends l.Destroyable{constructor(t,n){super();y(this,"_czmGeoCanvasImagePoi");y(this,"flyTo",(t,n)=>{if(this.czmGeoCanvasImagePoi.position){mt(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Hn,t);return}this.czmGeoCanvasImagePoi.flyTo(t&&t*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new lo(n,t.id));const r=this._czmGeoCanvasImagePoi;r.pickOnClick=!0,this.d(r.pickedEvent.don(o=>{(t.allowPicking??!1)&&t.pickedEvent.emit(o)}));{const o=p=>{let f=p;return p.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+p.split("inner://")[1]),l.ESSceneObject.context.getStrFromEnv(Gf(f))},s=()=>{const p=o(typeof t.url=="string"?t.url:t.url.url);if(r.imageUri=p,t.sizeByContent){const g=new Image;g.src=p,g.onload=()=>{r.size=[g.width,g.height]}}else{const g=t.size;r.size=[...g]}},a=this.disposeVar(l.createNextAnimateFrameEvent(t.urlChanged,t.sizeByContentChanged,t.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(l.track([r,"zOrder"],[t,"zOrder"])),this.dispose(l.track([r,"show"],[t,"show"])),this.dispose(l.bind([r,"position"],[t,"position"])),this.ad(l.bind([r,"isHoverZoom"],[t,"isHoverZoom"])),this.ad(l.bind([r,"hoverHighlight"],[t,"hoverHighlight"]));{const p=()=>{r.scale=[t.scale[1],t.scale[2]]};p(),this.dispose(t.scaleChanged.don(p))}const c=()=>{const p=t.anchor,f=t.offset;p?r.originRatioAndOffset=[...p,-f[0],-f[1]]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(l.createNextAnimateFrameEvent(t.anchorChanged,t.offsetChanged));this.dispose(h.disposableOn(()=>c())),c(),this.dispose(r.clickEvent.disposableOn(p=>{const{offsetX:f,offsetY:g}=p,v={type:p.button===0?"leftClick":p.button===2?"rightClick":void 0,add:{mousePos:[f,g]}};t.widgetEvent.emit(v)})),this.dispose(r.hoveredChanged.disposableOn(p=>{if(p===void 0)return;const f={type:p?"mouseEnter":"mouseLeave"};t.widgetEvent.emit(f)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class uA extends l.Destroyable{constructor(t,n,r){super();y(this,"_czmGeoImageModel");y(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});y(this,"_isPointEvent",!1);y(this,"flyTo",(t,n)=>{if(this.czmGeoImageModel.position)return qn(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),t,!0);this.czmGeoImageModel.flyTo(t&&t*1e3)});this.sceneObject=t,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Zo(n,t.id));const o=this._czmGeoImageModel;this.ad(n.clickEvent.don(g=>{const m=g==null?void 0:g.pointerEvent;m&&(this._isPointEvent=!0,this._eventInfo={type:m.button==0?"leftClick":m.button==2?"rightClick":"leftClick",add:{mousePos:[m.offsetX,m.offsetY]}})})),this.d(t.pickedEvent.don(g=>{var m,v,_;g.screenPosition&&this._isPointEvent&&((m=this._eventInfo.add)!=null&&m.mousePos)&&Math.abs(g.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(g.screenPosition[1]-((_=this._eventInfo.add)==null?void 0:_.mousePos[1]))<1&&(t.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),l.engineObjectCreatedUpdate(this,t,()=>{const g=n.getEngineObject(t);this.ad(g.lastHoverResultChanged.don((m,v)=>{(m==null?void 0:m.sceneObject)==(v==null?void 0:v.sceneObject)||(m==null?void 0:m.sceneObject)!=t&&(v==null?void 0:v.sceneObject)!=t||(m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:m==null?void 0:m.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),t.isHoverZoom&&m.sceneObject.id==t.id&&(o.scale=[o.scale[0]*1.5,o.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:m==null?void 0:m.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),t.isHoverZoom&&v.sceneObject.id==t.id&&(o.scale=[o.scale[0]/1.5,o.scale[1]/1.5])))}))});const s=t.sizeByContent,c=(g=>{let m=g;return g.includes("inner://")&&(m="${earthsdk3-assets-script-dir}/assets/img/points/"+g.split("inner://")[1]),l.ESSceneObject.context.getStrFromEnv(Gf(m))})(typeof r.sceneObject.url=="string"?r.sceneObject.url:r.sceneObject.url.url),h=new Image;h.src=c,h.onload=()=>{if(s)o.size=[h.width/100,h.height/100];else{const g=t.size;o.size=[g[0]/100,g[1]/100]}},o.uri=c,this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.bind([o,"position"],[t,"position"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),o.pixelSize=void 0,o.useAxis="XZ";{const g=()=>{o.scale=[t.scale[1],t.scale[2]]};g(),this.d(t.scaleChanged.don(g))}{const g=()=>{t.rotationType===0&&(o.rotationMode="WithProp",this.d(Ke([o,"rotation"],[t,"rotation"]))),t.rotationType===1&&(o.rotationMode="WithCamera"),t.rotationType===2&&(o.rotationMode="WithCameraOnlyZ")};g(),this.dispose(t.rotationTypeChanged.disposableOn(g))}const p=()=>{const g=t.anchor,m=t.offset;g?o.originRatioAndOffset=[...g,-m[0]/100,-m[1]/100]:o.originRatioAndOffset=[0,0,0,0]},f=this.ad(l.createNextAnimateFrameEvent(t.anchorChanged,t.offsetChanged));this.dispose(f.disposableOn(()=>p())),p()}get czmGeoImageModel(){return this._czmGeoImageModel}}const od=class od extends il{constructor(t,n){super(t,n);y(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(l.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new l.ObjResettingWithEvent(o,()=>this.sceneObject.screenRender?new cA(this.sceneObject,this.czmViewer):new uA(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(t,n){const{sceneObject:r,czmViewer:o,resetting:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):(s&&s.obj&&s.obj.flyTo(t,n),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(od,"type",od.register("ESCesiumViewer",l.ESImageLabel.type,od));let G_=od;const sd=class sd extends sr{constructor(t,n){super(t,n);y(this,"_czmImagery");y(this,"_innerUrl",this.ad(l.react("")));if(this._czmImagery=this.dv(new Qs(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmImagery;this.d(l.track([o,"show"],[t,"show"])),this.d(l.bind([o,"alpha"],[t,"opacity"])),this.d(l.bind([o,"alpha"],[t,"czmAlpha"])),this.d(l.track([o,"splitDirection"],[t,"splitDirection"])),this.d(l.track([o,"brightness"],[t,"czmBrightness"])),this.d(l.track([o,"contrast"],[t,"czmContrast"])),this.d(l.track([o,"hue"],[t,"czmHue"])),this.d(l.track([o,"saturation"],[t,"czmSaturation"])),this.d(l.track([o,"gamma"],[t,"czmGamma"])),this.d(l.track([o,"rectangle"],[t,"rectangle"])),this.d(l.track([o,"zIndex"],[t,"zIndex"])),this.ad(l.track([o,"targetID"],[t,"targetID"])),this.ad(l.createEventsCallFunc(t.urlChanged,()=>{this.updateUrl()},{immediate:!0})),this.ad(l.createEventsCallFunc([this.innerUrlChanged,t.maximumLevelChanged,t.minimumLevelChanged,t.optionsChanged,t.rectangleChanged],()=>{this.updateImageryProvider()},{immediate:!0}))}get czmImagery(){return this._czmImagery}get innerUrl(){return this._innerUrl.value}set innerUrl(t){this._innerUrl.value=t}get innerUrlChanged(){return this._innerUrl.changed}getOptionsType(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}updateUrl(){const{sceneObject:t}=this;if(typeof t.url=="string")this.innerUrl=l.ESSceneObject.context.getStrFromEnv(t.url);else{const n=t.url;n.url=l.ESSceneObject.context.getStrFromEnv(n.url),this.innerUrl=n}}updateImageryProvider(){var h;const{sceneObject:t,czmImagery:n}=this;if(!this.innerUrl)return;const r=(((h=t.options)==null?void 0:h.type)??"auto").toLowerCase(),o=t.options??{};let s={type:"",url:this.innerUrl,rectangle:t.rectangle,maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,...o},a=this.innerUrl,c=typeof a=="string"?a:a.url;if(r==="auto"){const p=c.toLowerCase();if(p.startsWith("ion://")){const g=+p.substring(6);s={...o,assetId:g,type:"IonImageryProvider"}}else if(p.includes("{x}")||p.includes("{y}")||p.includes("{z}"))s.type="UrlTemplateImageryProvider";else if(p.includes("wmts"))s.type="WebMapTileServiceImageryProvider";else if(p.includes("wms"))s.type="WebMapServiceImageryProvider";else if(c.includes("/tilemapresource.xml")){const f=c.split("/tilemapresource.xml").join("");typeof a=="string"?a=f:a.url=f,s.url=a,s.type="TileMapServiceImageryProvider"}}else{if(r==="tms"&&c.includes("/tilemapresource.xml")){const p=c.split("/tilemapresource.xml").join("");typeof a=="string"?a=p:a.url=p,s.url=a}else if(r==="ion"&&c.startsWith("ion://")){const f=+c.substring(6);s={...o,assetId:f,type:"IonImageryProvider"}}s.type=this.getOptionsType(r)}console.log("imageryProvider",s),s.type&&(n.imageryProvider=s)}flyTo(t,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):(s.flyTo(t&&t),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):(s.flyTo(t&&t),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(sd,"type",sd.register("ESCesiumViewer",l.ESImageryLayer.type,sd));let zm=sd;class uV extends l.Destroyable{constructor(t,n,r,o){super();y(this,"_show");y(this,"_czmESCustomPrimitive");y(this,"_czmTexture");this._sceneObject=t,this._show=this.disposeVar(l.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Xt(n,this._sceneObject.id)),this._czmTexture=this.dv(new ie(n));const s=t,a=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(l.track([a,"show"],[this,"show"])),this.dispose(l.track([a,"show"],[s,"show"])),this.dispose(l.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(l.track([a,"rotation"],[s,"rotation"])),this.dispose(l.track([a,"position"],[s,"position"])),this.dispose(l.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const h=()=>{const f=s.size/2,g=o[0].map(N=>N*f),m=o[1].map(N=>N*f),v=o[2].map(N=>N*f),_=o[3].map(N=>N*f),w=[...g,...m,...v,..._];let C=[0,3,2,0,2,1];(r=="north"||r=="west"||r=="bottom")&&(C=C.reverse());const x=[0,0],P=[1,0],b=[1,1],A=[0,1];let T=[];r=="east"||r=="south"?T=[...P,...x,...A,...b]:r=="west"?T=[...P,...b,...A,...x]:r=="top"?T=[...A,...b,...P,...x]:T=[...x,...P,...b,...A],a.indexTypedArray=new Uint16Array(C),a.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(T),componentsPerAttribute:2}},c.uri=l.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${r}.${s.mode!="blueSky"?"png":"jpg"}`);const I=n.getCameraInfo();if(I!=null){const B=l.getDistancesFromPositions([s.position,I.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:B)}const M=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!M)return;const{min:L,max:z}=M;a.setLocalAxisedBoundingBox(L,z)};h();const p=this.disposeVar(l.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(p.disposableOn(h))}}get show(){return this._show.value}set show(t){this._show.value=t}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(t){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-t>=0?1-t:0]}}}class hV extends l.Destroyable{constructor(e,t,n){if(super(),!t.viewer)return;let r=!0,o;this.dispose(t.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var c;if(!((c=t.viewer)!=null&&c.camera))return;const a=t.getCameraInfo();if(a!=null&&(o==null||o.position[0]!=a.position[0]||o.position[1]!=a.position[1]||o.position[2]!=a.position[2]||o.rotation[0]!=a.rotation[0]||o.rotation[1]!=a.rotation[1]||o.rotation[2]!=a.rotation[2])){o=a;const p=l.getDistancesFromPositions([e.position,o.position],"NONE")[0]/(e.size/2*e.autoOpacityFactor);e.autoFollow?(e.position=o.position,r&&(r=!1,n.forEach(f=>{f.changeOpacity(1)}))):n.forEach(f=>{f.changeOpacity(p)})}}s()}}const Ze=class Ze extends Mt{constructor(t,n){super(t,n);y(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ze._defaultLocalBox&&Ze._firstLoad&&(Ze._firstLoad=!1,Ze._defaultLocalBox=n.xbsjLocalBoxSources),Ze._eSLocalSkyBoxArr.push(t),this.d(()=>{Ze._eSLocalSkyBoxArr.includes(t)&&Ze._eSLocalSkyBoxArr.splice(Ze._eSLocalSkyBoxArr.indexOf(t),1),this.ChangeAutoFollow()});const o={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const a=o[s];this._czmSkyBoxComponents.push(this.dv(new uV(t,n,s,a)))}{const s=this.disposeVar(l.createNextAnimateFrameEvent(t.autoFollowChanged,t.autoOpacityFactorChanged));this.disposeVar(new l.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new hV(t,n,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(l.createNextAnimateFrameEvent(t.sizeChanged,t.modeChanged,t.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:t}=this;for(let n=Ze._eSLocalSkyBoxArr.length-1;n>=0;n--){const r=Ze._eSLocalSkyBoxArr[n];if(r.autoFollow&&r.show){t.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/east.${r.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/west.${r.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/bottom.${r.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/top.${r.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/north.${r.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/south.${r.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(t.xbsjLocalBoxSources=Ze._defaultLocalBox)}Ze._eSLocalSkyBoxArr.length==0&&(t.xbsjLocalBoxSources=Ze._defaultLocalBox)}flyTo(t,n){const{sceneObject:r,czmViewer:o}=this;if(!o.actived)return!1;if(r.flyToParam||r.flyInParam)return super.flyTo(t,n);{const s=r.size??l.ESLocalSkyBox.defaults.size;return r.position?(qn(o,r,n,r.position,s,t,!0),!0):!1}}};y(Ze,"type",Ze.register("ESCesiumViewer",l.ESLocalSkyBox.type,Ze)),y(Ze,"_defaultLocalBox"),y(Ze,"_firstLoad",!0),y(Ze,"_eSLocalSkyBoxArr",[]);let W_=Ze;const Fr=class Fr extends Mt{constructor(t,n){super(t,n);y(this,"_geoCustomDivPoi");y(this,"_textFunc",this.disposeVar(l.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new Ue(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this.geoCustomDivPoi;this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.bind([o,"position"],[t,"position"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"]));{this.dispose(o.pickedEvent.disposableOn(s=>{(t.allowPicking??l.ESLocationMeasurement.defaults.allowPicking)&&t.pickedEvent.emit(s)})),this.dispose(o.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=c=>o.pickFromDiv(a,{type:"viewerPicking",pointerEvent:c}))}));{const s=()=>{if(!t.position)return;const c=(this.textFunc??Fr.defaultTextFunc_度格式)(t.position);o.innerHTML=qa(c)};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?Fr.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?Fr.defaultTextFunc_度分格式:Fr.defaultTextFunc_度分秒格式};s(),this.d(n.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(t){this._textFunc.value=t}get textFuncChanged(){return this._textFunc.changed}flyTo(t,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):(s.flyTo(t),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):(s.flyTo(t),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(Fr,"type",Fr.register("ESCesiumViewer",l.ESLocationMeasurement.type,Fr)),y(Fr,"defaultTextFunc_度格式",t=>{if(!t)return"";const[n=0,r=0,o=0]=t;return`经度: ${n.toFixed(5)}°
|
|
1414
|
+
`,this._clampedIntensity=Math.max(1,t.fireHeight),this._totalDistance=p,this._startTime=performance.now(),this._preRenderListener&&this._preRenderListener(),this._preRenderListener=(M=this.czmViewer.viewer)==null?void 0:M.scene.preRender.addEventListener(()=>{const L=(performance.now()-this._startTime)*.001;r.setUniformMap({u_time:L,u_totalDistance:this._totalDistance,u_height:t.fireHeight})})}flyTo(t,n){const{sceneObject:r,czmViewer:o,geoPolygon:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):r.points&&r.points.length>=3?(gt(o,r,n,r.points,t),!0):!1:!1}};y(jp,"type",jp.register("ESCesiumViewer",l.ESGeoPolygonWithFire.type,jp));let N_=jp;const td=class td extends Ni{constructor(t,n){super(t,n);y(this,"_czmGeoESRectangle");y(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new se(n,t.id)),this._czmGeoESRectangle=this.disposeVar(new uo(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(l.track([s,"color"],[t,"strokeColor"])),this.dispose(l.track([s,"width"],[t,"strokeWidth"])),this.dispose(l.track([s,"ground"],[t,"strokeGround"])),this.dispose(l.track([o,"ground"],[t,"fillGround"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"]));{const a=()=>{s.show=t.show&&t.stroked,o.show=t.show&&t.filled};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.strokedChanged,t.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{t.filled?o.material={type:"Color",color:t.fillColor}:o.material=void 0};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(t.fillStyleChanged,t.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{const c=t.points;if(c&&c.length>=2){const{minPos:h,maxPos:p}=l.getMinMaxCorner(c);o.rectangle=[h[0],h[1],p[0],p[1]],o.height=c[0][2],o.extrudedHeight=c[0][2];const f=c.map(_=>(c&&(_[2]=c[0][2]),_)),g=f[0],m=f[1],v=[g,[g[0],m[1],g[2]],m,[m[0],g[1],m[2]]];s.positions=[...v,g]}else o.rectangle=void 0,s.positions=void 0,o.height=0,o.extrudedHeight=0};a(),this.dispose(t.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(t,n){const{sceneObject:r,czmViewer:o}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):r.points?(gt(o,r,n,r.points,t),!0):!1:!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,czmGeoESRectangle:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):r.points?(gt(o,r,n,r.points,t),!0):!1:!1}};y(td,"type",td.register("ESCesiumViewer",l.ESGeoRectangle.type,td));let O_=td;class up extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Vs(t,n));const{geoPolygon:r}=this;this.dispose(l.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{r.flyTo(s)})),this.dispose(l.bind([r,"show"],[this,"show"])),this.dispose(l.bind([r,"fill"],[this,"filled"])),this.dispose(l.bind([r,"strokeGround"],[this,"strokeGround"])),this.dispose(l.bind([r,"ground"],[this,"ground"])),this.dispose(l.bind([r,"outline"],[this,"outline"])),this.dispose(l.bind([r,"outlineColor"],[this,"outlineColor"])),this.dispose(l.bind([r,"outlineWidth"],[this,"outlineWidth"])),this.dispose(l.bind([r,"color"],[this,"color"])),this.dispose(l.bind([r,"depth"],[this,"depth"]));const o=()=>{if(this.positions&&this.positions.length>=2){const s=zv([...this.positions,this.positions[0]]);r.positions=s}else r.positions=void 0};o(),this.dispose(this.positionsChanged.disposableOn(o))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get geoPolygon(){return this._geoPolygon}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:1,color:l.reactArrayWithUndefined([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0})})(up||(up={})),l.extendClassProps(up.prototype,up.createDefaultProps);const ed=class ed extends Ni{constructor(t,n){super(t,n);y(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new up(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._geoSmoothPolygon;this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.bind([o,"positions"],[t,"points"])),this.dispose(l.track([o,"strokeGround"],[t,"strokeGround"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),this.dispose(l.track([o,"outline"],[t,"stroked"])),this.dispose(l.track([o,"outlineColor"],[t,"strokeColor"])),this.dispose(l.track([o,"outlineWidth"],[t,"strokeWidth"])),this.dispose(l.track([o,"strokeGround"],[t,"strokeGround"])),this.dispose(l.track([o,"filled"],[t,"filled"])),this.dispose(l.track([o,"color"],[t,"fillColor"])),this.dispose(l.track([o,"ground"],[t,"ground"]));{const s=()=>{o.ground=t.ground||t.fillGround};s();const a=this.dv(l.createNextAnimateFrameEvent(t.groundChanged,t.fillGroundChanged));this.d(a.don(s))}{const s=()=>{o.color=t.filled?t.fillColor:cp.defaults.fillStyle.color};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.fillStyleChanged,t.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([o,"depth"],[t,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(t,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,geoSmoothPolygon:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}};y(ed,"type",ed.register("ESCesiumViewer",cp.type,ed));let B_=ed;const id=class id extends Mt{constructor(t,n){super(t,n);y(this,"_czmModel");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Mi(n,t.id));const o=this._czmModel;this.d(o.readyEvent.don(a=>{var c;o.activeAnimationsJson=(c=o.gltf.animations)==null?void 0:c.map((h,p)=>({index:p,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"})),t.czmModelReadyEvent.emit(a),t.readyEvent.emit(a)})),this.ad(new zf(r,this._czmModel)),this.d(l.track([o,"show"],[t,"show"])),this.d(l.track([o,"color"],[t,"czmColor"])),this.d(l.track([o,"nativeMaximumScale"],[t,"czmMaximumScale"])),this.d(l.track([o,"nativeMinimumPixelSize"],[t,"czmMinimumPixelSize"])),this.ad(l.createEventsCallFunc([t.positionChanged,t.positionOffsetChanged],()=>{o.position=l.geoDestination(t.position,t.positionOffset)},{immediate:!0})),this.d(l.track([o,"nativeScale"],[t,"czmNativeScale"])),this.d(l.track([o,"scale"],[t,"scale"])),this.ad(l.track([o,"imageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(l.track([o,"environmentMapManager"],[t,"czmEnvironmentMapManager"]));{const a=c=>{t.czmEnvironmentMapManager=t.czmEnvironmentMapManager?{...t.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};a(t.czmAtmosphereScatteringIntensity),this.ad(t.czmAtmosphereScatteringIntensityChanged.don(c=>a(c)))}{const a=()=>{var c,h;(c=t.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(t.czmAtmosphereScatteringIntensity=(h=t.czmEnvironmentMapManager)==null?void 0:h.atmosphereScatteringIntensity)};a(),this.ad(t.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const c=[...t.rotation??[0,0,0]];c[0]+=t.instances&&t.instances.length!=0?0:90,o.rotation=c};a(),this.d(t.rotationChanged.don(a));{const c=()=>{if(a(),!t.instances||t.instances.length==0){o.instances=void 0;return}o.instances=t.instances.map(h=>{const p=JSON.parse(JSON.stringify(h));return!p.rotation&&(p.rotation=[0,0,0]),p.rotation[0]+=90,p})};c(),this.ad(t.instancesChanged.don(c))}}this.ad(t.setMaterialEvent.don(a=>{o.setMaterial(a)}));{const a=()=>{const c=[...o.rotation];c[0]-=t.instances&&t.instances.length!=0?0:90,t.rotation=c};a(),this.d(o.rotationChanged.don(a))}{const a=this.dv(l.createNextAnimateFrameEvent(t.allowPickingChanged,t.editingChanged)),c=()=>{t.allowPicking&&!t.editing?o.allowPicking=!0:o.allowPicking=!1};c(),this.d(a.don(c))}const s=()=>{var a;o.url=l.ESSceneObject.context.getStrFromEnv(Gf(typeof t.url=="string"?t.url:((a=t.url)==null?void 0:a.url)??l.ESGltfModel.defaults.url))};s(),this.d(t.urlChanged.don(s)),this.d(t.setNodePositionEvent.don((a,c)=>{o.setNodeTranslation(a,c)})),this.d(t.setNodeRotationEvent.don((a,c)=>{o.setNodeRotation(a,c)})),this.d(t.setNodeScaleEvent.don((a,c)=>{o.setNodeScale(a,c)})),this.d(t.printDebugInfoEvent.don(()=>{o.printDebugInfo()}))}get model(){return this._czmModel}flyTo(t,n){const{sceneObject:r,czmViewer:o,model:s}=this;return o.actived?r.flyToParam||r.flyInParam?(super.flyTo(t,n),!0):(s&&ai(o,r,n,t,s,!0),!!s):!1}};y(id,"type",id.register("ESCesiumViewer",l.ESGltfModel.type,id));let z_=id;function lA(i,e){const t=i[0]-e[0],n=i[1]-e[1],r=i[2]-e[2];return Math.sqrt(t*t+n*n+r*r)}class hp extends l.Destroyable{constructor(t,n){super();y(this,"_pickedEvent",this.disposeVar(new l.Event));y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_distance",this.disposeVar(l.react(0)));y(this,"_surfaceDistance",this.disposeVar(l.react(0)));y(this,"_height",this.disposeVar(l.react(0)));y(this,"_middlePosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));y(this,"_heightPosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));const r=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=l.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=l.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=l.lbhToXyz(this.positions[0]),a=l.lbhToXyz(this.positions[1]);this._distance.value=lA(s,a),this._surfaceDistance.value=lA(l.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};r();const o=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(o.disposableOn(r));{const s=this.disposeVar(new se(t,n));s.ground=!1,s.loop=!1,this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([s,"arcType"],[this,"arcType"])),this.dispose(l.bind([s,"color"],[this,"color"])),this.dispose(l.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(l.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(l.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(l.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(l.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(l.bind([s,"show"],[this,"show"])),this.dispose(l.bind([s,"width"],[this,"width"])),this.dispose(l.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[h,p]=this.positions;s.positions=[h,p,[h[0],h[1],p[2]]]}else s.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{t.actived&&s.flyTo(c)}));const a=this.disposeVar(new Ue(t,n));this.dispose(l.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(l.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(l.track([a,"show"],[this,"show"]));{const c=()=>{a.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{a.innerHTML=qa(`高度: ${Wf(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(a.pickedEvent.don(c=>{Xo(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:l.reactPositions(void 0),width:1,color:l.reactArray([1,1,1,1]),hasDash:!1,gapColor:l.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(hp||(hp={})),l.extendClassProps(hp.prototype,hp.createDefaultProps);const nd=class nd extends Ni{constructor(t,n){super(t,n);y(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new hp(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:o}=this;this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),this.dispose(l.bind([o,"positions"],[t,"points"]));{const s=()=>{if(t.stroked)o.width=t.strokeWidth;else{o.width=0;return}o.width=t.strokeWidth,o.color=t.strokeColor;const h=t.strokeMaterial??"normal";h==="hasDash"?(o.hasDash=!0,o.hasArrow=!1):h==="hasArrow"?(o.hasDash=!1,o.hasArrow=!0):(o.hasDash=!1,o.hasArrow=!1);const p=t.strokeStyle;if(p.material==="hasDash"&&p.materialParams)try{const f=p.materialParams;Reflect.has(f,"gapColor")&&(o.gapColor=f.gapColor??[0,0,0,0]),Reflect.has(f,"dashLength")&&(o.dashLength=f.dashLength),Reflect.has(f,"dashPattern")&&(o.dashPattern=f.dashPattern)}catch(f){console.error(f)}else o.gapColor=[0,0,0,0],o.dashLength=0,o.dashPattern=0};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.strokeStyleChanged,t.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(o.pickedEvent.disposableOn(s=>{Xo(s)===0&&(t.allowPicking??!1)&&t.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(t,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,czmHeightMeasurement:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):s.positions?(gt(o,r,n,s.positions,t),!0):!1:!1}};y(nd,"type",nd.register("ESCesiumViewer",l.ESHeightMeasurement.type,nd));let V_=nd;const cV={standing:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],walking:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],running:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},rd=class rd extends Mt{constructor(t,n){super(t,n);y(this,"_czmModelPrimitive");const r=n.viewer;if(!r){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Mi(n,this.sceneObject.id));const o=this._czmModelPrimitive;this.dispose(l.track([o,"show"],[t,"show"])),this.ad(l.createEventsCallFunc([t.positionChanged,t.positionOffsetChanged],()=>{o.position=l.geoDestination(t.position,t.positionOffset)},{immediate:!0}));{const f=()=>{const g=[...t.rotation??[0,0,0]];g[0]+=t.instances&&t.instances.length!=0?0:90,o.rotation=g};f(),this.d(t.rotationChanged.don(f));{const g=()=>{if(f(),!t.instances||t.instances.length==0){o.instances=void 0;return}o.instances=t.instances.map(m=>{const v=JSON.parse(JSON.stringify(m));return!v.rotation&&(v.rotation=[0,0,0]),v.rotation[0]+=90,v})};g(),this.ad(t.instancesChanged.don(g))}}{const f=()=>{const g=[...o.rotation];g[0]-=t.instances&&t.instances.length!=0?0:90,t.rotation=g};f(),this.d(o.rotationChanged.don(f))}this.dispose(l.bind([o,"scale"],[t,"scale"])),this.d(o.readyEvent.don(f=>{t.readyEvent.emit(f)}));{const f=this.dv(l.createNextAnimateFrameEvent(t.allowPickingChanged,t.editingChanged)),g=()=>{t.allowPicking&&!t.editing?o.allowPicking=!0:o.allowPicking=!1};g(),this.d(f.don(g))}const s={worker:"worker.glb",police:"police.glb",pedestrian:"pedestrian.glb",stranger:"Stranger.glb",suitMan:"SuitsMan.glb",suitWoman:"SuitsWoman.glb",repairMan:"repairman.glb",fireMan:"fireMan.glb",firefighterWithWaterPump:"firefighterWithWaterPump.glb",firefighterWithFirestick:"firefighterWithFirestick.glb",firefighterWithDripIgniter:"firefighterWithDripIgniter.glb",firefighterWithBlower:"firefighterWithBlower.glb",firefighterWithHose:"firefighterWithHose.glb",firefighterWithThrowable:"firefighterWithThrowable.glb",firefighterWithToolkit:"firefighterWithToolkit.glb",firefighterWalking:"firefighterWalking.glb",firefighterUniform:"firefighterUniform.glb"},a=f=>l.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/"+f),c=()=>{o.activeAnimationsJson=void 0,o.url=a(s[t.mode]??s.worker)};this.dispose(t.modeChanged.disposableOn(()=>{c()})),c();const h=()=>{var m,v;const f=t.animation??l.ESHuman.defaults.animation,g=cV[f];if(!t.show||!o.ready||!((m=o.gltf)!=null&&m.animations)||g[0].index&&g[0].index>=((v=o.gltf)==null?void 0:v.animations.length)){o.activeAnimationsJson=void 0;return}o.activeAnimationsJson=g};h();const p=this.ad(l.createNextAnimateFrameEvent(o.readyEvent,t.showChanged,t.animationChanged));this.dispose(p.disposableOn(()=>h())),this.ad(new zf(r,o))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(t,n){const{sceneObject:r,czmViewer:o,czmModelPrimitive:s}=this;return!o.actived||!o.viewer?!1:r.flyToParam||r.flyInParam?(super.flyTo(t,n),!0):(s&&ai(o,r,n,t,s,!0),!!s)}};y(rd,"type",rd.register("ESCesiumViewer",l.ESHuman.type,rd));let U_=rd;class cA extends l.Destroyable{constructor(t,n){super();y(this,"_czmGeoCanvasImagePoi");y(this,"flyTo",(t,n)=>{if(this.czmGeoCanvasImagePoi.position){mt(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Hn,t);return}this.czmGeoCanvasImagePoi.flyTo(t&&t*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new lo(n,t.id));const r=this._czmGeoCanvasImagePoi;r.pickOnClick=!0,this.d(r.pickedEvent.don(o=>{(t.allowPicking??!1)&&t.pickedEvent.emit(o)}));{const o=p=>{let f=p;return p.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+p.split("inner://")[1]),l.ESSceneObject.context.getStrFromEnv(Gf(f))},s=()=>{const p=o(typeof t.url=="string"?t.url:t.url.url);if(r.imageUri=p,t.sizeByContent){const g=new Image;g.src=p,g.onload=()=>{r.size=[g.width,g.height]}}else{const g=t.size;r.size=[...g]}},a=this.disposeVar(l.createNextAnimateFrameEvent(t.urlChanged,t.sizeByContentChanged,t.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(l.track([r,"zOrder"],[t,"zOrder"])),this.dispose(l.track([r,"show"],[t,"show"])),this.dispose(l.bind([r,"position"],[t,"position"])),this.ad(l.bind([r,"isHoverZoom"],[t,"isHoverZoom"])),this.ad(l.bind([r,"hoverHighlight"],[t,"hoverHighlight"]));{const p=()=>{r.scale=[t.scale[1],t.scale[2]]};p(),this.dispose(t.scaleChanged.don(p))}const c=()=>{const p=t.anchor,f=t.offset;p?r.originRatioAndOffset=[...p,-f[0],-f[1]]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(l.createNextAnimateFrameEvent(t.anchorChanged,t.offsetChanged));this.dispose(h.disposableOn(()=>c())),c(),this.dispose(r.clickEvent.disposableOn(p=>{const{offsetX:f,offsetY:g}=p,v={type:p.button===0?"leftClick":p.button===2?"rightClick":void 0,add:{mousePos:[f,g]}};t.widgetEvent.emit(v)})),this.dispose(r.hoveredChanged.disposableOn(p=>{if(p===void 0)return;const f={type:p?"mouseEnter":"mouseLeave"};t.widgetEvent.emit(f)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class uA extends l.Destroyable{constructor(t,n,r){super();y(this,"_czmGeoImageModel");y(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});y(this,"_isPointEvent",!1);y(this,"flyTo",(t,n)=>{if(this.czmGeoImageModel.position)return qn(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),t,!0);this.czmGeoImageModel.flyTo(t&&t*1e3)});this.sceneObject=t,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Zo(n,t.id));const o=this._czmGeoImageModel;this.ad(n.clickEvent.don(g=>{const m=g==null?void 0:g.pointerEvent;m&&(this._isPointEvent=!0,this._eventInfo={type:m.button==0?"leftClick":m.button==2?"rightClick":"leftClick",add:{mousePos:[m.offsetX,m.offsetY]}})})),this.d(t.pickedEvent.don(g=>{var m,v,_;g.screenPosition&&this._isPointEvent&&((m=this._eventInfo.add)!=null&&m.mousePos)&&Math.abs(g.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(g.screenPosition[1]-((_=this._eventInfo.add)==null?void 0:_.mousePos[1]))<1&&(t.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),l.engineObjectCreatedUpdate(this,t,()=>{const g=n.getEngineObject(t);this.ad(g.lastHoverResultChanged.don((m,v)=>{(m==null?void 0:m.sceneObject)==(v==null?void 0:v.sceneObject)||(m==null?void 0:m.sceneObject)!=t&&(v==null?void 0:v.sceneObject)!=t||(m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:m==null?void 0:m.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),t.isHoverZoom&&m.sceneObject.id==t.id&&(o.scale=[o.scale[0]*1.5,o.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:m==null?void 0:m.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),t.isHoverZoom&&v.sceneObject.id==t.id&&(o.scale=[o.scale[0]/1.5,o.scale[1]/1.5])))}))});const s=t.sizeByContent,c=(g=>{let m=g;return g.includes("inner://")&&(m="${earthsdk3-assets-script-dir}/assets/img/points/"+g.split("inner://")[1]),l.ESSceneObject.context.getStrFromEnv(Gf(m))})(typeof r.sceneObject.url=="string"?r.sceneObject.url:r.sceneObject.url.url),h=new Image;h.src=c,h.onload=()=>{if(s)o.size=[h.width/100,h.height/100];else{const g=t.size;o.size=[g[0]/100,g[1]/100]}},o.uri=c,this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.bind([o,"position"],[t,"position"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),o.pixelSize=void 0,o.useAxis="XZ";{const g=()=>{o.scale=[t.scale[1],t.scale[2]]};g(),this.d(t.scaleChanged.don(g))}{const g=()=>{t.rotationType===0&&(o.rotationMode="WithProp",this.d(Ke([o,"rotation"],[t,"rotation"]))),t.rotationType===1&&(o.rotationMode="WithCamera"),t.rotationType===2&&(o.rotationMode="WithCameraOnlyZ")};g(),this.dispose(t.rotationTypeChanged.disposableOn(g))}const p=()=>{const g=t.anchor,m=t.offset;g?o.originRatioAndOffset=[...g,-m[0]/100,-m[1]/100]:o.originRatioAndOffset=[0,0,0,0]},f=this.ad(l.createNextAnimateFrameEvent(t.anchorChanged,t.offsetChanged));this.dispose(f.disposableOn(()=>p())),p()}get czmGeoImageModel(){return this._czmGeoImageModel}}const od=class od extends il{constructor(t,n){super(t,n);y(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(l.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new l.ObjResettingWithEvent(o,()=>this.sceneObject.screenRender?new cA(this.sceneObject,this.czmViewer):new uA(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(t,n){const{sceneObject:r,czmViewer:o,resetting:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):(s&&s.obj&&s.obj.flyTo(t,n),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(od,"type",od.register("ESCesiumViewer",l.ESImageLabel.type,od));let G_=od;const sd=class sd extends sr{constructor(t,n){super(t,n);y(this,"_czmImagery");y(this,"_innerUrl",this.ad(l.react("")));if(this._czmImagery=this.dv(new Qs(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this._czmImagery;this.d(l.track([o,"show"],[t,"show"])),this.d(l.bind([o,"alpha"],[t,"opacity"])),this.d(l.bind([o,"alpha"],[t,"czmAlpha"])),this.d(l.track([o,"splitDirection"],[t,"splitDirection"])),this.d(l.track([o,"brightness"],[t,"czmBrightness"])),this.d(l.track([o,"contrast"],[t,"czmContrast"])),this.d(l.track([o,"hue"],[t,"czmHue"])),this.d(l.track([o,"saturation"],[t,"czmSaturation"])),this.d(l.track([o,"gamma"],[t,"czmGamma"])),this.d(l.track([o,"rectangle"],[t,"rectangle"])),this.d(l.track([o,"zIndex"],[t,"zIndex"])),this.ad(l.track([o,"targetID"],[t,"targetID"])),this.ad(l.createEventsCallFunc(t.urlChanged,()=>{this.updateUrl()},{immediate:!0})),this.ad(l.createEventsCallFunc([this.innerUrlChanged,t.maximumLevelChanged,t.minimumLevelChanged,t.optionsChanged,t.rectangleChanged],()=>{this.updateImageryProvider()},{immediate:!0}))}get czmImagery(){return this._czmImagery}get innerUrl(){return this._innerUrl.value}set innerUrl(t){this._innerUrl.value=t}get innerUrlChanged(){return this._innerUrl.changed}getOptionsType(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}updateUrl(){const{sceneObject:t}=this;if(typeof t.url=="string")this.innerUrl=l.ESSceneObject.context.getStrFromEnv(t.url);else{const n=t.url;n.url=l.ESSceneObject.context.getStrFromEnv(n.url),this.innerUrl=n}}updateImageryProvider(){var h;const{sceneObject:t,czmImagery:n}=this;if(!this.innerUrl)return;const r=(((h=t.options)==null?void 0:h.type)??"auto").toLowerCase(),o=t.options??{};let s={type:"",url:this.innerUrl,rectangle:t.rectangle,maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,...o},a=this.innerUrl,c=typeof a=="string"?a:a.url;if(r==="auto"){const p=c.toLowerCase();if(p.startsWith("ion://")){const g=+p.substring(6);s={...o,assetId:g,type:"IonImageryProvider"}}else if(p.includes("{x}")||p.includes("{y}")||p.includes("{z}"))s.type="UrlTemplateImageryProvider";else if(p.includes("wmts"))s.type="WebMapTileServiceImageryProvider";else if(p.includes("wms"))s.type="WebMapServiceImageryProvider";else if(c.includes("/tilemapresource.xml")){const f=c.split("/tilemapresource.xml").join("");typeof a=="string"?a=f:a.url=f,s.url=a,s.type="TileMapServiceImageryProvider"}}else{if(r==="tms"&&c.includes("/tilemapresource.xml")){const p=c.split("/tilemapresource.xml").join("");typeof a=="string"?a=p:a.url=p,s.url=a}else if(r==="ion"&&c.startsWith("ion://")){const f=+c.substring(6);s={...o,assetId:f,type:"IonImageryProvider"}}s.type=this.getOptionsType(r)}console.log("imageryProvider",s),s.type&&(n.imageryProvider=s)}flyTo(t,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):(s.flyTo(t&&t),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,czmImagery:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):(s.flyTo(t&&t),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(sd,"type",sd.register("ESCesiumViewer",l.ESImageryLayer.type,sd));let zm=sd;class uV extends l.Destroyable{constructor(t,n,r,o){super();y(this,"_show");y(this,"_czmESCustomPrimitive");y(this,"_czmTexture");this._sceneObject=t,this._show=this.disposeVar(l.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Xt(n,this._sceneObject.id)),this._czmTexture=this.dv(new ie(n));const s=t,a=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(l.track([a,"show"],[this,"show"])),this.dispose(l.track([a,"show"],[s,"show"])),this.dispose(l.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(l.track([a,"rotation"],[s,"rotation"])),this.dispose(l.track([a,"position"],[s,"position"])),this.dispose(l.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const h=()=>{const f=s.size/2,g=o[0].map(N=>N*f),m=o[1].map(N=>N*f),v=o[2].map(N=>N*f),_=o[3].map(N=>N*f),w=[...g,...m,...v,..._];let C=[0,3,2,0,2,1];(r=="north"||r=="west"||r=="bottom")&&(C=C.reverse());const x=[0,0],P=[1,0],b=[1,1],A=[0,1];let T=[];r=="east"||r=="south"?T=[...P,...x,...A,...b]:r=="west"?T=[...P,...b,...A,...x]:r=="top"?T=[...A,...b,...P,...x]:T=[...x,...P,...b,...A],a.indexTypedArray=new Uint16Array(C),a.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(T),componentsPerAttribute:2}},c.uri=l.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${r}.${s.mode!="blueSky"?"png":"jpg"}`);const I=n.getCameraInfo();if(I!=null){const B=l.getDistancesFromPositions([s.position,I.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:B)}const M=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!M)return;const{min:L,max:z}=M;a.setLocalAxisedBoundingBox(L,z)};h();const p=this.disposeVar(l.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(p.disposableOn(h))}}get show(){return this._show.value}set show(t){this._show.value=t}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(t){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-t>=0?1-t:0]}}}class hV extends l.Destroyable{constructor(e,t,n){if(super(),!t.viewer)return;let r=!0,o;this.dispose(t.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var c;if(!((c=t.viewer)!=null&&c.camera))return;const a=t.getCameraInfo();if(a!=null&&(o==null||o.position[0]!=a.position[0]||o.position[1]!=a.position[1]||o.position[2]!=a.position[2]||o.rotation[0]!=a.rotation[0]||o.rotation[1]!=a.rotation[1]||o.rotation[2]!=a.rotation[2])){o=a;const p=l.getDistancesFromPositions([e.position,o.position],"NONE")[0]/(e.size/2*e.autoOpacityFactor);e.autoFollow?(e.position=o.position,r&&(r=!1,n.forEach(f=>{f.changeOpacity(1)}))):n.forEach(f=>{f.changeOpacity(p)})}}s()}}const Ze=class Ze extends Mt{constructor(t,n){super(t,n);y(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ze._defaultLocalBox&&Ze._firstLoad&&(Ze._firstLoad=!1,Ze._defaultLocalBox=n.xbsjLocalBoxSources),Ze._eSLocalSkyBoxArr.push(t),this.d(()=>{Ze._eSLocalSkyBoxArr.includes(t)&&Ze._eSLocalSkyBoxArr.splice(Ze._eSLocalSkyBoxArr.indexOf(t),1),this.ChangeAutoFollow()});const o={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const a=o[s];this._czmSkyBoxComponents.push(this.dv(new uV(t,n,s,a)))}{const s=this.disposeVar(l.createNextAnimateFrameEvent(t.autoFollowChanged,t.autoOpacityFactorChanged));this.disposeVar(new l.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new hV(t,n,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(l.createNextAnimateFrameEvent(t.sizeChanged,t.modeChanged,t.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:t}=this;for(let n=Ze._eSLocalSkyBoxArr.length-1;n>=0;n--){const r=Ze._eSLocalSkyBoxArr[n];if(r.autoFollow&&r.show){t.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/east.${r.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/west.${r.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/bottom.${r.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/top.${r.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/north.${r.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/south.${r.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(t.xbsjLocalBoxSources=Ze._defaultLocalBox)}Ze._eSLocalSkyBoxArr.length==0&&(t.xbsjLocalBoxSources=Ze._defaultLocalBox)}flyTo(t,n){const{sceneObject:r,czmViewer:o}=this;if(!o.actived)return!1;if(r.flyToParam||r.flyInParam)return super.flyTo(t,n);{const s=r.size??l.ESLocalSkyBox.defaults.size;return r.position?(qn(o,r,n,r.position,s,t,!0),!0):!1}}};y(Ze,"type",Ze.register("ESCesiumViewer",l.ESLocalSkyBox.type,Ze)),y(Ze,"_defaultLocalBox"),y(Ze,"_firstLoad",!0),y(Ze,"_eSLocalSkyBoxArr",[]);let W_=Ze;const Fr=class Fr extends Mt{constructor(t,n){super(t,n);y(this,"_geoCustomDivPoi");y(this,"_textFunc",this.disposeVar(l.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new Ue(n,t.id)),!n.viewer){console.warn("viewer is undefined!");return}const o=this.geoCustomDivPoi;this.dispose(l.track([o,"show"],[t,"show"])),this.dispose(l.bind([o,"position"],[t,"position"])),this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"]));{this.dispose(o.pickedEvent.disposableOn(s=>{(t.allowPicking??l.ESLocationMeasurement.defaults.allowPicking)&&t.pickedEvent.emit(s)})),this.dispose(o.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=c=>o.pickFromDiv(a,{type:"viewerPicking",pointerEvent:c}))}));{const s=()=>{if(!t.position)return;const c=(this.textFunc??Fr.defaultTextFunc_度格式)(t.position);o.innerHTML=qa(c)};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?Fr.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?Fr.defaultTextFunc_度分格式:Fr.defaultTextFunc_度分秒格式};s(),this.d(n.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(t){this._textFunc.value=t}get textFuncChanged(){return this._textFunc.changed}flyTo(t,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyToParam||r.flyInParam?super.flyTo(t,n):(s.flyTo(t),r.flyOverEvent.emit(n,"over",o),!0):!1}flyIn(t,n){const{sceneObject:r,czmViewer:o,geoCustomDivPoi:s}=this;return o.actived?r.flyInParam?super.flyIn(t,n):(s.flyTo(t),r.flyOverEvent.emit(n,"over",o),!0):!1}};y(Fr,"type",Fr.register("ESCesiumViewer",l.ESLocationMeasurement.type,Fr)),y(Fr,"defaultTextFunc_度格式",t=>{if(!t)return"";const[n=0,r=0,o=0]=t;return`经度: ${n.toFixed(5)}°
|
|
1415
1415
|
纬度: ${r.toFixed(5)}°
|
|
1416
1416
|
高度: ${o.toFixed(2)}m`}),y(Fr,"defaultTextFunc_度分格式",t=>{if(!t)return"";const[n,r,o]=Ov(t,!0);return`经度: ${n}
|
|
1417
1417
|
纬度: ${r}
|
|
@@ -4053,10 +4053,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4053
4053
|
`;function l9(){const i="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",t=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4054
4054
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4055
4055
|
gitee地址:${i}
|
|
4056
|
-
`;console.log(t);const n=globalThis.prompt(t,i);n&&globalThis.open(n,"_blank")}const Di=class Di extends l.ESViewer{constructor(t){super(t);y(this,"_disabledInputStack",this.disposeVar(l.react(0)));y(this,"_viewer",this.dv(l.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(l.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(l.react(0)));y(this,"_editingSystem",km);y(this,"_moveObjectsProcess",this.ad(XA()));if(t.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new LU(this)),this.ad(new NU(this)),this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new VU(this)})),this._viewerLegend=this.dv(new i9(this)),this._viewerInstance=this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new MC(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=ot([1,1,1,1]))}));const n=t;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new gW(this.subContainer,this,r=>this._viewer.value=r,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&&He(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(t,n,r,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(t,void 0,n,o)}async pickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(t)}async quickPickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(t)}async getTerrainHeight(t){var s;const{viewer:n}=this;if(!n)return;const r=d.Cartographic.fromDegrees(t[0],t[1],t[2],Di.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await d.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Wn(t),rotation:Ql(t)}}calcFlyToParam(t){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!t)return;const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,n.positionWC,new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=Ql(n),g=f[0]-p,m=f[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:1,hDelta:g,pDelta:m}}flyIn(t,n,r,o="default"){var c;const s={position:t,rotation:n,duration:(r??1)*1e3},a=(c=this.viewer)==null?void 0:c.camera;return a&&nh(a,s,o)}flyTo(t,n,r="default"){var m;const{distance:o,heading:s,pitch:a,flyDuration:c,hDelta:h,pDelta:p}=t,f={position:n,viewDistance:o,rotation:[s,a,0],duration:c*1e3,hdelta:h,pdelta:p},g=(m=this.viewer)==null?void 0:m.camera;return g&&nh(g,f,r)}flyToBoundingSphere(t,n,r=1){var f;const o=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],s=l.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:c}=s,h={position:a,viewDistance:n??c,rotation:[0,-90,0],duration:r*1e3},p=(f=this.viewer)==null?void 0:f.camera;return p&&nh(p,h)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Wn(t),rotation:Ql(t)}}transformFlyParam(t,n){if("position"in n){const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,Tt(n.position),new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=n.rotation[0]-p,g=n.rotation[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:n.flyDuration??1,hDelta:f,pDelta:g}}else{const r=Tt(t);let o={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const s=new d.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=d.Math.PI_OVER_TWO;const c=d.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),h=d.Matrix4.multiplyByPointAsVector(c,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(h,n.distance,h),d.Cartesian3.subtract(r,h,r)}n.hDelta&&(o.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=d.Math.toRadians(n.pDelta));const a=vt(r);return a?{position:a,rotation:[d.Math.toDegrees(o.heading),d.Math.toDegrees(o.pitch),d.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(t,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(t,n,r),this._navigationMode.value="Walk"}changeToMap(){var t,n;(n=(t=this._viewerInstance)==null?void 0:t.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(t,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(t,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(t,n,r,o,s,a){var c,h;(h=(c=this._viewerInstance)==null?void 0:c.obj)==null||h.navigationManager.changeToLine(t,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(t){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToRotatePoint(t,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToFollow(t,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(t){return Promise.resolve(void 0)}async getVersion(){const t=globalThis.g_XE3CopyRights??{};return t.cesium={version:d.VERSION},t}async getHeightByLonLat(t,n,r){if(!this.viewer)return null;const o=d.Cartographic.fromDegrees(t,n,void 0,Di.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(t,n){const r=t.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(t,n){if(this.viewer)return await Ex(this.viewer.scene,t,n)}async lonLatAltToScreenPosition(t){if(!this.viewer||!this.isPointVisible(t))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Tt(t));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(t){this._notSupportEditingCount.value=t}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(t,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=t.components.main??t;o&&n!=null&&(o.editingID=`${r.callSource}_${l.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(t){const n=[],r=l.createGuid();for(let o=0;o<t.length;o++){const s=t[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(t){return this.sceneObjectsMap.get(t)}setCurrentDefaultAccessToken(){this.ionAccessToken=Di.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Di.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Di.latestDefaultAccessToken}positionsToLocalPositions(t,n){return an(t,n)}localPositionsToPositions(t,n){return Ns(t,n)}isPointVisible(t){if(!this.viewer)return!1;const n=t instanceof d.Cartesian3?t:Tt(t),r=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const t={...super.getESProperties()},n=Di.defaults;return{...t,more:[...t.more,new l.DivideProperty("通用"),new l.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",a9,s9,!0),new l.MethodProperty("获取Cesium官方TOKEN",()=>Di.getCesiumIonToken(),[],"获取官方token"),new l.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new l.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new l.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new l.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new l.DivideProperty("Viewer"),new l.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new l.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new l.BooleanProperty([this,"shadows"]),new l.DivideProperty("比例尺"),new l.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new l.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new l.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new l.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new l.DivideProperty("场景"),new l.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new l.DivideProperty("Globe"),new l.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new l.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new l.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new l.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new l.BooleanProperty([this,"sceneGlobeShowSkirts"]),new l.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new l.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new l.JsonProperty([this,"sceneGlobeClippingPlanes"]),new l.StringProperty([this,"sceneGlobeClippingPlanesId"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new l.DivideProperty("underground"),new l.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new l.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new l.DivideProperty("Translucency"),new l.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new l.DivideProperty("Sun"),new l.BooleanProperty([this,"sun"],"sun",n.sun,!0),new l.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new l.DivideProperty("Moon"),new l.BooleanProperty([this,"moon"],"moon",n.moon,!0),new l.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new l.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new l.DivideProperty("SkyBox"),new l.BooleanProperty([this,"sceneSkyBoxShow"]),new l.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new l.DivideProperty("Background"),new l.BooleanProperty([this,"xbsjUseBackground"]),new l.StringProperty([this,"xbsjBackgroundImageUri"]),new l.ColorProperty([this,"xbsjBackgroundColor"]),new l.DivideProperty("SkyAtmosphere"),new l.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new l.DivideProperty("Fog"),new l.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new l.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new l.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new l.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new l.DivideProperty("Sscc"),new l.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new l.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new l.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new l.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new l.DivideProperty("后处理"),new l.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new l.DivideProperty("环境遮蔽"),new l.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new l.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new l.DivideProperty("Bloom"),new l.BooleanProperty([this,"scenePpsBloomEnabled"]),new l.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new l.NumberProperty([this,"scenePpsBloomContrast"]),new l.NumberProperty([this,"scenePpsBloomBrightness"]),new l.NumberProperty([this,"scenePpsBloomDelta"]),new l.NumberProperty([this,"scenePpsBloomSigma"]),new l.NumberProperty([this,"scenePpsBloomStepSize"]),new l.DivideProperty("调试"),new l.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new l.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new l.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new l.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new l.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new l.DivideProperty("Inspector"),new l.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new l.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new l.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Di,"type",Di.register("ESCesiumViewer",Di)),y(Di,"getCesiumIonToken",l9),y(Di,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(Di,"latestDefaultAccessToken"),y(Di,"ObjectsToExcludeWrapper",zU),y(Di,"defaults",{...l.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(t=>180*t/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.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}),y(Di,"getHeightsScartchCarto",new d.Cartographic);let le=Di;(i=>{i.createDefaultProps=()=>({...l.ESViewer.createDefaultProps(),...o9()})})(le||(le={})),l.extendClassProps(le.prototype,le.createDefaultProps),R.copyright=void 0;try{const i="earthsdk3-cesium",e="3.10.0",t="2026-05-22T08:04:00.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="6819366b74fba501f9110e7ccac6e0b85b00e439",a=((Date.now()-177943704e4)/36e5).toFixed(1),c=`%c🌏 ${i}%c ${e}.${o.slice(0,8)}.${t} (距今${a}个小时)
|
|
4056
|
+
`;console.log(t);const n=globalThis.prompt(t,i);n&&globalThis.open(n,"_blank")}const Di=class Di extends l.ESViewer{constructor(t){super(t);y(this,"_disabledInputStack",this.disposeVar(l.react(0)));y(this,"_viewer",this.dv(l.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(l.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(l.react(0)));y(this,"_editingSystem",km);y(this,"_moveObjectsProcess",this.ad(XA()));if(t.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new LU(this)),this.ad(new NU(this)),this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new VU(this)})),this._viewerLegend=this.dv(new i9(this)),this._viewerInstance=this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new MC(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=ot([1,1,1,1]))}));const n=t;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new gW(this.subContainer,this,r=>this._viewer.value=r,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&&He(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(t,n,r,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(t,void 0,n,o)}async pickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(t)}async quickPickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(t)}async getTerrainHeight(t){var s;const{viewer:n}=this;if(!n)return;const r=d.Cartographic.fromDegrees(t[0],t[1],t[2],Di.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await d.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Wn(t),rotation:Ql(t)}}calcFlyToParam(t){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!t)return;const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,n.positionWC,new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=Ql(n),g=f[0]-p,m=f[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:1,hDelta:g,pDelta:m}}flyIn(t,n,r,o="default"){var c;const s={position:t,rotation:n,duration:(r??1)*1e3},a=(c=this.viewer)==null?void 0:c.camera;return a&&nh(a,s,o)}flyTo(t,n,r="default"){var m;const{distance:o,heading:s,pitch:a,flyDuration:c,hDelta:h,pDelta:p}=t,f={position:n,viewDistance:o,rotation:[s,a,0],duration:c*1e3,hdelta:h,pdelta:p},g=(m=this.viewer)==null?void 0:m.camera;return g&&nh(g,f,r)}flyToBoundingSphere(t,n,r=1){var f;const o=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],s=l.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:c}=s,h={position:a,viewDistance:n??c,rotation:[0,-90,0],duration:r*1e3},p=(f=this.viewer)==null?void 0:f.camera;return p&&nh(p,h)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Wn(t),rotation:Ql(t)}}transformFlyParam(t,n){if("position"in n){const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,Tt(n.position),new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=n.rotation[0]-p,g=n.rotation[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:n.flyDuration??1,hDelta:f,pDelta:g}}else{const r=Tt(t);let o={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const s=new d.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=d.Math.PI_OVER_TWO;const c=d.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),h=d.Matrix4.multiplyByPointAsVector(c,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(h,n.distance,h),d.Cartesian3.subtract(r,h,r)}n.hDelta&&(o.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=d.Math.toRadians(n.pDelta));const a=vt(r);return a?{position:a,rotation:[d.Math.toDegrees(o.heading),d.Math.toDegrees(o.pitch),d.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(t,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(t,n,r),this._navigationMode.value="Walk"}changeToMap(){var t,n;(n=(t=this._viewerInstance)==null?void 0:t.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(t,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(t,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(t,n,r,o,s,a){var c,h;(h=(c=this._viewerInstance)==null?void 0:c.obj)==null||h.navigationManager.changeToLine(t,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(t){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToRotatePoint(t,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToFollow(t,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(t){return Promise.resolve(void 0)}async getVersion(){const t=globalThis.g_XE3CopyRights??{};return t.cesium={version:d.VERSION},t}async getHeightByLonLat(t,n,r){if(!this.viewer)return null;const o=d.Cartographic.fromDegrees(t,n,void 0,Di.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(t,n){const r=t.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(t,n){if(this.viewer)return await Ex(this.viewer.scene,t,n)}async lonLatAltToScreenPosition(t){if(!this.viewer||!this.isPointVisible(t))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Tt(t));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(t){this._notSupportEditingCount.value=t}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(t,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=t.components.main??t;o&&n!=null&&(o.editingID=`${r.callSource}_${l.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(t){const n=[],r=l.createGuid();for(let o=0;o<t.length;o++){const s=t[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(t){return this.sceneObjectsMap.get(t)}setCurrentDefaultAccessToken(){this.ionAccessToken=Di.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Di.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Di.latestDefaultAccessToken}positionsToLocalPositions(t,n){return an(t,n)}localPositionsToPositions(t,n){return Ns(t,n)}isPointVisible(t){if(!this.viewer)return!1;const n=t instanceof d.Cartesian3?t:Tt(t),r=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const t={...super.getESProperties()},n=Di.defaults;return{...t,more:[...t.more,new l.DivideProperty("通用"),new l.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",a9,s9,!0),new l.MethodProperty("获取Cesium官方TOKEN",()=>Di.getCesiumIonToken(),[],"获取官方token"),new l.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new l.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new l.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new l.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new l.DivideProperty("Viewer"),new l.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new l.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new l.BooleanProperty([this,"shadows"]),new l.DivideProperty("比例尺"),new l.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new l.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new l.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new l.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new l.DivideProperty("场景"),new l.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new l.DivideProperty("Globe"),new l.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new l.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new l.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new l.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new l.BooleanProperty([this,"sceneGlobeShowSkirts"]),new l.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new l.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new l.JsonProperty([this,"sceneGlobeClippingPlanes"]),new l.StringProperty([this,"sceneGlobeClippingPlanesId"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new l.DivideProperty("underground"),new l.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new l.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new l.DivideProperty("Translucency"),new l.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new l.DivideProperty("Sun"),new l.BooleanProperty([this,"sun"],"sun",n.sun,!0),new l.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new l.DivideProperty("Moon"),new l.BooleanProperty([this,"moon"],"moon",n.moon,!0),new l.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new l.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new l.DivideProperty("SkyBox"),new l.BooleanProperty([this,"sceneSkyBoxShow"]),new l.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new l.DivideProperty("Background"),new l.BooleanProperty([this,"xbsjUseBackground"]),new l.StringProperty([this,"xbsjBackgroundImageUri"]),new l.ColorProperty([this,"xbsjBackgroundColor"]),new l.DivideProperty("SkyAtmosphere"),new l.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new l.DivideProperty("Fog"),new l.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new l.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new l.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new l.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new l.DivideProperty("Sscc"),new l.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new l.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new l.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new l.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new l.DivideProperty("后处理"),new l.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new l.DivideProperty("环境遮蔽"),new l.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new l.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new l.DivideProperty("Bloom"),new l.BooleanProperty([this,"scenePpsBloomEnabled"]),new l.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new l.NumberProperty([this,"scenePpsBloomContrast"]),new l.NumberProperty([this,"scenePpsBloomBrightness"]),new l.NumberProperty([this,"scenePpsBloomDelta"]),new l.NumberProperty([this,"scenePpsBloomSigma"]),new l.NumberProperty([this,"scenePpsBloomStepSize"]),new l.DivideProperty("调试"),new l.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new l.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new l.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new l.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new l.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new l.DivideProperty("Inspector"),new l.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new l.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new l.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Di,"type",Di.register("ESCesiumViewer",Di)),y(Di,"getCesiumIonToken",l9),y(Di,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(Di,"latestDefaultAccessToken"),y(Di,"ObjectsToExcludeWrapper",zU),y(Di,"defaults",{...l.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(t=>180*t/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.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}),y(Di,"getHeightsScartchCarto",new d.Cartographic);let le=Di;(i=>{i.createDefaultProps=()=>({...l.ESViewer.createDefaultProps(),...o9()})})(le||(le={})),l.extendClassProps(le.prototype,le.createDefaultProps),R.copyright=void 0;try{const i="earthsdk3-cesium",e="3.10.1",t="2026-05-28T01:04:39.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="4c6c768074961ea20aab5957ae109d64d3f9e2e0",a=((Date.now()-1779930279e3)/36e5).toFixed(1),c=`%c🌏 ${i}%c ${e}.${o.slice(0,8)}.${t} (距今${a}个小时)
|
|
4057
4057
|
%c${r?r+`
|
|
4058
4058
|
`:""}当前网站正在使用${i},此软件版权归${n}所有
|
|
4059
|
-
`;R.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4059
|
+
`;R.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","4c6c768074961ea20aab5957ae109d64d3f9e2e0")},get info(){return c},get date(){return"2026-05-28T01:04:39.000Z"},get author(){return"suplyang"},get version(){return"3.10.1"},get name(){return"earthsdk3-cesium"},get commitId(){return"4c6c768074961ea20aab5957ae109d64d3f9e2e0"},print(){console.info(this.info,`
|
|
4060
4060
|
font-size: 18px;
|
|
4061
4061
|
font-weight: 1000;
|
|
4062
4062
|
line-height: 1;
|