earthsdk3-cesium 3.5.0-beta.21 → 3.5.0-beta.22
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.
|
@@ -3593,7 +3593,7 @@ ${Xx}
|
|
|
3593
3593
|
vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
|
|
3594
3594
|
out_FragColor = imageColor * u_color;
|
|
3595
3595
|
}
|
|
3596
|
-
`};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??dr.defaults.height,{textureSizeInMeters:A=dr.defaults.textureSizeInMeters}=this,{textureUri:h=dr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??dr.defaults.textureMoveSpeed,u_color:this.textureColor??dr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};L(dr,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let $o=dr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Ec=class Ec extends on{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new $o(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},l=(f,d)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[d*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,d=s[f];if(!d)return;r.textureUri=u+d.image,r.textureColor=f!=="gradientColor"?d.color:e.fillColor;const{textureMoveSpeed:p,textureSizeInMeters:g}=l(f,e.height);r.textureMoveSpeed=p,r.textureSizeInMeters=g};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Ec,"type",Ec.register("ESCesiumViewer",c.ESPolygonFence.type,Ec));let kg=Ec;const Pc=class Pc extends on{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Pc,"type",Pc.register("ESCesiumViewer",c.ESRectangle.type,Pc));let Qg=Pc;const lo=class lo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],lo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const m=_.Material.fromType(_.Material.ImageType);m.uniforms.image=r.value,m.uniforms.repeat=Ze(this.repeat??lo.defaults.repeat),a.value=m};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(m,b)=>{const x=new _.PolylineMaterialAppearance({material:b,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(m.length<2)return;E.push(new _.GeometryInstance({geometry:new _.GroundPolylineGeometry({positions:m,width:this.width??lo.defaults.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:_.ArcType[this.arcType??lo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??lo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new _.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const d=()=>{if(f(),!this.positions)return;const m=$t(this.positions);if(m.length<2||!a.value){h.radius=-1;return}_.BoundingSphere.fromPoints(m,h),A=u(m,a.value),A&&o.scene.primitives.add(A)},p=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&h.radius>0){const b=Ue(h.center);b&&Fe(o,b,h.radius*4,void 0,m)}})),d(),p();const g=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(g.disposableOn(()=>{d(),p()}));const v=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{p()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(lo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Xo=lo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Xo||(Xo={})),c.extendClassProps(Xo.prototype,Xo.createDefaultProps);const Bc=class Bc extends on{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Xo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Bc,"type",Bc.register("ESCesiumViewer",vf.type,Bc));let Vg=Bc;const Tc=class Tc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const g=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};g(),e.dispose(e.showChanged.disposableOn(g))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const g=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));g(),this.dispose(v.disposableOn(()=>g()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left="30px";const d=()=>{const g=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||g&&g>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const m=(135-y)/2;f.style.left=`${m}px`}}};d();const p=setInterval(()=>{d()},200);this.dispose(()=>clearInterval(p))}}}get customDiv(){return this._customDiv}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESScale.type,Tc));let Ng=Tc;const Ic=class Ic extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new at(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a,!0),!0):!1}};L(Ic,"type",Ic.register("ESCesiumViewer",gf.type,Ic));let Hg=Ic;const Fc=class Fc extends hf{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(Fc,"type",Fc.register("ESCesiumViewer",c.ESDynamicWater.type,Fc));let Gg=Fc;const Mc=class Mc extends Nn{constructor(e,i){super(e,i);L(this,"_scaleFactor",.6);L(this,"_urlData",this.dv(c.react(void 0)));L(this,"_dataSource",new _.CustomDataSource);L(this,"_clusterImages",{});L(this,"_clusterImageAttribute",{});L(this,"_clusterImageUrl","");if(!i.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var s;const r=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(r).then(l=>l.json()).then(l=>{this._clusterImageAttribute=l}).catch(l=>{console.error(l)});for(const l in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,l)){const u=this._clusterImageAttribute[l];this._clusterImages[l]=new _.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new _.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new _.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const a=this._dataSource;(s=i.viewer)==null||s.dataSources.add(a),this.d(()=>{var l;(l=i.viewer)==null||l.dataSources.remove(a)}),a.clustering.enabled=a.clustering.clusterBillboards=a.clustering.clusterLabels=a.clustering.clusterPoints=!0,this.d(c.track([a.clustering,"pixelRange"],[e,"pixelRange"])),this.d(c.track([a.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(c.track([a.clustering,"show"],[e,"show"]));{const l=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(c.ESSceneObject.context.getStrFromEnv(e.url.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}):typeof e.url=="object"?this.urlData=e.url:c.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(c.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};l(),this.d(e.urlChanged.don(l))}{const l=this.dv(c.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(l.don(()=>{this.updateEntityCluster(u)}))}{const l=(u,A)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(A==null?void 0:A.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(A==null?void 0:A.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,A)=>l(u,A)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var d,p,g,v,y,m,b,x,E,B,P,I;const{czmViewer:i,_dataSource:o,sceneObject:r}=e;if(!((d=i.viewer)==null?void 0:d.scene))return;const s=o.entities,l=new _.NearFarScalar(100,1,1e3,1),u=r.heightReference=="None"?_.HeightReference.NONE:r.heightReference=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.CLAMP_TO_TERRAIN;s.removeAll();const A=(p=this.czmViewer.viewer)==null?void 0:p.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(M=>{M.id.billboard.imageSubRegion=void 0}),A&&A())}),h=r.style??c.ESEntityCluster.defaults.style;this._clusterImages[((g=h.nonCluster)==null?void 0:g.mode)??"SquareH01"].heightReference=u,this._clusterImages[((v=h.nonCluster)==null?void 0:v.mode)??"SquareH01"].scaleByDistance=l;const f=[-this._clusterImageAttribute[((y=h.nonCluster)==null?void 0:y.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((m=h.nonCluster)==null?void 0:m.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((b=h.nonCluster)==null?void 0:b.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=h.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let M=0;M<this.urlData.features.length;M++){const F=this.urlData.features[M];if(F.geometry.type=="Point")this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates,f,u,l,(E=h.nonCluster)==null?void 0:E.mode,F.properties);else if(F.geometry.type=="MultiPoint")for(let S=0;S<F.geometry.coordinates.length;S++)this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates[S],f,u,l,(B=h.nonCluster)==null?void 0:B.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let M=0;M<this.urlData.geometries.length;M++){const F=this.urlData.geometries[M];if(F.type=="Point")this._addEntities(s,F.name??(M+1).toString(),F.coordinates,f,u,l,(P=h.nonCluster)==null?void 0:P.mode,F.properties);else if(F.type=="MultiPoint")for(let S=0;S<F.coordinates.length;S++)this._addEntities(s,F.name??(M+1).toString(),F.coordinates[S],f,u,l,(I=h.nonCluster)==null?void 0:I.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.type)}this.updateStyle(u,l)}async updateStyle(e,i){var l,u;const o=this,{_dataSource:r,sceneObject:a}=this,s=((l=a.style)==null?void 0:l.cluster)??c.ESEntityCluster.defaults.style.cluster;r.entities.values.forEach(A=>{_.Entity.prototype&&(A.ESSceneObjectID=a.id)}),r.clustering.clusterEvent.addEventListener(async function(A,h){if(h.label.ESSceneObjectID=h.billboard.ESSceneObjectID=h.point.ESSceneObjectID=a.id,h.label.show=!0,h.label.font="16px sans-serif",h.label.scale=1*o._scaleFactor,h.label.verticalOrigin=_.VerticalOrigin.BOTTOM,h.label.horizontalOrigin=_.HorizontalOrigin.CENTER,h.label.eyeOffset=new _.Cartesian3(0,0,-10),e&&(h.label.heightReference=e),i&&(h.label.scaleByDistance=i),h.billboard.id=h.label.id,h.billboard.show=!0,h.billboard.scale=1*o._scaleFactor,h.billboard.verticalOrigin=_.VerticalOrigin.BOTTOM,h.billboard.horizontalOrigin=_.HorizontalOrigin.CENTER,e&&(h.billboard.heightReference=e),i&&(h.billboard.scaleByDistance=i),s){const f=o.getClusterStyle(s,A.length).mode,d=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];h.label.pixelOffset=new _.Cartesian2(d[0]*o._scaleFactor,d[1]*o._scaleFactor),h.billboard.width=o._clusterImageAttribute[f].imageSize[0],h.billboard.height=o._clusterImageAttribute[f].imageSize[1],h.billboard.pixelOffset=new _.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),h.billboard.setImage(f,o._clusterImageUrl),h.billboard.setImageSubRegion(f,new _.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const A=()=>{const f=r.clustering.pixelRange;r.clustering.pixelRange=0,r.clustering.pixelRange=f};A();let h=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{A()});this.d(()=>{var f;h&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(h))})}}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}_addEntities(e,i,o,r,a,s,l,u){const A=_.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:A,label:{text:i,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,pixelOffset:new _.Cartesian2(r[0]*this._scaleFactor,r[1]*this._scaleFactor),heightReference:a,scaleByDistance:s,eyeOffset:new _.Cartesian3(0,0,-10)},billboard:this._clusterImages[l??"SquareH01"].clone(new _.BillboardGraphics),properties:u})}_getPositionLLH(e){const i=_.Cartographic.fromCartesian(e);return[_.Math.toDegrees(i.longitude),_.Math.toDegrees(i.latitude),i.height]}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESEntityCluster.type,Mc));let Wg=Mc;const Dc=class Dc extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",pf.type,Dc));let jg=Dc;const Rc=class Rc extends Un{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.updateBoundingSphere(l)}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(Rc,"type",Rc.register("ESCesiumViewer",c.ESGeoWater.type,Rc));let qg=Rc;const Uc=class Uc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const a=this.dv(c.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),s=()=>{r.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};s(),this.d(a.don(s))}}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Uc,"type",Uc.register("ESCesiumViewer",ff.type,Uc));let Kg=Uc;class sL extends c.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:m,customPrimitivePoints:b}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(...b),h.push(...m),u.push(...this.setIndexs(y))}const[f,d,p]=vn({originPosition:A[0]},A),g=this.setFaces(f);s.push(...g.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,d,s,u,l)}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],d=[s[0],s[1],s[2]-this._sceneObject.height/2],p=[a[0],a[1],a[2]+this._sceneObject.height/2],g=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,d]],y=[[u,h],[A,p],[A,h],[h,g]],m=[[f,d],[f,p],[d,g],[p,g]];return{outlinePionts:[...v,...y,...m],customPrimitivePoints:[u,l,A,h,d,f,p,g]}}setIndexs(n){const e=n*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const a=n.slice(8*r,8*(r+1));e.push(a)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=vn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,d=h[f],p=Math.sqrt((d[0]-u[0])*(d[0]-u[0])+(d[1]-u[1])*(d[1]-u[1]));return l.push(l[f]+p),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const Oc=class Oc extends on{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ht(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new at(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new sL(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
3596
|
+
`};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??dr.defaults.height,{textureSizeInMeters:A=dr.defaults.textureSizeInMeters}=this,{textureUri:h=dr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??dr.defaults.textureMoveSpeed,u_color:this.textureColor??dr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};L(dr,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let $o=dr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Ec=class Ec extends on{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new $o(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},l=(f,d)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[d*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,d=s[f];if(!d)return;r.textureUri=u+d.image,r.textureColor=f!=="gradientColor"?d.color:e.fillColor;const{textureMoveSpeed:p,textureSizeInMeters:g}=l(f,e.height);r.textureMoveSpeed=p,r.textureSizeInMeters=g};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Ec,"type",Ec.register("ESCesiumViewer",c.ESPolygonFence.type,Ec));let kg=Ec;const Pc=class Pc extends on{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Pc,"type",Pc.register("ESCesiumViewer",c.ESRectangle.type,Pc));let Qg=Pc;const lo=class lo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],lo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const m=_.Material.fromType(_.Material.ImageType);m.uniforms.image=r.value,m.uniforms.repeat=Ze(this.repeat??lo.defaults.repeat),a.value=m};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(m,b)=>{const x=new _.PolylineMaterialAppearance({material:b,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(m.length<2)return;E.push(new _.GeometryInstance({geometry:new _.GroundPolylineGeometry({positions:m,width:this.width??lo.defaults.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:_.ArcType[this.arcType??lo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??lo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new _.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const d=()=>{if(f(),!this.positions)return;const m=$t(this.positions);if(m.length<2||!a.value){h.radius=-1;return}_.BoundingSphere.fromPoints(m,h),A=u(m,a.value),A&&o.scene.primitives.add(A)},p=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&h.radius>0){const b=Ue(h.center);b&&Fe(o,b,h.radius*4,void 0,m)}})),d(),p();const g=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(g.disposableOn(()=>{d(),p()}));const v=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{p()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(lo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Xo=lo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Xo||(Xo={})),c.extendClassProps(Xo.prototype,Xo.createDefaultProps);const Bc=class Bc extends on{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Xo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Bc,"type",Bc.register("ESCesiumViewer",vf.type,Bc));let Vg=Bc;const Tc=class Tc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const g=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};g(),e.dispose(e.showChanged.disposableOn(g))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const g=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));g(),this.dispose(v.disposableOn(()=>g()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left="30px";const d=()=>{const g=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||g&&g>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const m=(135-y)/2;f.style.left=`${m}px`}}};d();const p=setInterval(()=>{d()},200);this.dispose(()=>clearInterval(p))}}}get customDiv(){return this._customDiv}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESScale.type,Tc));let Ng=Tc;const Ic=class Ic extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new at(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a,!0),!0):!1}};L(Ic,"type",Ic.register("ESCesiumViewer",gf.type,Ic));let Hg=Ic;const Fc=class Fc extends hf{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(Fc,"type",Fc.register("ESCesiumViewer",c.ESDynamicWater.type,Fc));let Gg=Fc;const Mc=class Mc extends Nn{constructor(e,i){super(e,i);L(this,"_scaleFactor",.6);L(this,"_urlData",this.dv(c.react(void 0)));L(this,"_dataSource",new _.CustomDataSource);L(this,"_clusterImages",{});L(this,"_clusterImageAttribute",{});L(this,"_clusterImageUrl","");if(!i.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var s;const r=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(r).then(l=>l.json()).then(l=>{this._clusterImageAttribute=l}).catch(l=>{console.error(l)});for(const l in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,l)){const u=this._clusterImageAttribute[l];this._clusterImages[l]=new _.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new _.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new _.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const a=this._dataSource;(s=i.viewer)==null||s.dataSources.add(a),this.d(()=>{var l;(l=i.viewer)==null||l.dataSources.remove(a)}),a.clustering.enabled=a.clustering.clusterBillboards=a.clustering.clusterLabels=a.clustering.clusterPoints=!0,this.d(c.track([a.clustering,"pixelRange"],[e,"pixelRange"])),this.d(c.track([a.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(c.track([a.clustering,"show"],[e,"show"]));{const l=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(c.ESSceneObject.context.getStrFromEnv(e.url.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}):typeof e.url=="object"?this.urlData=e.url:c.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(c.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};l(),this.d(e.urlChanged.don(l))}{const l=this.dv(c.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(l.don(()=>{this.updateEntityCluster(u)}))}{const l=(u,A)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(A==null?void 0:A.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(A==null?void 0:A.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,A)=>l(u,A)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var d,p,g,v,y,m,b,x,E,B,P,I;const{czmViewer:i,_dataSource:o,sceneObject:r}=e;if(!((d=i.viewer)==null?void 0:d.scene))return;const s=o.entities,l=new _.NearFarScalar(100,1,1e3,1),u=r.heightReference=="None"?_.HeightReference.NONE:r.heightReference=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.CLAMP_TO_TERRAIN;s.removeAll();const A=(p=this.czmViewer.viewer)==null?void 0:p.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(M=>{M.id.billboard.imageSubRegion=void 0}),A&&A())}),h=r.style??c.ESEntityCluster.defaults.style;this._clusterImages[((g=h.nonCluster)==null?void 0:g.mode)??"SquareH01"].heightReference=u,this._clusterImages[((v=h.nonCluster)==null?void 0:v.mode)??"SquareH01"].scaleByDistance=l;const f=[-this._clusterImageAttribute[((y=h.nonCluster)==null?void 0:y.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((m=h.nonCluster)==null?void 0:m.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((b=h.nonCluster)==null?void 0:b.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=h.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let M=0;M<this.urlData.features.length;M++){const F=this.urlData.features[M];if(F.geometry.type=="Point")this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates,f,u,l,(E=h.nonCluster)==null?void 0:E.mode,F.properties);else if(F.geometry.type=="MultiPoint")for(let S=0;S<F.geometry.coordinates.length;S++)this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates[S],f,u,l,(B=h.nonCluster)==null?void 0:B.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let M=0;M<this.urlData.geometries.length;M++){const F=this.urlData.geometries[M];if(F.type=="Point")this._addEntities(s,F.name??(M+1).toString(),F.coordinates,f,u,l,(P=h.nonCluster)==null?void 0:P.mode,F.properties);else if(F.type=="MultiPoint")for(let S=0;S<F.coordinates.length;S++)this._addEntities(s,F.name??(M+1).toString(),F.coordinates[S],f,u,l,(I=h.nonCluster)==null?void 0:I.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.type)}this.updateStyle(u,l)}async updateStyle(e,i){var l,u;const o=this,{_dataSource:r,sceneObject:a}=this,s=((l=a.style)==null?void 0:l.cluster)??c.ESEntityCluster.defaults.style.cluster;r.entities.values.forEach(A=>{_.Entity.prototype&&(A.ESSceneObjectID=a.id)}),r.clustering.clusterEvent.addEventListener(async function(A,h){if(h.label.ESSceneObjectID=h.billboard.ESSceneObjectID=h.point.ESSceneObjectID=a.id,h.label.show=!0,h.label.font="16px sans-serif",h.label.scale=1*o._scaleFactor,h.label.verticalOrigin=_.VerticalOrigin.BOTTOM,h.label.horizontalOrigin=_.HorizontalOrigin.CENTER,h.label.eyeOffset=new _.Cartesian3(0,0,-10),e&&(h.label.heightReference=e),i&&(h.label.scaleByDistance=i),h.billboard.id=h.label.id,h.billboard.show=!0,h.billboard.scale=1*o._scaleFactor,h.billboard.verticalOrigin=_.VerticalOrigin.BOTTOM,h.billboard.horizontalOrigin=_.HorizontalOrigin.CENTER,e&&(h.billboard.heightReference=e),i&&(h.billboard.scaleByDistance=i),s){const f=o.getClusterStyle(s,A.length).mode,d=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];h.label.pixelOffset=new _.Cartesian2(d[0]*o._scaleFactor,d[1]*o._scaleFactor),h.billboard.width=o._clusterImageAttribute[f].imageSize[0],h.billboard.height=o._clusterImageAttribute[f].imageSize[1],h.billboard.pixelOffset=new _.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),h.billboard.setImage(f,o._clusterImageUrl),h.billboard.setImageSubRegion(f,new _.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const A=()=>{const f=r.clustering.pixelRange;r.clustering.pixelRange=0,r.clustering.pixelRange=f};A();let h=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{A()});this.d(()=>{var f;h&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(h))})}}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}_addEntities(e,i,o,r,a,s,l,u){const A=_.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:A,label:{text:i,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,pixelOffset:new _.Cartesian2(r[0]*this._scaleFactor,r[1]*this._scaleFactor),heightReference:a,scaleByDistance:s,eyeOffset:new _.Cartesian3(0,0,-10)},billboard:this._clusterImages[l??"SquareH01"].clone(new _.BillboardGraphics),properties:u})}_getPositionLLH(e){const i=_.Cartographic.fromCartesian(e);return[_.Math.toDegrees(i.longitude),_.Math.toDegrees(i.latitude),i.height]}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESEntityCluster.type,Mc));let Wg=Mc;const Dc=class Dc extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",pf.type,Dc));let jg=Dc;const Rc=class Rc extends Un{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.updateBoundingSphere(l)}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(Rc,"type",Rc.register("ESCesiumViewer",c.ESGeoWater.type,Rc));let qg=Rc;const Uc=class Uc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const a=this.dv(c.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),s=()=>{r.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};s(),this.d(a.don(s))}}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Uc,"type",Uc.register("ESCesiumViewer",ff.type,Uc));let Kg=Uc;class sL extends c.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:m,customPrimitivePoints:b}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(...b),h.push(...m),u.push(...this.setIndexs(y))}const[f,d,p]=vn({originPosition:A[0]},A),g=this.setFaces(f);s.push(...g.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),this.updateCustomPrimitive(r,d,s,u,l),o.computeBoundingBox()}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],d=[s[0],s[1],s[2]-this._sceneObject.height/2],p=[a[0],a[1],a[2]+this._sceneObject.height/2],g=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,d]],y=[[u,h],[A,p],[A,h],[h,g]],m=[[f,d],[f,p],[d,g],[p,g]];return{outlinePionts:[...v,...y,...m],customPrimitivePoints:[u,l,A,h,d,f,p,g]}}setIndexs(n){const e=n*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const a=n.slice(8*r,8*(r+1));e.push(a)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=vn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,d=h[f],p=Math.sqrt((d[0]-u[0])*(d[0]-u[0])+(d[1]-u[1])*(d[1]-u[1]));return l.push(l[f]+p),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const Oc=class Oc extends on{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ht(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new at(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new sL(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
3597
3597
|
in vec2 v_st;
|
|
3598
3598
|
void main()
|
|
3599
3599
|
{
|
|
@@ -3632,7 +3632,7 @@ ${Xx}
|
|
|
3632
3632
|
{
|
|
3633
3633
|
v_st = a_st;
|
|
3634
3634
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
3635
|
-
}`,i.castShadows=!0,i.receiveShadows=!0
|
|
3635
|
+
}`,i.castShadows=!0,i.receiveShadows=!0;{const o=()=>{i.show=e.show&&e.filled};o();const r=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(r.don(o))}return i}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.line.positions?(Me(r,o,i,this.line.positions,e),!0):!1:!1}};L(Oc,"type",Oc.register("ESCesiumViewer",c.ESPipeFence.type,Oc));let Zg=Oc;const Lc=class Lc extends fa{constructor(e,i){super(e,i);L(this,"czmCustomPrimitive");L(this,"czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(new at(i,e.id)),a=this.ad(new ht(i,e.id));this.czmCustomPrimitive=r,this.czmTexture=a,this.d(c.track([r,"allowPicking"],[e,"allowPicking"]));const s=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new c.ObjResettingWithEvent(s,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new aL(e,this);r.attributes=void 0}))}};L(Lc,"type",Lc.register("ESCesiumViewer",c.ESPipeline.type,Lc));let $g=Lc;class aL extends c.Destroyable{constructor(n,e){super(),this._sceneObject=n,this._czmESPipeline=e;const i=this._sceneObject,o=this._czmESPipeline,r=o.czmCustomPrimitive,a=o.czmTexture;if(!r||!a)return;{const u=()=>{r.show=i.show&&i.filled};u();const A=this.dv(c.createNextAnimateFrameEvent(i.showChanged,i.filledChanged));this.d(A.don(u))}const s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{i.materialImage.url!=""?a.uri=typeof i.materialImage.url=="string"?i.materialImage.url:i.materialImage.url.url:i.materialMode==="multipleArrows"||i.materialMode==="blue"?a.uri=l:a.uri=s;const h=c.getDistancesFromPositions(i.points,"GEODESIC"),d=h[h.length-1]/i.materialImage.uDis;r.uniformMap={u_image:{type:"texture",id:a.id},u_stScale:[d,2*Math.PI*i.radius/i.materialImage.vDis],u_speed:[i.speed/i.materialImage.uDis,0],u_color:i.fillColor}};u();const A=this.dv(c.createNextAnimateFrameEvent(i.speedChanged,i.materialImageChanged,i.materialModeChanged,i.fillColorChanged));this.d(A.don(u))}(()=>{if(!i.points||i.points.length>=2&&c.equalsN3(i.points[i.points.length-2],i.points[i.points.length-1]))return;const{position:A,modelMatrix:h,indexes:f,uvCoordinates:d}=this.coordinateTransformation(i.points,i.sides);r.modelMatrix=h,r.attributes={position:{typedArray:new Float32Array(A),componentsPerAttribute:3},st:{typedArray:new Float32Array([...d,...d.reverse()]),componentsPerAttribute:2}},r.indexTypedArray=new Uint16Array([...f,...f.reverse()]),r.fragmentShaderSource=`
|
|
3636
3636
|
in vec2 v_st;
|
|
3637
3637
|
uniform sampler2D u_image;
|
|
3638
3638
|
uniform vec4 u_color;
|
|
@@ -4142,10 +4142,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4142
4142
|
`;function UH(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4143
4143
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4144
4144
|
gitee地址:${t}
|
|
4145
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new mV(this)),this.ad(new gV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bV(this)})),this._viewerLegend=this.dv(new TH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vN(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Qn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=_.Cartesian3.fromDegrees(...e),r=_.Transforms.eastNorthUpToFixedFrame(o),a=_.Matrix4.inverse(r,new _.Matrix4),s=_.Matrix4.multiplyByPoint(a,i.positionWC,new _.Cartesian3),l=_.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=_.Math.toDegrees(u);let A=_.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-_.Math.PI:_.Math.PI),A=_.Math.toDegrees(A);const h=gs(i),f=h[0]-A,d=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:d}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&rl(s,a,r)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,Nt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return vn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",RH,DH,!0),new c.FunctionProperty([],()=>Nt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",UH),L(Nt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",wV),L(Nt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(Nt,"getHeightsScartchCarto",new _.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...MH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.21",e="2025-10-24T06:36:57.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="af1fcfa59ce080208fcc4e95f0924ca6a4ecb503",s=((Date.now()-1761287817e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4145
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new mV(this)),this.ad(new gV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bV(this)})),this._viewerLegend=this.dv(new TH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vN(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Qn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=_.Cartesian3.fromDegrees(...e),r=_.Transforms.eastNorthUpToFixedFrame(o),a=_.Matrix4.inverse(r,new _.Matrix4),s=_.Matrix4.multiplyByPoint(a,i.positionWC,new _.Cartesian3),l=_.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=_.Math.toDegrees(u);let A=_.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-_.Math.PI:_.Math.PI),A=_.Math.toDegrees(A);const h=gs(i),f=h[0]-A,d=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:d}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&rl(s,a,r)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,Nt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return vn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",RH,DH,!0),new c.FunctionProperty([],()=>Nt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",UH),L(Nt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",wV),L(Nt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(Nt,"getHeightsScartchCarto",new _.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...MH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.22",e="2025-10-29T07:51:42.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="5897fe5e814b73613d910e2f3ea44f872cdc61d4",s=((Date.now()-1761724302e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4146
4146
|
%c${o?o+`
|
|
4147
4147
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4148
|
-
`;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4148
|
+
`;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","5897fe5e814b73613d910e2f3ea44f872cdc61d4")},get info(){return l},get date(){return"2025-10-29T07:51:42.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.22"},get name(){return"earthsdk3-cesium"},get commitId(){return"5897fe5e814b73613d910e2f3ea44f872cdc61d4"},print(){console.info(this.info,`
|
|
4149
4149
|
font-size: 18px;
|
|
4150
4150
|
font-weight: 1000;
|
|
4151
4151
|
line-height: 1;
|
package/dist/earthsdk3-cesium.js
CHANGED
|
@@ -33014,7 +33014,7 @@ class K2 extends L {
|
|
|
33014
33014
|
const [p, f, g] = ui({ originPosition: d[0] }, d), v = this.setFaces(p);
|
|
33015
33015
|
a.push(...v.flat());
|
|
33016
33016
|
const _ = this.setTextureCoordinates(o, s);
|
|
33017
|
-
l.push(..._.flat()),
|
|
33017
|
+
l.push(..._.flat()), this.updateCustomPrimitive(n, f, a, c, l), s.computeBoundingBox();
|
|
33018
33018
|
}
|
|
33019
33019
|
// 中心点坐标分成四个点
|
|
33020
33020
|
divideFourPoints(i, e) {
|
|
@@ -33286,7 +33286,7 @@ const Bl = class Bl extends Kt {
|
|
|
33286
33286
|
{
|
|
33287
33287
|
v_st = a_st;
|
|
33288
33288
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
33289
|
-
}`, o.castShadows = !0, o.receiveShadows = !0
|
|
33289
|
+
}`, o.castShadows = !0, o.receiveShadows = !0;
|
|
33290
33290
|
{
|
|
33291
33291
|
const s = () => {
|
|
33292
33292
|
o.show = e.show && e.filled;
|
|
@@ -49904,7 +49904,7 @@ let We = wt;
|
|
|
49904
49904
|
ae(We.prototype, We.createDefaultProps);
|
|
49905
49905
|
let rp;
|
|
49906
49906
|
try {
|
|
49907
|
-
const t = "earthsdk3-cesium", i = "3.5.0-beta.
|
|
49907
|
+
const t = "earthsdk3-cesium", i = "3.5.0-beta.22", e = "2025-10-29T07:51:42.000Z", o = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", n = "5897fe5e814b73613d910e2f3ea44f872cdc61d4", a = ((Date.now() - 1761724302e3) / 36e5).toFixed(1), l = `%c🌏 ${t}%c ${i}.${n.slice(0, 8)}.${e} (距今${a}个小时)
|
|
49908
49908
|
%c${s ? s + `
|
|
49909
49909
|
` : ""}当前网站正在使用${t},此软件版权归${o}所有
|
|
49910
49910
|
`;
|
|
@@ -49918,7 +49918,7 @@ try {
|
|
|
49918
49918
|
},
|
|
49919
49919
|
// @ts-ignore
|
|
49920
49920
|
get gituri() {
|
|
49921
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
49921
|
+
return GITURI_ && GITURI_.replace("${commitId}", "5897fe5e814b73613d910e2f3ea44f872cdc61d4");
|
|
49922
49922
|
},
|
|
49923
49923
|
// @ts-ignore
|
|
49924
49924
|
get info() {
|
|
@@ -49926,7 +49926,7 @@ try {
|
|
|
49926
49926
|
},
|
|
49927
49927
|
// @ts-ignore
|
|
49928
49928
|
get date() {
|
|
49929
|
-
return "2025-10-
|
|
49929
|
+
return "2025-10-29T07:51:42.000Z";
|
|
49930
49930
|
},
|
|
49931
49931
|
// @ts-ignore
|
|
49932
49932
|
get author() {
|
|
@@ -49934,7 +49934,7 @@ try {
|
|
|
49934
49934
|
},
|
|
49935
49935
|
// @ts-ignore
|
|
49936
49936
|
get version() {
|
|
49937
|
-
return "3.5.0-beta.
|
|
49937
|
+
return "3.5.0-beta.22";
|
|
49938
49938
|
},
|
|
49939
49939
|
// @ts-ignore
|
|
49940
49940
|
get name() {
|
|
@@ -49942,7 +49942,7 @@ try {
|
|
|
49942
49942
|
},
|
|
49943
49943
|
// @ts-ignore
|
|
49944
49944
|
get commitId() {
|
|
49945
|
-
return "
|
|
49945
|
+
return "5897fe5e814b73613d910e2f3ea44f872cdc61d4";
|
|
49946
49946
|
},
|
|
49947
49947
|
print() {
|
|
49948
49948
|
console.info(
|
|
@@ -1742,7 +1742,7 @@ ${$y}
|
|
|
1742
1742
|
vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
|
|
1743
1743
|
out_FragColor = imageColor * u_color;
|
|
1744
1744
|
}
|
|
1745
|
-
`};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};v(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Do=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Cl=class Cl extends vt{constructor(e,n){super(e,n);v(this,"_czmPolygonFence");v(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Do(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:m,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=m,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};v(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Bp=Cl;const _l=class _l extends vt{constructor(e,n){super(e,n);v(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};v(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Vp=_l;const Zn=class Zn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Zn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const C=h.Material.fromType(h.Material.ImageType);C.uniforms.image=s.value,C.uniforms.repeat=_e(this.repeat??Zn.defaults.repeat),r.value=C};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(C,S)=>{const x=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const A=[];if(C.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:C,width:this.width??Zn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Zn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??Zn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const C=ut(this.positions);if(C.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(C,p),d=u(C,r.value),d&&o.scene.primitives.add(d)},m=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(C=>{if(e.actived&&p.radius>0){const S=re(p.center);S&&ne(o,S,p.radius*4,void 0,C)}})),g(),m();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),m()}));const _=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(_.disposableOn(()=>{m()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Zn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Ro=Zn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Pl=class Pl extends vt{constructor(e,n){super(e,n);v(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Ro(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Up=Pl;const bl=class bl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},_=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(_.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="125px",p.style.display="inline-block",p.style.textAlign="center",p.style.fontSize="14px",p.style.fontWeight="lighter",p.style.lineHeight="30px",p.style.color="#fff",p.innerHTML="1000km";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const _=n.viewerLegend.legend.computedLengthInStr;_&&(p.innerHTML=_);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const C=(135-P)/2;f.style.left=`${C}px`}}};g();const m=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(m))}}}get customDiv(){return this._customDiv}};v(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Wp=bl;const Sl=class Sl extends fe{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new De(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r,!0),!0):!1}};v(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Gp=Sl;const El=class El extends dh{constructor(e,n){super(e,n);v(this,"czmGeoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.czmGeoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};v(El,"type",El.register("ESCesiumViewer",a.ESDynamicWater.type,El));let Hp=El;const xl=class xl extends Jt{constructor(e,n){super(e,n);v(this,"_scaleFactor",.6);v(this,"_urlData",this.dv(a.react(void 0)));v(this,"_dataSource",new h.CustomDataSource);v(this,"_clusterImages",{});v(this,"_clusterImageAttribute",{});v(this,"_clusterImageUrl","");if(!n.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var l;const s=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(s).then(c=>c.json()).then(c=>{this._clusterImageAttribute=c}).catch(c=>{console.error(c)});for(const c in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,c)){const u=this._clusterImageAttribute[c];this._clusterImages[c]=new h.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new h.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new h.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const r=this._dataSource;(l=n.viewer)==null||l.dataSources.add(r),this.d(()=>{var c;(c=n.viewer)==null||c.dataSources.remove(r)}),r.clustering.enabled=r.clustering.clusterBillboards=r.clustering.clusterLabels=r.clustering.clusterPoints=!0,this.d(a.track([r.clustering,"pixelRange"],[e,"pixelRange"])),this.d(a.track([r.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(a.track([r.clustering,"show"],[e,"show"]));{const c=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(a.ESSceneObject.context.getStrFromEnv(e.url.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}):typeof e.url=="object"?this.urlData=e.url:a.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(a.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};c(),this.d(e.urlChanged.don(c))}{const c=this.dv(a.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(c.don(()=>{this.updateEntityCluster(u)}))}{const c=(u,d)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(d==null?void 0:d.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(d==null?void 0:d.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,d)=>c(u,d)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var g,m,y,_,P,C,S,x,A,R,O,N;const{czmViewer:n,_dataSource:o,sceneObject:s}=e;if(!((g=n.viewer)==null?void 0:g.scene))return;const l=o.entities,c=new h.NearFarScalar(100,1,1e3,1),u=s.heightReference=="None"?h.HeightReference.NONE:s.heightReference=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_TERRAIN;l.removeAll();const d=(m=this.czmViewer.viewer)==null?void 0:m.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(V=>{V.id.billboard.imageSubRegion=void 0}),d&&d())}),p=s.style??a.ESEntityCluster.defaults.style;this._clusterImages[((y=p.nonCluster)==null?void 0:y.mode)??"SquareH01"].heightReference=u,this._clusterImages[((_=p.nonCluster)==null?void 0:_.mode)??"SquareH01"].scaleByDistance=c;const f=[-this._clusterImageAttribute[((P=p.nonCluster)==null?void 0:P.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((C=p.nonCluster)==null?void 0:C.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((S=p.nonCluster)==null?void 0:S.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=p.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let V=0;V<this.urlData.features.length;V++){const U=this.urlData.features[V];if(U.geometry.type=="Point")this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates,f,u,c,(A=p.nonCluster)==null?void 0:A.mode,U.properties);else if(U.geometry.type=="MultiPoint")for(let z=0;z<U.geometry.coordinates.length;z++)this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates[z],f,u,c,(R=p.nonCluster)==null?void 0:R.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let V=0;V<this.urlData.geometries.length;V++){const U=this.urlData.geometries[V];if(U.type=="Point")this._addEntities(l,U.name??(V+1).toString(),U.coordinates,f,u,c,(O=p.nonCluster)==null?void 0:O.mode,U.properties);else if(U.type=="MultiPoint")for(let z=0;z<U.coordinates.length;z++)this._addEntities(l,U.name??(V+1).toString(),U.coordinates[z],f,u,c,(N=p.nonCluster)==null?void 0:N.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.type)}this.updateStyle(u,c)}async updateStyle(e,n){var c,u;const o=this,{_dataSource:s,sceneObject:r}=this,l=((c=r.style)==null?void 0:c.cluster)??a.ESEntityCluster.defaults.style.cluster;s.entities.values.forEach(d=>{h.Entity.prototype&&(d.ESSceneObjectID=r.id)}),s.clustering.clusterEvent.addEventListener(async function(d,p){if(p.label.ESSceneObjectID=p.billboard.ESSceneObjectID=p.point.ESSceneObjectID=r.id,p.label.show=!0,p.label.font="16px sans-serif",p.label.scale=1*o._scaleFactor,p.label.verticalOrigin=h.VerticalOrigin.BOTTOM,p.label.horizontalOrigin=h.HorizontalOrigin.CENTER,p.label.eyeOffset=new h.Cartesian3(0,0,-10),e&&(p.label.heightReference=e),n&&(p.label.scaleByDistance=n),p.billboard.id=p.label.id,p.billboard.show=!0,p.billboard.scale=1*o._scaleFactor,p.billboard.verticalOrigin=h.VerticalOrigin.BOTTOM,p.billboard.horizontalOrigin=h.HorizontalOrigin.CENTER,e&&(p.billboard.heightReference=e),n&&(p.billboard.scaleByDistance=n),l){const f=o.getClusterStyle(l,d.length).mode,g=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];p.label.pixelOffset=new h.Cartesian2(g[0]*o._scaleFactor,g[1]*o._scaleFactor),p.billboard.width=o._clusterImageAttribute[f].imageSize[0],p.billboard.height=o._clusterImageAttribute[f].imageSize[1],p.billboard.pixelOffset=new h.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),p.billboard.setImage(f,o._clusterImageUrl),p.billboard.setImageSubRegion(f,new h.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const d=()=>{const f=s.clustering.pixelRange;s.clustering.pixelRange=0,s.clustering.pixelRange=f};d();let p=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{d()});this.d(()=>{var f;p&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(p))})}}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}_addEntities(e,n,o,s,r,l,c,u){const d=h.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:d,label:{text:n,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,pixelOffset:new h.Cartesian2(s[0]*this._scaleFactor,s[1]*this._scaleFactor),heightReference:r,scaleByDistance:l,eyeOffset:new h.Cartesian3(0,0,-10)},billboard:this._clusterImages[c??"SquareH01"].clone(new h.BillboardGraphics),properties:u})}_getPositionLLH(e){const n=h.Cartographic.fromCartesian(e);return[h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude),n.height]}};v(xl,"type",xl.register("ESCesiumViewer",a.ESEntityCluster.type,xl));let $p=xl;const Al=class Al extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};v(Al,"type",Al.register("ESCesiumViewer",gh.type,Al));let qp=Al;const Tl=class Tl extends qt{constructor(e,n){super(e,n);v(this,"geoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.geoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};v(Tl,"type",Tl.register("ESCesiumViewer",a.ESGeoWater.type,Tl));let Xp=Tl;const Ml=class Ml extends Jt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const r=this.dv(a.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),l=()=>{s.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};l(),this.d(r.don(l))}}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Ml,"type",Ml.register("ESCesiumViewer",fh.type,Ml));let Yp=Ml;class xT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:C,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(...C),u.push(...this.setIndexs(P))}const[f,g,m]=It({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const _=this.setTextureCoordinates(n,o);c.push(..._.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(s,g,l,u,c)}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],m=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],_=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,m],[d,p],[p,y]],C=[[f,g],[f,m],[g,y],[m,y]];return{outlinePionts:[..._,...P,...C],customPrimitivePoints:[u,c,d,p,g,f,m,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=It({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],m=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+m),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Il=class Il extends vt{constructor(e,n){super(e,n);v(this,"_line",this.dv(new be(this.czmViewer,this.sceneObject.id)));v(this,"_czmTexture",this.ad(new ze(this.czmViewer,this.sceneObject.id)));v(this,"_czmCustomPrimitive",this.dv(new De(this.czmViewer,this.sceneObject.id)));v(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new xT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
1745
|
+
`};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};v(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Do=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Cl=class Cl extends vt{constructor(e,n){super(e,n);v(this,"_czmPolygonFence");v(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Do(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:m,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=m,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};v(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Bp=Cl;const _l=class _l extends vt{constructor(e,n){super(e,n);v(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};v(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Vp=_l;const Zn=class Zn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Zn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const C=h.Material.fromType(h.Material.ImageType);C.uniforms.image=s.value,C.uniforms.repeat=_e(this.repeat??Zn.defaults.repeat),r.value=C};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(C,S)=>{const x=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const A=[];if(C.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:C,width:this.width??Zn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Zn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??Zn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const C=ut(this.positions);if(C.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(C,p),d=u(C,r.value),d&&o.scene.primitives.add(d)},m=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(C=>{if(e.actived&&p.radius>0){const S=re(p.center);S&&ne(o,S,p.radius*4,void 0,C)}})),g(),m();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),m()}));const _=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(_.disposableOn(()=>{m()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Zn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Ro=Zn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Pl=class Pl extends vt{constructor(e,n){super(e,n);v(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Ro(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Up=Pl;const bl=class bl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},_=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(_.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="125px",p.style.display="inline-block",p.style.textAlign="center",p.style.fontSize="14px",p.style.fontWeight="lighter",p.style.lineHeight="30px",p.style.color="#fff",p.innerHTML="1000km";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const _=n.viewerLegend.legend.computedLengthInStr;_&&(p.innerHTML=_);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const C=(135-P)/2;f.style.left=`${C}px`}}};g();const m=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(m))}}}get customDiv(){return this._customDiv}};v(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Wp=bl;const Sl=class Sl extends fe{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new De(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r,!0),!0):!1}};v(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Gp=Sl;const El=class El extends dh{constructor(e,n){super(e,n);v(this,"czmGeoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.czmGeoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};v(El,"type",El.register("ESCesiumViewer",a.ESDynamicWater.type,El));let Hp=El;const xl=class xl extends Jt{constructor(e,n){super(e,n);v(this,"_scaleFactor",.6);v(this,"_urlData",this.dv(a.react(void 0)));v(this,"_dataSource",new h.CustomDataSource);v(this,"_clusterImages",{});v(this,"_clusterImageAttribute",{});v(this,"_clusterImageUrl","");if(!n.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var l;const s=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(s).then(c=>c.json()).then(c=>{this._clusterImageAttribute=c}).catch(c=>{console.error(c)});for(const c in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,c)){const u=this._clusterImageAttribute[c];this._clusterImages[c]=new h.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new h.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new h.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const r=this._dataSource;(l=n.viewer)==null||l.dataSources.add(r),this.d(()=>{var c;(c=n.viewer)==null||c.dataSources.remove(r)}),r.clustering.enabled=r.clustering.clusterBillboards=r.clustering.clusterLabels=r.clustering.clusterPoints=!0,this.d(a.track([r.clustering,"pixelRange"],[e,"pixelRange"])),this.d(a.track([r.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(a.track([r.clustering,"show"],[e,"show"]));{const c=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(a.ESSceneObject.context.getStrFromEnv(e.url.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}):typeof e.url=="object"?this.urlData=e.url:a.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(a.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};c(),this.d(e.urlChanged.don(c))}{const c=this.dv(a.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(c.don(()=>{this.updateEntityCluster(u)}))}{const c=(u,d)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(d==null?void 0:d.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(d==null?void 0:d.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,d)=>c(u,d)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var g,m,y,_,P,C,S,x,A,R,O,N;const{czmViewer:n,_dataSource:o,sceneObject:s}=e;if(!((g=n.viewer)==null?void 0:g.scene))return;const l=o.entities,c=new h.NearFarScalar(100,1,1e3,1),u=s.heightReference=="None"?h.HeightReference.NONE:s.heightReference=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_TERRAIN;l.removeAll();const d=(m=this.czmViewer.viewer)==null?void 0:m.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(V=>{V.id.billboard.imageSubRegion=void 0}),d&&d())}),p=s.style??a.ESEntityCluster.defaults.style;this._clusterImages[((y=p.nonCluster)==null?void 0:y.mode)??"SquareH01"].heightReference=u,this._clusterImages[((_=p.nonCluster)==null?void 0:_.mode)??"SquareH01"].scaleByDistance=c;const f=[-this._clusterImageAttribute[((P=p.nonCluster)==null?void 0:P.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((C=p.nonCluster)==null?void 0:C.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((S=p.nonCluster)==null?void 0:S.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=p.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let V=0;V<this.urlData.features.length;V++){const U=this.urlData.features[V];if(U.geometry.type=="Point")this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates,f,u,c,(A=p.nonCluster)==null?void 0:A.mode,U.properties);else if(U.geometry.type=="MultiPoint")for(let z=0;z<U.geometry.coordinates.length;z++)this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates[z],f,u,c,(R=p.nonCluster)==null?void 0:R.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let V=0;V<this.urlData.geometries.length;V++){const U=this.urlData.geometries[V];if(U.type=="Point")this._addEntities(l,U.name??(V+1).toString(),U.coordinates,f,u,c,(O=p.nonCluster)==null?void 0:O.mode,U.properties);else if(U.type=="MultiPoint")for(let z=0;z<U.coordinates.length;z++)this._addEntities(l,U.name??(V+1).toString(),U.coordinates[z],f,u,c,(N=p.nonCluster)==null?void 0:N.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.type)}this.updateStyle(u,c)}async updateStyle(e,n){var c,u;const o=this,{_dataSource:s,sceneObject:r}=this,l=((c=r.style)==null?void 0:c.cluster)??a.ESEntityCluster.defaults.style.cluster;s.entities.values.forEach(d=>{h.Entity.prototype&&(d.ESSceneObjectID=r.id)}),s.clustering.clusterEvent.addEventListener(async function(d,p){if(p.label.ESSceneObjectID=p.billboard.ESSceneObjectID=p.point.ESSceneObjectID=r.id,p.label.show=!0,p.label.font="16px sans-serif",p.label.scale=1*o._scaleFactor,p.label.verticalOrigin=h.VerticalOrigin.BOTTOM,p.label.horizontalOrigin=h.HorizontalOrigin.CENTER,p.label.eyeOffset=new h.Cartesian3(0,0,-10),e&&(p.label.heightReference=e),n&&(p.label.scaleByDistance=n),p.billboard.id=p.label.id,p.billboard.show=!0,p.billboard.scale=1*o._scaleFactor,p.billboard.verticalOrigin=h.VerticalOrigin.BOTTOM,p.billboard.horizontalOrigin=h.HorizontalOrigin.CENTER,e&&(p.billboard.heightReference=e),n&&(p.billboard.scaleByDistance=n),l){const f=o.getClusterStyle(l,d.length).mode,g=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];p.label.pixelOffset=new h.Cartesian2(g[0]*o._scaleFactor,g[1]*o._scaleFactor),p.billboard.width=o._clusterImageAttribute[f].imageSize[0],p.billboard.height=o._clusterImageAttribute[f].imageSize[1],p.billboard.pixelOffset=new h.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),p.billboard.setImage(f,o._clusterImageUrl),p.billboard.setImageSubRegion(f,new h.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const d=()=>{const f=s.clustering.pixelRange;s.clustering.pixelRange=0,s.clustering.pixelRange=f};d();let p=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{d()});this.d(()=>{var f;p&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(p))})}}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}_addEntities(e,n,o,s,r,l,c,u){const d=h.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:d,label:{text:n,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,pixelOffset:new h.Cartesian2(s[0]*this._scaleFactor,s[1]*this._scaleFactor),heightReference:r,scaleByDistance:l,eyeOffset:new h.Cartesian3(0,0,-10)},billboard:this._clusterImages[c??"SquareH01"].clone(new h.BillboardGraphics),properties:u})}_getPositionLLH(e){const n=h.Cartographic.fromCartesian(e);return[h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude),n.height]}};v(xl,"type",xl.register("ESCesiumViewer",a.ESEntityCluster.type,xl));let $p=xl;const Al=class Al extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};v(Al,"type",Al.register("ESCesiumViewer",gh.type,Al));let qp=Al;const Tl=class Tl extends qt{constructor(e,n){super(e,n);v(this,"geoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.geoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};v(Tl,"type",Tl.register("ESCesiumViewer",a.ESGeoWater.type,Tl));let Xp=Tl;const Ml=class Ml extends Jt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const r=this.dv(a.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),l=()=>{s.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};l(),this.d(r.don(l))}}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Ml,"type",Ml.register("ESCesiumViewer",fh.type,Ml));let Yp=Ml;class xT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:C,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(...C),u.push(...this.setIndexs(P))}const[f,g,m]=It({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const _=this.setTextureCoordinates(n,o);c.push(..._.flat()),this.updateCustomPrimitive(s,g,l,u,c),o.computeBoundingBox()}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],m=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],_=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,m],[d,p],[p,y]],C=[[f,g],[f,m],[g,y],[m,y]];return{outlinePionts:[..._,...P,...C],customPrimitivePoints:[u,c,d,p,g,f,m,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=It({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],m=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+m),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Il=class Il extends vt{constructor(e,n){super(e,n);v(this,"_line",this.dv(new be(this.czmViewer,this.sceneObject.id)));v(this,"_czmTexture",this.ad(new ze(this.czmViewer,this.sceneObject.id)));v(this,"_czmCustomPrimitive",this.dv(new De(this.czmViewer,this.sceneObject.id)));v(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new xT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
1746
1746
|
in vec2 v_st;
|
|
1747
1747
|
void main()
|
|
1748
1748
|
{
|
|
@@ -1781,7 +1781,7 @@ ${$y}
|
|
|
1781
1781
|
{
|
|
1782
1782
|
v_st = a_st;
|
|
1783
1783
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
1784
|
-
}`,n.castShadows=!0,n.receiveShadows=!0
|
|
1784
|
+
}`,n.castShadows=!0,n.receiveShadows=!0;{const o=()=>{n.show=e.show&&e.filled};o();const s=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(s.don(o))}return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.line.positions?(oe(s,o,n,this.line.positions,e),!0):!1:!1}};v(Il,"type",Il.register("ESCesiumViewer",a.ESPipeFence.type,Il));let Zp=Il;const Dl=class Dl extends Os{constructor(e,n){super(e,n);v(this,"czmCustomPrimitive");v(this,"czmTexture");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.dv(new De(n,e.id)),r=this.ad(new ze(n,e.id));this.czmCustomPrimitive=s,this.czmTexture=r,this.d(a.track([s,"allowPicking"],[e,"allowPicking"]));const l=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new a.ObjResettingWithEvent(l,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new AT(e,this);s.attributes=void 0}))}};v(Dl,"type",Dl.register("ESCesiumViewer",a.ESPipeline.type,Dl));let Qp=Dl;class AT extends a.Destroyable{constructor(i,e){super(),this._sceneObject=i,this._czmESPipeline=e;const n=this._sceneObject,o=this._czmESPipeline,s=o.czmCustomPrimitive,r=o.czmTexture;if(!s||!r)return;{const u=()=>{s.show=n.show&&n.filled};u();const d=this.dv(a.createNextAnimateFrameEvent(n.showChanged,n.filledChanged));this.d(d.don(u))}const l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{n.materialImage.url!=""?r.uri=typeof n.materialImage.url=="string"?n.materialImage.url:n.materialImage.url.url:n.materialMode==="multipleArrows"||n.materialMode==="blue"?r.uri=c:r.uri=l;const p=a.getDistancesFromPositions(n.points,"GEODESIC"),g=p[p.length-1]/n.materialImage.uDis;s.uniformMap={u_image:{type:"texture",id:r.id},u_stScale:[g,2*Math.PI*n.radius/n.materialImage.vDis],u_speed:[n.speed/n.materialImage.uDis,0],u_color:n.fillColor}};u();const d=this.dv(a.createNextAnimateFrameEvent(n.speedChanged,n.materialImageChanged,n.materialModeChanged,n.fillColorChanged));this.d(d.don(u))}(()=>{if(!n.points||n.points.length>=2&&a.equalsN3(n.points[n.points.length-2],n.points[n.points.length-1]))return;const{position:d,modelMatrix:p,indexes:f,uvCoordinates:g}=this.coordinateTransformation(n.points,n.sides);s.modelMatrix=p,s.attributes={position:{typedArray:new Float32Array(d),componentsPerAttribute:3},st:{typedArray:new Float32Array([...g,...g.reverse()]),componentsPerAttribute:2}},s.indexTypedArray=new Uint16Array([...f,...f.reverse()]),s.fragmentShaderSource=`
|
|
1785
1785
|
in vec2 v_st;
|
|
1786
1786
|
uniform sampler2D u_image;
|
|
1787
1787
|
uniform vec4 u_color;
|
|
@@ -2291,10 +2291,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2291
2291
|
`;function F4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
2292
2292
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
2293
2293
|
gitee地址:${t}
|
|
2294
|
-
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new fF(this)),this.ad(new gF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new wF(this)})),this._viewerLegend=this.dv(new A4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&kt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return It(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",R4,D4,!0),new a.FunctionProperty([],()=>st.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",F4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",yF),v(st,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...I4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.21",e="2025-10-24T06:36:57.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="af1fcfa59ce080208fcc4e95f0924ca6a4ecb503",l=((Date.now()-1761287817e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2294
|
+
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new fF(this)),this.ad(new gF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new wF(this)})),this._viewerLegend=this.dv(new A4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&kt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:Jo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return It(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",R4,D4,!0),new a.FunctionProperty([],()=>st.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",F4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",yF),v(st,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...I4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.22",e="2025-10-29T07:51:42.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="5897fe5e814b73613d910e2f3ea44f872cdc61d4",l=((Date.now()-1761724302e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2295
2295
|
%c${o?o+`
|
|
2296
2296
|
`:""}当前网站正在使用${t},此软件版权归${n}所有
|
|
2297
|
-
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
2297
|
+
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","5897fe5e814b73613d910e2f3ea44f872cdc61d4")},get info(){return c},get date(){return"2025-10-29T07:51:42.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.22"},get name(){return"earthsdk3-cesium"},get commitId(){return"5897fe5e814b73613d910e2f3ea44f872cdc61d4"},print(){console.info(this.info,`
|
|
2298
2298
|
font-size: 18px;
|
|
2299
2299
|
font-weight: 1000;
|
|
2300
2300
|
line-height: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CzmObjects/general/CzmESPipeFence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA6C,MAAM,WAAW,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CzmObjects/general/CzmESPipeFence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA6C,MAAM,WAAW,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAsOzD,qBAAa,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IACtF,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAwF;IAC5G,OAAO,CAAC,KAAK,CAAiE;IAC9E,IAAI,IAAI,gBAAyB;IAEjC,OAAO,CAAC,WAAW,CAAgE;IACnF,UAAU;IAEV,OAAO,CAAC,mBAAmB,CAAwE;IACnG,IAAI,kBAAkB,uBAAuC;IAE7D,OAAO,CAAC,UAAU,CAA6B;IAC/C,IAAI,SAAS,IACQ,MAAM,CADsB;IACjD,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAoC;IAC/D,IAAI,gBAAgB,mDAAsC;IAG1D,kBAAkB;IAQlB,mBAAmB,CAAC,WAAW,EAAE,WAAW;gBAmDhC,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,cAAc;IA4H5C,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;CAapE"}
|