earthsdk3-cesium 3.3.0-beta.16 → 3.3.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +4 -4
- package/dist/earthsdk3-cesium.js +12 -12
- package/dist/earthsdk3-cesium.umd.cjs +4 -4
- package/dist/types/ESCesiumViewer/NavigationManager/index.d.ts +1 -1
- package/dist/types/ESCesiumViewer/NavigationManager/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/index.d.ts +1 -1
- package/dist/types/ESCesiumViewer/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -167,7 +167,7 @@ material.alpha = materialInput.color.a;
|
|
|
167
167
|
return material;
|
|
168
168
|
}
|
|
169
169
|
`;C.Material.GlobeLevelMaterialType="GlobelLevel",C.Material._materialCache.addMaterial(C.Material.GlobeLevelMaterialType,{fabric:{type:C.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new C.Cartesian3(0,0,0),input_highlights:new C.Cartesian3(1,1,1),midtones:new C.Cartesian3(.5,.5,.5),output_shadows:new C.Cartesian3(0,0,0),output_highlights:new C.Cartesian3(1,1,1)},source:VP},translucent:!1});const{PrimitiveRenderResources:NP,ModelUtility:HP,Cartesian3:Ln,Matrix4:_a,ModelRenderResources:GP,defined:WP,NodeRenderResources:qP,BoundingSphere:Vi,ModelDrawCommands:KP}=C,ZP=new Ln,XP=new Ln,V0=new Ln,N0=new Ln;class $P extends NP{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=_a.inverse(i,new _a),r=HP.getPositionMinMax(e.primitive,_a.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,V0),_a.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,N0));this.positionMin=Ln.clone(r.min,new Ln),this.positionMax=Ln.clone(r.max,new Ln),this.boundingSphere=Vi.fromCornerPoints(this.positionMin,this.positionMax,new Vi)}}function YP(){C.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new GP(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,s;for(o=0;o<i.length;o++)i[o].process(e,n,t);const a=Ln.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,ZP),l=Ln.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,XP);for(o=0;o<this._runtimeNodes.length;o++){const c=this._runtimeNodes[o];if(!WP(c))continue;c.configurePipeline();const h=c.pipelineStages,u=new qP(e,c);for(r=0;r<h.length;r++)h[r].process(u,c.node,t);const A=c.computedTransform;for(r=0;r<c.runtimePrimitives.length;r++){const f=c.runtimePrimitives[r];f.configurePipeline(t);const d=f.pipelineStages,g=new $P(u,f,A);for(s=0;s<d.length;s++)d[s].process(g,f.primitive,t);f.boundingSphere=Vi.clone(g.boundingSphere,new Vi);const v=_a.multiplyByPoint(A,g.positionMin,V0),y=_a.multiplyByPoint(A,g.positionMax,N0);Ln.minimumByComponent(a,v,a),Ln.maximumByComponent(l,y,l);const m=KP.buildModelDrawCommand(g,t);f.drawCommand=m}}this._boundingSphere=Vi.fromCornerPoints(a,l,new Vi),this._boundingSphere=Vi.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=Vi.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=Vi.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const ou=class ou extends p.Destroyable{constructor(){super(),C.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{ou.oldUpdate.call(this,n),this._particles.forEach(i=>{C.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{C.ParticleSystem.prototype.update=ou.oldUpdate})}};L(ou,"oldUpdate",C.ParticleSystem.prototype.update);let hd=ou;function JP(){if(C.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(C.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,C.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=C.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class jP{constructor(n){L(this,"index");L(this,"image");L(this,"resolve");L(this,"reject");L(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function eT(){C.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let s=r.width,a=r.height;const l=this._subRegions,c=i.map((y,m)=>new jP({index:m,image:y})).filter((y,m)=>C.defined(y.image)&&!C.defined(l.get(m)));let h=0,u=0,A=0;for(let y=n;y<o.length;++y){const{width:m,height:w}=o[y].image;h=Math.max(h,m),u=Math.max(u,w),A+=m*w,c.push(o[y])}s=Math.max(h,s),a=Math.max(u,a),t.webgl2||(s=C.Math.nextPowerOfTwo(s),a=C.Math.nextPowerOfTwo(a));const f=Math.sqrt(A);a*=Math.ceil(f/a),s*=Math.ceil(f/s),c.sort(({image:y},{image:m})=>m.height*m.width-y.height*y.width);const d=new Array(this._nextIndex);for(const y of this._subRegions.keys())C.defined(l.get(y))&&(d[y]=i[y]);let g,v=!1;for(;!v;){g=new C.TexturePacker({height:a,width:s,borderPadding:e});let y;for(y=0;y<c.length;++y){const{index:m,image:w}=c[y];if(!C.defined(w))continue;const _=g.pack(m,w);if(!C.defined(_)){s>a?a*=2:s*=2;break}d[m]=_.rectangle}v=y===c.length}this._texturePacker=g,this._texture=this._copyFromTexture(t,s,a,d),r.destroy(),this._rectangles=d,this._guid=C.createGuid()}}const br={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:tT,Indices:nT,FeatureIdAttribute:H0,FeatureIdTexture:G0,FeatureIdImplicitRange:W0,MorphTarget:iT,Primitive:rT,Instances:oT,Skin:aT,Node:sT,AnimatedPropertyType:lT,AnimationSampler:uT,AnimationTarget:cT,AnimationChannel:hT,Animation:AT,ArticulationStage:fT,Articulation:dT,Asset:pT,Scene:mT,Components:gT,MetallicRoughness:yT,SpecularGlossiness:vT,Specular:wT,Anisotropy:Ad,Clearcoat:fd,Material:bT}=C.ModelComponents;function _T(){C.GltfLoader.prototype.process=function(t){if(C.Check.typeOf.object("frameState",t),this._state===br.LOADED&&!C.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=CT(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),C.defined(this._processError)){this._state=br.FAILED;const o=this._processError;this._processError=void 0,dd(this,o)}const n=this._textureErrors.pop();if(C.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===br.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=br.FAILED,dd(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=br.FAILED,dd(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function CT(t,n){C.FeatureDetection.supportsWebP.initialized||await C.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new C.SupportedImageFormats({webp:C.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=ST(t,n);return t._state=br.PROCESSING,t._textureState=br.PROCESSING,C.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(C.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const xT=new C.Cartesian3;function ST(t,n){const e=t.gltfJson,i=e.extensions??C.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(C.defined(r)){const m=r.featureTables,w=r.featureTextures,_=C.defined(m)?m:[],E=C.defined(w)?w:[];t._sortedPropertyTableIds=Object.keys(_).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const a=ET(t,n),l=FT(t,a),c=BT(t,a),h=MT(e),u=DT(e,a),A=new gT,f=new pT,d=e.asset.copyright;if(C.defined(d)){const m=d.split(";").map(function(w){return new C.Credit(w.trim())});f.credits=m}if(A.asset=f,A.scene=u,A.nodes=a,A.skins=l,A.animations=c,A.articulations=h,A.upAxis=t._upAxis,A.forwardAxis=t._forwardAxis,C.defined(s)){const m=C.Cartesian3.fromArray(s.center,0,xT);A.transform=C.Matrix4.fromTranslation(m,A.transform)}if(t._components=A,C.defined(o)||C.defined(r)){const m=RT(t,o,r,n);t._loaderPromises.push(m)}const g=i.NGA_gpm_local;if(C.defined(g)){const m=C.GltfGpmLoader.load(g);t._components.extensions.NGA_gpm_local=m}const v=e.meshes;if(C.defined(v))for(const m of v){const w=m.primitives;if(C.defined(w))for(const _ of w){const E=_.extensions;if(C.defined(E)){const T=E.NGA_gpm_local;if(C.defined(T)){const P=UT(t,e,T,n);t._loaderPromises.push(P)}}}}const y=[];return ew(y,t._loaderPromises),t._incrementallyLoadTextures||ew(y,t._texturesPromises),Promise.all(y)}function ET(t,n){const e=t.gltfJson.nodes;if(!C.defined(e))return[];const i=e.map(function(o,r){const s=PT(t,o,n);return s.index=r,s});for(let o=0;o<i.length;++o){const r=e[o].children;if(C.defined(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function PT(t,n,e){const i=new sT;i.name=n.name,i.matrix=Pn(C.Matrix4,n.matrix),i.translation=Pn(C.Cartesian3,n.translation),i.rotation=Pn(C.Quaternion,n.rotation),i.scale=Pn(C.Cartesian3,n.scale);const o=n.extensions??C.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(C.defined(r)){if(t._loadForClassification)throw new C.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=OT(t,o,e)}C.defined(s)&&(i.articulationName=s.articulationName);const a=n.mesh;if(C.defined(a)){const l=t.gltfJson.meshes[a],c=l.primitives;for(let A=0;A<c.length;++A)i.primitives.push(TT(t,c[A],C.defined(i.instances),e));const h=n.weights??l.weights,u=i.primitives[0].morphTargets;i.morphWeights=C.defined(h)?h.slice():new Array(u.length).fill(0)}return i}function TT(t,n,e,i){const o=new rT,r=new C.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const s=n.material;C.defined(s)&&(o.material=IT(t,t.gltfJson.materials[s],i));const a=n.extensions??C.Frozen.EMPTY_OBJECT;let l=!1;const c=a.CESIUM_primitive_outline;t._loadPrimitiveOutline&&C.defined(c)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=LT(t,c));const h=a.KHR_spz_gaussian_splats_compression;C.defined(h)&&(l=!0,r.needsGaussianSplats=!0);const u=t._loadForClassification,A=a.KHR_draco_mesh_compression;let f=!1;const d=n.attributes;if(C.defined(d))for(const T in d){if(!d.hasOwnProperty(T))continue;const P=d[T],k=pd(t,C.VertexAttributeSemantic,T),D=k.modelSemantic;if(u&&!QT(D))continue;D===C.VertexAttributeSemantic.FEATURE_ID&&(f=!0);const B=q0(t,P,k,n,A,h,e,l,i);r.attributePlans.push(B),o.attributes.push(B.attribute)}const g=n.targets;if(C.defined(g)&&!u)for(let T=0;T<g.length;++T)o.morphTargets.push(VT(t,g[T],l,r,i));const v=n.indices;if(C.defined(v)){const T=NT(t,v,n,A,f,l,i);C.defined(T)&&(r.indicesPlan=T,o.indices=T.indices)}const y=a.EXT_structural_metadata,m=a.EXT_mesh_features,w=a.EXT_feature_metadata,_=C.defined(w);C.defined(m)?HT(t,o,m,i):_&>(t,o,w,i),C.defined(y)?WT(o,y):_&&qT(t,o,w);const E=n.mode;if(u&&E!==C.PrimitiveType.TRIANGLES)throw new C.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function IT(t,n,e){const i=new bT,o=n.extensions??C.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,c=n.pbrMetallicRoughness;return i.unlit=C.defined(o.KHR_materials_unlit),C.defined(r)?i.specularGlossiness=kT(t,r,e):(C.defined(c)&&(i.metallicRoughness=KT(t,c,e)),C.defined(s)&&!i.unlit&&(i.specular=ZT(t,s,e)),C.defined(a)&&!i.unlit&&(i.anisotropy=XT(t,a,e)),C.defined(l)&&!i.unlit&&(i.clearcoat=$T(t,l,e))),C.defined(n.emissiveTexture)&&(i.emissiveTexture=an(t,n.emissiveTexture,e,void 0)),C.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=an(t,n.normalTexture,e,void 0)),C.defined(n.occlusionTexture)&&(i.occlusionTexture=an(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=Pn(C.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function kT(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=n,l=new vT;return C.defined(i)&&(l.diffuseTexture=an(t,i,e,void 0)),C.defined(o)&&(l.specularGlossinessTexture=an(t,o,e,void 0)),l.diffuseFactor=Pn(C.Cartesian4,r),l.specularFactor=Pn(C.Cartesian3,s),l.glossinessFactor=a,l}function dd(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function FT(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!C.defined(e))return[];const i=e.map(function(r,s){const a=YT(t,r,n);return a.index=s,a}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const s=o[r].skin;C.defined(s)&&(n[r].skin=i[s])}return i}function BT(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!C.defined(e)?[]:e.map(function(o,r){const s=JT(t,o,n);return s.index=r,s})}function MT(t){var i;const e=(i=(t.extensions??C.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return C.defined(e)?e.map(jT):[]}function DT(t,n){const e=new mT,i=eI(t);return e.nodes=i.map(function(o){return n[o]}),e}async function RT(t,n,e,i){const o=new C.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function UT(t,n,e,i){const o=new C.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Pn(t,n){if(C.defined(n))return t===Number?n[0]:t.unpack(n)}function OT(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new oT,r=i.attributes;if(C.defined(r))for(const c in r){if(!r.hasOwnProperty(c))continue;const h=r[c];o.attributes.push(tI(t,h,r,c,e))}const s=i.extensions??C.Frozen.EMPTY_OBJECT,a=n.EXT_instance_features,l=s.EXT_feature_metadata;return C.defined(a)?nI(o,a):C.defined(l)&&iI(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function LT(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return fh(t,i,!1)}const zT={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function pd(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=zT;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function QT(t){const n=t===C.VertexAttributeSemantic.POSITION,e=t===C.VertexAttributeSemantic.FEATURE_ID,i=t===C.VertexAttributeSemantic.TEXCOORD;return n||e||i}function q0(t,n,e,i,o,r,s,a,l){const c=e.modelSemantic,h=c===C.VertexAttributeSemantic.POSITION,u=c===C.VertexAttributeSemantic.FEATURE_ID,A=h&&!s&&t._loadAttributesFor2D&&!l.scene3DOnly,f=h&&t._enablePick&&!l.context.webgl2,d=t._loadForClassification&&u,g=t._loadAttributesAsTypedArray,v=!g,y=g||A||f||d,_=K0(t,n,e,i,o,r,a?!1:v,a?!0:y,l),E=new C.PrimitiveLoadPlan.AttributeLoadPlan(_);return E.loadBuffer=v,E.loadTypedArray=y,E}function VT(t,n,e,i,o){const r=new iT,s=void 0,a=void 0,l=void 0,c=!1;for(const h in n){if(!n.hasOwnProperty(h))continue;const u=n[h],A=pd(t,VertexAttributeSemantic,h),f=q0(t,u,A,s,a,l,c,e,o);r.attributes.push(f.attribute),i.attributePlans.push(f)}return r}function NT(t,n,e,i,o,r,s){const a=t.gltfJson.accessors[n],l=a.bufferView;if(!C.defined(i)&&!C.defined(l))return;const c=new nT;c.count=a.count;const h=t._loadAttributesAsTypedArray,u=(t._loadIndicesForWireframe||t._enablePick)&&!s.context.webgl2,A=t._loadForClassification&&o,d=!h,g=h||u||A,m=rI(t,n,e,i,r?!1:d,r?!0:g,s),w=t._geometryLoaders.length;t._geometryLoaders.push(m);const _=m.load();t._loaderPromises.push(_),t._geometryCallbacks[w]=()=>{c.indexDatatype=m.indexDatatype,c.buffer=m.buffer,c.typedArray=m.typedArray};const E=new C.PrimitiveLoadPlan.IndicesLoadPlan(c);return E.loadBuffer=d,E.loadTypedArray=g,E}function HT(t,n,e,i){let o;C.defined(e)&&C.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const s=o[r],a=`featureId_${r}`;let l;C.defined(s.texture)?l=oI(t,s,i,a):C.defined(s.attribute)?l=Z0(s,a):l=X0(s,a),n.featureIds.push(l)}}function GT(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const s=e.featureIdAttributes;if(C.defined(s))for(let l=0;l<s.length;++l){const c=s[l],h=c.featureTable,u=t._sortedPropertyTableIds.indexOf(h),A=o[h].count,f=`featureId_${r}`;r++;let d;C.defined(c.featureIds.attribute)?d=$0(c,u,A,f):d=Y0(c,u,A,f),n.featureIds.push(d)}const a=e.featureIdTextures;if(C.defined(a))for(let l=0;l<a.length;++l){const c=a[l],h=c.featureTable,u=t._sortedPropertyTableIds.indexOf(h),A=o[h].count,f=`featureId_${r}`;r++;const d=aI(t,c,u,i,A,f);n.featureIds.push(d)}}function WT(t,n){if(!C.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;C.defined(e)&&(t.propertyTextureIds=e),C.defined(i)&&(t.propertyAttributeIds=i)}function qT(t,n,e){C.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function KT(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=n,l=new yT;return C.defined(i)&&(l.baseColorTexture=an(t,i,e,void 0)),C.defined(o)&&(l.metallicRoughnessTexture=an(t,o,e,void 0)),l.baseColorFactor=Pn(C.Cartesian4,r),l.metallicFactor=s,l.roughnessFactor=a,l}function ZT(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=n,a=new wT;return C.defined(o)&&(a.specularTexture=an(t,o,e,void 0)),C.defined(s)&&(a.specularColorTexture=an(t,s,e,void 0)),a.specularFactor=i,a.specularColorFactor=Pn(C.Cartesian3,r),a}function XT(t,n,e){const{anisotropyStrength:i=Ad.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Ad.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,s=new Ad;return C.defined(r)&&(s.anisotropyTexture=an(t,r,e,void 0)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function $T(t,n,e){const{clearcoatFactor:i=fd.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=fd.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=n,l=new fd;return C.defined(o)&&(l.clearcoatTexture=an(t,o,e,void 0)),C.defined(s)&&(l.clearcoatRoughnessTexture=an(t,s,e,void 0)),C.defined(a)&&(l.clearcoatNormalTexture=an(t,a,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function an(t,n,e,i){const o=t.gltfJson,r=C.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!C.defined(r))return;const s=C.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),a=C.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(s);const c=s.load().catch(h=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw h;t._textureState=br.FAILED,t._textureErrors.push(h)}});return t._texturesPromises.push(c),t._textureCallbacks[l]=()=>{a.texture=s.texture,C.defined(i)&&(a.texture.sampler=i)},a}function YT(t,n,e){const i=new aT,o=n.joints;i.joints=o.map(s=>e[s]);const r=n.inverseBindMatrices;if(C.defined(r)){const s=t.gltfJson.accessors[r];i.inverseBindMatrices=fh(t,s,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(C.Matrix4.IDENTITY);return i}function JT(t,n,e){const i=new AT;i.name=n.name;const o=n.samplers.map(function(s,a){const l=sI(t,s);return l.index=a,l}),r=n.channels.map(function(s){return lI(s,o,e)});return i.samplers=o,i.channels=r,i}function jT(t){const n=new dT;return n.name=t.name,n.stages=t.stages.map(cI),n}function eI(t){let n;return C.defined(t.scenes)&&C.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=C.defined(n)?n:[],n}function tI(t,n,e,i,o){const r=t.gltfJson.accessors,s=C.defined(e.ROTATION),a=C.defined(e.TRANSLATION)&&C.defined(r[e.TRANSLATION].min)&&C.defined(r[e.TRANSLATION].max),l=pd(t,C.InstanceAttributeSemantic,i),c=l.modelSemantic,h=c===C.InstanceAttributeSemantic.TRANSLATION||c===C.InstanceAttributeSemantic.ROTATION||c===C.InstanceAttributeSemantic.SCALE,u=c===C.InstanceAttributeSemantic.TRANSLATION,A=t._loadAttributesAsTypedArray||s&&h||!o.context.instancedArrays,f=t._enablePick&&!o.context.webgl2,d=!A,g=t._loadAttributesFor2D&&!o.scene3DOnly;return K0(t,n,l,void 0,void 0,void 0,d,A||u&&(!a||g||f),o)}function nI(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let s;C.defined(o.attribute)?s=Z0(o,r):s=X0(o,r),t.featureIds.push(s)}}function iI(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(C.defined(r))for(let s=0;s<r.length;++s){const a=r[s],l=a.featureTable,c=i.indexOf(l),h=o[l].count,u=`instanceFeatureId_${s}`;let A;C.defined(a.featureIds.attribute)?A=$0(a,c,h,u):A=Y0(a,c,h,u),n.featureIds.push(A)}}function fh(t,n,e){const i=new Array(n.count),o=n.bufferView;if(C.defined(o)){const r=uI(t,o),s=hI(t,r,n,e,i);return t._loaderPromises.push(s),i}return AI(n,i)}function K0(t,n,e,i,o,r,s,a,l){const c=t.gltfJson,h=c.accessors[n],u=h.bufferView,A=e.gltfSemantic,f=e.renamedSemantic,d=e.modelSemantic,g=C.defined(d)?J0(f):void 0,y=fI(c,n,A,d,g);if(!C.defined(o)&&!C.defined(u)&&!C.defined(r))return y;const m=dI(t,n,A,i,o,r,s,a,l),w=t._geometryLoaders.length;t._geometryLoaders.push(m);const _=m.load();return t._loaderPromises.push(_),t._geometryCallbacks[w]=()=>{C.defined(o)&&C.defined(o.attributes)&&C.defined(o.attributes[A])?pI(y,m,s,a):C.defined(r)?mI(y,m,s,a):gI(c,h,y,m,s,a)},y}function rI(t,n,e,i,o,r,s){return C.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:s,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function oI(t,n,e,i){const o=new G0;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=an(t,r,e,C.Sampler.NEAREST);const a=(C.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=a,o}function Z0(t,n){const e=new H0;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function X0(t,n){const e=new W0;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function $0(t,n,e,i){const o=new H0,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=J0(r.attribute),o.positionalLabel=i,o}function Y0(t,n,e,i){const o=new W0,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function aI(t,n,e,i,o,r){const s=new G0,a=n.featureIds,l=a.texture;return s.featureCount=o,s.propertyTableId=e,s.textureReader=an(t,l,i,C.Sampler.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function sI(t,n){const e=new uT,i=t.gltfJson.accessors,o=i[n.input];e.input=fh(t,o,void 0);const r=n.interpolation;e.interpolation=C.InterpolationType[r]??C.InterpolationType.LINEAR;const s=i[n.output];return e.output=fh(t,s,!0),e}function lI(t,n,e){const i=new hT,o=t.sampler;return i.sampler=n[o],i.target=yI(t.target,e),i}function uI(t,n){const e=C.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function cI(t){const n=new fT;n.name=t.name;const e=t.type.toUpperCase();return n.type=C.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function hI(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const s=j0(r,e,n.typedArray);i=i??!1,vI(e,s,o,i)}function AI(t,n){const e=t.type;if(e===C.AttributeType.SCALAR)return n.fill(0);const i=C.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function J0(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function fI(t,n,e,i,o){var u;const r=t.accessors[n],s=C.AttributeType.getMathType(r.type),a=r.normalized??!1,l=new tT;l.name=e,l.semantic=i,l.setIndex=o,l.constant=wI(s),l.componentDatatype=r.componentType,l.normalized=a,l.count=r.count,l.type=r.type,l.min=Pn(s,r.min),l.max=Pn(s,r.max),l.byteOffset=r.byteOffset,l.byteStride=C.getAccessorByteStride(t,r),C.hasExtension(r,"WEB3D_quantized_attributes")&&bI(r.extensions.WEB3D_quantized_attributes,l,s);const c=l.semantic===C.VertexAttributeSemantic.POSITION||l.semantic===C.VertexAttributeSemantic.NORMAL||l.semantic===C.VertexAttributeSemantic.TANGENT||l.semantic===C.VertexAttributeSemantic.TEXCOORD||l.semantic===C.VertexAttributeSemantic.FEATURE_ID||l.semantic===C.VertexAttributeSemantic.SCALE||l.semantic===C.VertexAttributeSemantic.ROTATION;return((u=t.extensionsRequired)==null?void 0:u.includes("KHR_mesh_quantization"))&&a&&c&&CI(l,s),l}function dI(t,n,e,i,o,r,s,a,l){const c=t.gltfJson,u=c.accessors[n].bufferView;return C.ResourceCache.getVertexBufferLoader({gltf:c,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:u,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:s,loadTypedArray:a})}function pI(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=C.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=C.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function mI(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&C.defined(n.typedArray)&&(t.typedArray=C.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===C.VertexAttributeSemantic.POSITION){const o=s=>{let a=1/0,l=-1/0,c=1/0,h=-1/0,u=1/0,A=-1/0;for(let f=0;f<s.length;f+=3){const d=s[f],g=s[f+1],v=s[f+2];a=Math.min(a,d),l=Math.max(l,d),c=Math.min(c,g),h=Math.max(h,g),u=Math.min(u,v),A=Math.max(A,v)}return[new C.Cartesian3(a,c,u),new C.Cartesian3(l,h,A)]},r=t.typedArray;[t.min,t.max]=o(r)}}function gI(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const s=i.typedArray;e.typedArray=j0(t,n,s),o||(e.byteOffset=0,e.byteStride=void 0)}}function yI(t,n){const e=new cT,i=t.node;if(!C.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=lT[o],e}function j0(t,n,e){let i=n.byteOffset;const o=C.getAccessorByteStride(t,n),r=n.count,s=C.numberOfComponentsForType(n.type),a=n.componentType,l=C.ComponentDatatype.getSizeInBytes(a),c=l*s,h=r*s;if(o===c)return e=new Uint8Array(e),C.ComponentDatatype.createArrayBufferView(a,e.buffer,e.byteOffset+i,h);const u=C.ComponentDatatype.createTypedArray(a,h),A=new DataView(e.buffer),f=new Array(s),d=C.getComponentReader(n.componentType);i=e.byteOffset+i;for(let g=0;g<r;++g){d(A,i,s,l,f);for(let v=0;v<s;++v)u[g*s+v]=f[v];i+=o}return u}function vI(t,n,e,i){const o=t.type,r=t.count;if(o===C.AttributeType.SCALAR)for(let s=0;s<r;s++)e[s]=n[s];else if(o===C.AttributeType.VEC4&&i)for(let s=0;s<r;s++)e[s]=C.Quaternion.unpack(n,s*4);else{const s=C.AttributeType.getMathType(o),a=C.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=s.unpack(n,l*a)}return e}function wI(t){return t===Number?0:new t}function bI(t,n,e){const i=t.decodeMatrix,o=Pn(e,t.decodedMin),r=Pn(e,t.decodedMax);C.defined(o)&&C.defined(r)&&(n.min=o,n.max=r);const s=new C.ModelComponents.Quantization;s.componentDatatype=n.componentDatatype,s.type=n.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new C.Cartesian2(i[6],i[7]),s.quantizedVolumeStepSize=new C.Cartesian2(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new C.Cartesian3(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new C.Cartesian3(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new C.Cartesian4(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new C.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=s}const _I={VEC2:new C.Cartesian2(-1,-1),VEC3:new C.Cartesian3(-1,-1,-1),VEC4:new C.Cartesian4(-1,-1,-1,-1)};function CI(t,n){const e=xI(t.componentDatatype),i=_I[t.type];let o=t.min;C.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;C.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function xI(t){switch(t){case C.ComponentDatatype.BYTE:return 127;case C.ComponentDatatype.UNSIGNED_BYTE:return 255;case C.ComponentDatatype.SHORT:return 32767;case C.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function ew(t,n){if(!C.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}FP(),BP(),MP(),OP(),LP(),zP(),QP(),kP(),YP(),JP(),eT(),_T(),C.Camera.DEFAULT_VIEW_RECTANGLE=C.Rectangle.fromDegrees(70,5,140,55);function SI(){return new Promise((t,n)=>C.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class EI extends p.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:a}=e;if(a){const l=Tn(a);if(l&&(l.destroy(),md(a,void 0)),C.defined(a)){a.entities.removeAll(),a.dataSources.removeAll(),a.imageryLayers.removeAll(),a.scene.primitives.removeAll(),a.scene.groundPrimitives.removeAll(),a.scene.postProcessStages.removeAll();let c=a.scene.context._originalGLContext;c.canvas.width=c.canvas.height=1,c.getExtension("WEBGL_lose_context").loseContext(),c=null}a.destroy(),i(void 0)}};this.d(r);const s=this.dv(p.createProcessingFromAsyncFunc(async(a,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const c=IP;await a.promise(SI());const h=await a.promise(p.createCancelablePromise(c(l,o)));h.scene._xbsjOriginSkyAtmosphere=h.scene.skyAtmosphere,h.scene._xbsjOriginSkyBox=h.scene.skyBox,h.clockViewModel.currentTime=C.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const u=C.JulianDate.fromDate(new Date(e.currentTime));C.JulianDate.equals(u,h.clockViewModel.currentTime)||(h.clockViewModel.currentTime=u)})),this.dispose(ci(h.clockViewModel,"currentTime",u=>{const A=C.JulianDate.toDate(h.clockViewModel.currentTime).getTime();A!==e.currentTime&&(e.currentTime=A)}));{const u=new ow(h,e);md(h,u)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(h)}));s.start(n),s.errorEvent.don(a=>{console.error(a),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const PI=new C.EllipsoidTerrainProvider;class tw extends p.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(p.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let s of this._terrainMap.keys())s.sceneObject.activate=!1,(s.sceneObject.show??!0)&&s.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${s.sceneObject.name}(${s.sceneObject.id})`),r=s.sceneObject.zIndex,this.selectedTerrain=s);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??PI,i.scene.globe.depthTestAgainstTerrain=this.selectedTerrain?this.selectedTerrain.sceneObject.renderMode!="disableDepthTest":!0,i.scene.globe.translucency.enabled=this.selectedTerrain?this.selectedTerrain.sceneObject.renderMode!="default":!1,i.scene.globe.translucency.frontFaceAlpha=this.selectedTerrain?p.clamp(this.selectedTerrain.sceneObject.opacity,0,1):1,i.scene.globe.translucency.backFaceAlpha=this.selectedTerrain?p.clamp(this.selectedTerrain.sceneObject.opacity,0,1):1}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new p.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(p.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged,e.sceneObject.opacityChanged,e.sceneObject.renderModeChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class nw extends p.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof wt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new p.Destroyable;{const r=o.dv(p.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof wt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const a of e.keys())o[a.zOrder]||(o[a.zOrder]=new Map),o[a.zOrder].set(a,a instanceof wt?a.czmDivPoi?a.czmDivPoi.depth:0:a.canvasObj?a.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((a,l)=>i=="div"?Number(l)-Number(a):Number(a)-Number(l));let s=e.size;for(let a=0;a<r.length;a++)new Map([...o[r[a]]].sort((c,h)=>Number(h[1])-Number(c[1]))).forEach((c,h)=>{h instanceof wt&&h.czmDivPoi&&(h.czmDivPoi.zOrder=s),h instanceof Gi&&h.canvasObj&&(h.canvasObj.czmCanvasPoi.zOrder=s),s--})}}class TI extends p.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new p.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const s=o.czmImageryWrapper.imagery.zIndex??Q.ESImageryLayer.defaults.zIndex,a=r.czmImageryWrapper.imagery.zIndex??Q.ESImageryLayer.defaults.zIndex;return s-a});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class II extends p.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class kI extends p.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new p.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new II(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class FI extends p.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new p.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new kI(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class iw extends p.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new TI(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new FI(e,this))}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class rw extends p.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(p.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(a=>a[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(a=>a[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const a=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let c of a){const[h,u,A,f]=c;try{(async()=>{const{scene:d,camera:g}=i,v=Xe(h),y=g.getPickRay(v);do{if(!y)break;let m;if(u?m=await d.pickFromRayMostDetailed(y,this.objectsToExclude):m=d.pickFromRay(y,this.objectsToExclude),!m||!m.position)break;const w=Ue(m.position);if(!w){f(new Error("positionFromCartesian failed"));return}A(w);return}while(!1);if(y&&!(d.terrainProvider instanceof C.EllipsoidTerrainProvider)){const m=d.globe.pick(y,d);if(!m){f(new Error("scene.globe.pick failed"));return}const w=Ue(m);if(!w){f(new Error("positionFromCartesian failed"));return}this.pickHeightMustGreaterThanZero&&w[2]<0&&(w[2]=0),A(w);return}{const m=d.terrainProvider instanceof C.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,w=i.camera.pickEllipsoid(Xe(h),m);if(!w){f(new Error("Pick failed"));return}const _=Ue(w);if(!_){f(new Error("positionFromCartesian failed"));return}A(_)}})()}catch(d){f(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let c of l){const[h,u,A,f,d]=c;e.pickCustomAttachedInfo=A;try{(async()=>{var E,T,P;let g=i.scene.pick(Xe(h),u&&u[0],u&&u[1]);!g&&C.defined(i.scene.globe)&&(g=await BI(i,Xe(h)));let v;if(g&&g instanceof C.Cesium3DTileFeature){v={};try{g&&g.getPropertyIds().forEach(D=>{v&&(v[D]=g.getProperty(D))})}catch(k){console.warn(k)}}let y;do{if(!g)break;if(g.id&&g.id instanceof C.Entity&&g.id.ESSceneObjectID){y=g.id.ESSceneObjectID;break}if(g.primitive&&g.primitive.ESSceneObjectID){y=g.primitive.ESSceneObjectID;break}if(Array.isArray(g)&&g[0]instanceof C.ImageryLayerFeatureInfo){y=g[0].imageryLayer.ESSceneObjectID;break}}while(!1);let m=y?Q.ESSceneObject.getSceneObject(y):void 0;m&&m.parentID&&(m=Q.ESSceneObject.getSceneObject(m.parentID));let w={};if(m&&Reflect.has(m,"allowPicking")&&Reflect.has(m,"pickedEvent")&&(m.allowPicking??!1)){do{if(m instanceof Q.ESEntityCluster){const k=new C.JulianDate;w=g.id instanceof C.Entity?{name:g.id.label.text.getValue(k),properties:(E=g.id.properties)==null?void 0:E.getValue(k),coordinates:Gs(g.id.position.getValue(k))}:(T=g.id)==null?void 0:T.map(D=>{var B;return{name:D.id,properties:(B=D.properties)==null?void 0:B.getValue(k),coordinates:Gs(D.position.getValue(k))}});break}if(m instanceof Q.ESGeoJson){const k=new C.JulianDate;if(!g.id.entityCollection)return;const D=g.id.polygon?"Polygon":g.id.polyline?"LineString":"Point",B=((P=g.id.properties)==null?void 0:P.getValue(k))??{},S=D=="Point"?Ue(g.id.position.getValue(k)):D=="LineString"?g.id.polyline.positions.getValue(k).map(I=>Ue(I)):Wf(g.id.polygon.hierarchy.getValue(k));w=m.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:D,coordinates:S},properties:B}:{type:D,coordinates:S,properties:B};break}if(m instanceof Q.ESGltfModel){let k;Reflect.has(g,"featureId")?k=g.featureId:Reflect.has(g,"instanceId")&&(k=g.instanceId),k&&(g.id=g.primitive.structuralMetadata.getPropertyTable(0).getProperty(g.instanceId,"id"))}}while(!1);m.pickedEvent.emit(new Q.ESJPickedResult(g,m,v,w,A,h))}m&&Reflect.has(m,"allowPicking")&&!m.allowPicking&&f(new Q.ESJPickedResult);const _=new Q.ESJPickedResult(g,m,v,w,A,h);f(_)})()}catch(g){d(g)}}};let r=i.scene.postRender.addEventListener(o);const s=()=>{r&&r(),r=void 0};this.ad(s),this.ad(this.pauseChanged.don(a=>{a?s():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,s)=>{this._pickTasks.push([e,i,o,r,s])})}}function BI(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(C.defined(o))return o}class MI extends p.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(p.react(!1)));L(this,"_cursorPosition",p.react(void 0));L(this,"quickPickPosition",!0);let i=new p.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const s=Tn(e);if(!s)return;i=new p.Destroyable;const a=i.disposeVar(p.react(void 0)),l=i.disposeVar(p.createNextAnimateFrameEvent(a.changed));i.dispose(s.czmViewer.pointerMoveEvent.disposableOn(h=>{h.pointerEvent&&(a.value=p.getDomEventCurrentTargetPos(h.pointerEvent))}));const c=i.disposeVar(p.createProcessingFromAsyncFunc(async h=>{if(s.pickingManager&&a.value)if(this.quickPickPosition){const u=await h.promise(p.createCancelablePromise(s.pickingManager.quickPickPosition(a.value)));this._cursorPosition.value=u}else{const u=await h.promise(p.createCancelablePromise(s.pickingManager.pickPosition(a.value)));this._cursorPosition.value=u}}));i.dispose(l.disposableOn(()=>{c.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function Tn(t){return p.getExtProp(t,"_viewerExtensions")}function md(t,n){p.setExtProp(t,"_viewerExtensions",n)}class ow extends p.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new iw(this.viewer)),this._terrainManager=this.dv(new tw(this.viewer)),this._labelManager=this.dv(new nw(this.viewer)),this._poiContext=this.disposeVar(new Ew(this._viewer)),this._cursorPositionInfo=this.disposeVar(new MI(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new rw(i))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var aw=new C.Cartesian3,sw=new C.Cartesian3;function lw(t,n,e){let i=C.Matrix4.clone(t.transform);t.lookAtTransform(C.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,s=C.Cartesian3.normalize(r,aw),a=C.Cartesian3.dot(t.direction,s);if(a>-.9&&a<.9)var l=C.Cartesian3.cross(t.direction,s,sw);else var l=C.Cartesian3.cross(t.up,s,sw);var c=l;if(e){var h=C.Cartesian3.cross(s,l,aw);c=h}var u=C.Cartesian3.magnitude(r);t.rotate(c,n/u);var A=t.positionCartographic,f=A.longitude,d=A.latitude;C.Cartesian3.fromRadians(f,d,o,void 0,t.position),t.lookAtTransform(i)}function uw(t,n){lw(t,n,!1)}function cw(t,n){lw(t,-n,!0)}class DI extends p.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(s=>{const{keyStatusMap:a}=this.running.keyboardCameraController;a[s.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:a[s.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(s=>{const{keyStatusMap:a}=this.running.keyboardCameraController;a[s.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:s}=this;let a=Date.now();const l=()=>{const c=Date.now(),h=c-a;a=c;const u=this.controller.speed;s.WithCamera||this.controller.alwaysWithCamera?(s.MoveForward&&r.moveForward(h*u),s.MoveBackword&&r.moveBackward(h*u),s.MoveLeft&&r.moveLeft(h*u),s.MoveRight&&r.moveRight(h*u)):(s.MoveForward&&uw(r,h*u),s.MoveBackword&&uw(r,-h*u),s.MoveLeft&&cw(r,-h*u),s.MoveRight&&cw(r,h*u));{const{rotateSpeed:A}=this.controller,f=C.Math.toRadians(A*h);s.RotateRight?r.lookRight(f):s.RotateLeft?r.lookRight(-f):s.RotateUp?r.lookDown(-f):s.RotateDown&&r.lookDown(f)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let s of i.currentKeyIds)o[r[s]]=!0}}class dh extends p.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new p.Event));L(this,"_debug",this.dv(p.react(!1)));L(this,"_debugResetting",this.dv(new p.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends p.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
170
|
-
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const s=dh.getKeyId(r);this._currentKeyIds.has(s)||(this._currentKeyIds.add(s),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const s=dh.getKeyId(r);this._currentKeyIds.has(s)&&(this._currentKeyIds.delete(s),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class RI extends p.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new dh(this)),this._cameraOp=this.dv(new DI(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const xf=class xf extends p.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(p.react(!1)));L(this,"_keyStatusMap",this.dv(p.react(xf.defaultKeyStatusMap)));L(this,"_speed",this.dv(p.react(1)));L(this,"_rotateSpeed",this.dv(p.react(.01)));L(this,"_alwaysWithCamera",this.dv(p.react(!1)));L(this,"_keyDownEvent",this.dv(new p.Event));L(this,"_keyUpEvent",this.dv(new p.Event));L(this,"_abortEvent",this.dv(new p.Event));this._firstPersonController=e,this.dv(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new RI(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(xf,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let ph=xf;function UI(t,n){t.lookRight(C.Math.toRadians(n.movementX)*.1),t.lookDown(C.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=C.Math.clamp(e,-C.Math.PI_OVER_TWO,C.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class OI extends p.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:s}=this._firstPersonController.viewer.scene;UI(s,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const Sf=class Sf extends p.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new OI(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Sf.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(Sf,"origin_setPointerCapture",Element.prototype.setPointerCapture);let gd=Sf;class LI extends p.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(p.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new gd(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class zI extends p.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new LI(this)));L(this,"_keyboardCameraController",this.dv(new ph(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function hw(t){t.removeInputAction(C.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(C.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(C.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(C.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(C.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(C.ScreenSpaceEventType.MIDDLE_UP)}function yd(t,n,e,i=void 0){const r=t.camera,s=new C.Cartesian2;s.x=n.startPosition.x,s.y=0;const a=new C.Cartesian2;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,new C.Ray),c=r.getPickRay(a,new C.Ray),h=0,u,A;if(!l||!c)return;r.frustum instanceof C.OrthographicFrustum?(u=l.origin,A=c.origin,C.Cartesian3.add(r.direction,u,u),C.Cartesian3.add(r.direction,A,A),C.Cartesian3.subtract(u,r.position,u),C.Cartesian3.subtract(A,r.position,A),C.Cartesian3.normalize(u,u),C.Cartesian3.normalize(A,A)):(u=l.direction,A=c.direction);let f=C.Cartesian3.dot(u,A);f<1&&(h=Math.acos(f)),h=n.startPosition.x>n.endPosition.x?h:-h;const d=e._horizontalRotationAxis;if(C.defined(i)?r.look(i,-h):C.defined(d)?r.look(d,-h):r.lookLeft(h),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,new C.Ray),c=r.getPickRay(a,new C.Ray),h=0,!(!l||!c))if(r.frustum instanceof C.OrthographicFrustum?(u=l.origin,A=c.origin,C.Cartesian3.add(r.direction,u,u),C.Cartesian3.add(r.direction,A,A),C.Cartesian3.subtract(u,r.position,u),C.Cartesian3.subtract(A,r.position,A),C.Cartesian3.normalize(u,u),C.Cartesian3.normalize(A,A)):(u=l.direction,A=c.direction),f=C.Cartesian3.dot(u,A),f<1&&(h=Math.acos(f)),h=n.startPosition.y>n.endPosition.y?h:-h,i=C.defaultValue(i,d),C.defined(i)){const g=r.direction,v=C.Cartesian3.negate(i,new C.Cartesian3),y=C.Cartesian3.equalsEpsilon(g,i,C.Math.EPSILON2),m=C.Cartesian3.equalsEpsilon(g,v,C.Math.EPSILON2);if(!y&&!m){f=C.Cartesian3.dot(g,i);let w=C.Math.acosClamped(f);h>0&&h>w&&(h=w-C.Math.EPSILON4),f=C.Cartesian3.dot(g,v),w=C.Math.acosClamped(f),h<0&&-h>w&&(h=-w+C.Math.EPSILON4);const _=C.Cartesian3.cross(i,g,new C.Cartesian3);r.look(_,h)}else(y&&h<0||m&&h>0)&&r.look(r.right,-h)}else r.lookUp(h)}class QI extends p.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],s=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const u=dt(n.position),A=i.camera.positionWC,f=C.Cartesian3.distance(u,A);n.viewDistance=f}p.Vector.clone(n.position,s),n.offsetHeight&&(s[2]+=n.offsetHeight);const{rotation:a,offsetRotation:l=hi.defaults.offsetRotation}=n,c=[...l];p.Vector.set(r,0,0,0),a&&(n.relativeRotation??hi.defaults.relativeRotation)&&(p.Vector.add(a,r,r),c[0]+=90),p.Vector.add(c,r,r);const h={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(h,s)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(a=>{const l=a==null?void 0:a.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:c,movementY:h}=l;n.offsetRotation=p.Vector.add(n.offsetRotation??hi.defaults.offsetRotation,[c*.2,h*-.2,0])}})),this.d(e.wheelEvent.don(a=>{if(!n.enabledScaleInput)return;const l=a.deltaY,h=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+h}))}}class hi extends p.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new p.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const s=()=>{r&&(r.destroy(),r=void 0)};this.d(s);const a=()=>{s(),o.enabled&&(r=new QI(o,e))};a(),this.d(o.enabledChanged.don(a)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const c=ma(i.camera);if(!c)return;const h=o.rotation;o.offsetRotation=[c[0]-(o.relativeRotation?h[0]:90),c[1]-(o.relativeRotation?h[1]:0),c[2]-(o.relativeRotation?h[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(hi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArrayWithUndefined(void 0),positionEditing:!1,rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:p.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(hi||(hi={})),p.extendClassProps(hi.prototype,hi.createDefaultProps);class el extends p.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new hi(e)),this._geoPolylinePath=this.dv(new hs(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(p.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(p.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(p.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(p.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(p.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(p.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new p.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new VI(this,e);if(this.lineMode==="manual")return new NI(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:p.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(el||(el={})),p.extendClassProps(el.prototype,el.createDefaultProps);class VI extends p.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class NI extends p.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class HI extends p.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",s=e.rotationChangedPropertyName??r+"Changed",a=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,s);if(!(!a&&!l)){if(a){const c=()=>{e.geoCameraController.position=n[i]};c();const h=n[o];this.d(h.don(c))}if(l){const c=()=>{e.geoCameraController.rotation=n[r]};c();const h=n[o];this.d(h.don(c))}}}}class GI extends p.Destroyable{constructor(n,e){super();const i=this.dv(new Q.ESSceneObjectWithId);i.id=n;const o=this.dv(p.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new p.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new HI(r,e)}))}}class tl extends p.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new hi(e)),this.d(p.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new p.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new GI(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(tl||(tl={})),p.extendClassProps(tl.prototype,tl.createDefaultProps);class WI extends p.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new C.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},C.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:C.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*C.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,s)=>{if(!o){o=new Date().getTime();return}const a=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+a*C.Math.PI*2/this.cycle;e.setView({destination:C.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*C.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class qI extends p.Destroyable{constructor(e){super();L(this,"_height",this.dv(p.react(1e7)));L(this,"_cycle",this.dv(p.react(60)));L(this,"_latitude",this.dv(p.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new WI(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class KI extends p.Destroyable{constructor(e){super();L(this,"_position",this.dv(p.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(p.react(5e4)));L(this,"_cycle",this.dv(p.react(60)));L(this,"_heading",this.dv(p.react(0)));L(this,"_pitch",this.dv(p.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new C.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let s;if(this.position==null){var a=o.getPickRay(new C.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!a)return;s=i.globe.pick(a,i)}else s=C.Cartesian3.fromDegrees(...this.position);s&&(this._transform=C.Transforms.eastNorthUpToFixedFrame(s),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=C.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=C.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new C.Cartesian3(0,i,o);e.flyTo({destination:C.Matrix4.multiplyByPoint(this._transform,r,new C.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let s;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((a,l)=>{if(!s){s=new Date().getTime();return}const c=(new Date().getTime()-s)/1e3;this._headingRadius+=c*C.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new C.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),s=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(C.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class ZI extends p.Destroyable{constructor(e){super();L(this,"_position",this.dv(p.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(p.react(5e4)));L(this,"_cycle",this.dv(p.react(60)));L(this,"_heading",this.dv(p.react(0)));L(this,"_pitch",this.dv(p.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new KI(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class XI extends p.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new zI(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=ph.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new qI(e)),this._rotatePoint=this.dv(new ZI(e)),this._followController=this.dv(new tl(e)),this._pathCameraController=this.dv(new el(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2){this.resetNavigation(),this._changedMouseEvent("Walk");const o=this._viewer.getCameraInfo(),r=[(o==null?void 0:o.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(s=>{this._viewer.flyIn([e[0],e[1],(s??0)+1],r),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,s=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=s,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,s=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=s,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,s=10,a="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=a==="auto",c=Q.ESSceneObject.getSceneObjById(e);if(!c)return;const{points:h}=c;if(!h)return;const u=Q.getDistancesFromPositions(h,"NONE"),A=u[u.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...h],this._pathCameraController.polylinePath.duration=A/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const f=_0(h);this._pathCameraController.polylinePath.rotationRadius=!l||f==!1?[0]:f.map(d=>d/s*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=a,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new C.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&hw(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(s=>{o.setInputAction(a=>{yd(i.scene,a,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(a=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.LEFT_UP)},C.ScreenSpaceEventType.LEFT_UP)},C.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(s=>{o.setInputAction(a=>{yd(i.scene,a,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(a=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.RIGHT_UP)},C.ScreenSpaceEventType.RIGHT_UP)},C.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(s=>{o.setInputAction(a=>{yd(i.scene,a,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(a=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.MIDDLE_UP)},C.ScreenSpaceEventType.MIDDLE_UP)},C.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&hw(o),r.lookEventTypes=C.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=C.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[C.CameraEventType.MIDDLE_DRAG,C.CameraEventType.PINCH,{eventType:C.CameraEventType.LEFT_DRAG,modifier:C.KeyboardEventModifier.CTRL},{eventType:C.CameraEventType.RIGHT_DRAG,modifier:C.KeyboardEventModifier.CTRL}],r.translateEventTypes=C.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[C.CameraEventType.WHEEL,C.CameraEventType.PINCH,{eventType:C.CameraEventType.RIGHT_DRAG,modifier:C.KeyboardEventModifier.SHIFT}])}}const $I=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class YI extends p.Destroyable{constructor(e){super();L(this,"_show",this.dv(p.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new C.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=a=>({slice:a.slice,brightness:a.brightness,scale:Xe(a.scale),maximumSize:$n(a.maximumSize),color:Ie(a.color),position:dt(a.position)});(()=>{o.removeAll();for(let a of $I)o.add(r(a))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class nl extends p.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(C.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(nl||(nl={})),p.extendClassProps(nl.prototype,nl.createDefaultProps);const JI=`
|
|
170
|
+
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const s=dh.getKeyId(r);this._currentKeyIds.has(s)||(this._currentKeyIds.add(s),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const s=dh.getKeyId(r);this._currentKeyIds.has(s)&&(this._currentKeyIds.delete(s),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class RI extends p.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new dh(this)),this._cameraOp=this.dv(new DI(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const xf=class xf extends p.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(p.react(!1)));L(this,"_keyStatusMap",this.dv(p.react(xf.defaultKeyStatusMap)));L(this,"_speed",this.dv(p.react(1)));L(this,"_rotateSpeed",this.dv(p.react(.01)));L(this,"_alwaysWithCamera",this.dv(p.react(!1)));L(this,"_keyDownEvent",this.dv(new p.Event));L(this,"_keyUpEvent",this.dv(new p.Event));L(this,"_abortEvent",this.dv(new p.Event));this._firstPersonController=e,this.dv(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new RI(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(xf,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let ph=xf;function UI(t,n){t.lookRight(C.Math.toRadians(n.movementX)*.1),t.lookDown(C.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=C.Math.clamp(e,-C.Math.PI_OVER_TWO,C.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class OI extends p.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:s}=this._firstPersonController.viewer.scene;UI(s,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const Sf=class Sf extends p.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new OI(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Sf.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(Sf,"origin_setPointerCapture",Element.prototype.setPointerCapture);let gd=Sf;class LI extends p.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(p.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new gd(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class zI extends p.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new LI(this)));L(this,"_keyboardCameraController",this.dv(new ph(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function hw(t){t.removeInputAction(C.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(C.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(C.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(C.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(C.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(C.ScreenSpaceEventType.MIDDLE_UP)}function yd(t,n,e,i=void 0){const r=t.camera,s=new C.Cartesian2;s.x=n.startPosition.x,s.y=0;const a=new C.Cartesian2;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,new C.Ray),c=r.getPickRay(a,new C.Ray),h=0,u,A;if(!l||!c)return;r.frustum instanceof C.OrthographicFrustum?(u=l.origin,A=c.origin,C.Cartesian3.add(r.direction,u,u),C.Cartesian3.add(r.direction,A,A),C.Cartesian3.subtract(u,r.position,u),C.Cartesian3.subtract(A,r.position,A),C.Cartesian3.normalize(u,u),C.Cartesian3.normalize(A,A)):(u=l.direction,A=c.direction);let f=C.Cartesian3.dot(u,A);f<1&&(h=Math.acos(f)),h=n.startPosition.x>n.endPosition.x?h:-h;const d=e._horizontalRotationAxis;if(C.defined(i)?r.look(i,-h):C.defined(d)?r.look(d,-h):r.lookLeft(h),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,new C.Ray),c=r.getPickRay(a,new C.Ray),h=0,!(!l||!c))if(r.frustum instanceof C.OrthographicFrustum?(u=l.origin,A=c.origin,C.Cartesian3.add(r.direction,u,u),C.Cartesian3.add(r.direction,A,A),C.Cartesian3.subtract(u,r.position,u),C.Cartesian3.subtract(A,r.position,A),C.Cartesian3.normalize(u,u),C.Cartesian3.normalize(A,A)):(u=l.direction,A=c.direction),f=C.Cartesian3.dot(u,A),f<1&&(h=Math.acos(f)),h=n.startPosition.y>n.endPosition.y?h:-h,i=C.defaultValue(i,d),C.defined(i)){const g=r.direction,v=C.Cartesian3.negate(i,new C.Cartesian3),y=C.Cartesian3.equalsEpsilon(g,i,C.Math.EPSILON2),m=C.Cartesian3.equalsEpsilon(g,v,C.Math.EPSILON2);if(!y&&!m){f=C.Cartesian3.dot(g,i);let w=C.Math.acosClamped(f);h>0&&h>w&&(h=w-C.Math.EPSILON4),f=C.Cartesian3.dot(g,v),w=C.Math.acosClamped(f),h<0&&-h>w&&(h=-w+C.Math.EPSILON4);const _=C.Cartesian3.cross(i,g,new C.Cartesian3);r.look(_,h)}else(y&&h<0||m&&h>0)&&r.look(r.right,-h)}else r.lookUp(h)}class QI extends p.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],s=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const u=dt(n.position),A=i.camera.positionWC,f=C.Cartesian3.distance(u,A);n.viewDistance=f}p.Vector.clone(n.position,s),n.offsetHeight&&(s[2]+=n.offsetHeight);const{rotation:a,offsetRotation:l=hi.defaults.offsetRotation}=n,c=[...l];p.Vector.set(r,0,0,0),a&&(n.relativeRotation??hi.defaults.relativeRotation)&&(p.Vector.add(a,r,r),c[0]+=90),p.Vector.add(c,r,r);const h={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(h,s)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(a=>{const l=a==null?void 0:a.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:c,movementY:h}=l;n.offsetRotation=p.Vector.add(n.offsetRotation??hi.defaults.offsetRotation,[c*.2,h*-.2,0])}})),this.d(e.wheelEvent.don(a=>{if(!n.enabledScaleInput)return;const l=a.deltaY,h=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+h}))}}class hi extends p.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new p.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const s=()=>{r&&(r.destroy(),r=void 0)};this.d(s);const a=()=>{s(),o.enabled&&(r=new QI(o,e))};a(),this.d(o.enabledChanged.don(a)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const c=ma(i.camera);if(!c)return;const h=o.rotation;o.offsetRotation=[c[0]-(o.relativeRotation?h[0]:90),c[1]-(o.relativeRotation?h[1]:0),c[2]-(o.relativeRotation?h[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(hi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArrayWithUndefined(void 0),positionEditing:!1,rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:p.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(hi||(hi={})),p.extendClassProps(hi.prototype,hi.createDefaultProps);class el extends p.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new hi(e)),this._geoPolylinePath=this.dv(new hs(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(p.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(p.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(p.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(p.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(p.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(p.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new p.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new VI(this,e);if(this.lineMode==="manual")return new NI(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:p.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(el||(el={})),p.extendClassProps(el.prototype,el.createDefaultProps);class VI extends p.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class NI extends p.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class HI extends p.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",s=e.rotationChangedPropertyName??r+"Changed",a=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,s);if(!(!a&&!l)){if(a){const c=()=>{e.geoCameraController.position=n[i]};c();const h=n[o];this.d(h.don(c))}if(l){const c=()=>{e.geoCameraController.rotation=n[r]};c();const h=n[o];this.d(h.don(c))}}}}class GI extends p.Destroyable{constructor(n,e){super();const i=this.dv(new Q.ESSceneObjectWithId);i.id=n;const o=this.dv(p.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new p.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new HI(r,e)}))}}class tl extends p.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new hi(e)),this.d(p.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new p.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new GI(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(tl||(tl={})),p.extendClassProps(tl.prototype,tl.createDefaultProps);class WI extends p.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new C.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},C.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:C.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*C.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,s)=>{if(!o){o=new Date().getTime();return}const a=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+a*C.Math.PI*2/this.cycle;e.setView({destination:C.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*C.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class qI extends p.Destroyable{constructor(e){super();L(this,"_height",this.dv(p.react(1e7)));L(this,"_cycle",this.dv(p.react(60)));L(this,"_latitude",this.dv(p.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new WI(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class KI extends p.Destroyable{constructor(e){super();L(this,"_position",this.dv(p.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(p.react(5e4)));L(this,"_cycle",this.dv(p.react(60)));L(this,"_heading",this.dv(p.react(0)));L(this,"_pitch",this.dv(p.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new C.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let s;if(this.position==null){var a=o.getPickRay(new C.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!a)return;s=i.globe.pick(a,i)}else s=C.Cartesian3.fromDegrees(...this.position);s&&(this._transform=C.Transforms.eastNorthUpToFixedFrame(s),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=C.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=C.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new C.Cartesian3(0,i,o);e.flyTo({destination:C.Matrix4.multiplyByPoint(this._transform,r,new C.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let s;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((a,l)=>{if(!s){s=new Date().getTime();return}const c=(new Date().getTime()-s)/1e3;this._headingRadius+=c*C.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new C.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),s=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(C.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class ZI extends p.Destroyable{constructor(e){super();L(this,"_position",this.dv(p.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(p.react(5e4)));L(this,"_cycle",this.dv(p.react(60)));L(this,"_heading",this.dv(p.react(0)));L(this,"_pitch",this.dv(p.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new KI(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class XI extends p.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new zI(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=ph.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new qI(e)),this._rotatePoint=this.dv(new ZI(e)),this._followController=this.dv(new tl(e)),this._pathCameraController=this.dv(new el(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation(),this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),s=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(a=>{this._viewer.flyIn([e[0],e[1],(a??0)+o],s),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,s=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=s,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,s=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=s,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,s=10,a="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=a==="auto",c=Q.ESSceneObject.getSceneObjById(e);if(!c)return;const{points:h}=c;if(!h)return;const u=Q.getDistancesFromPositions(h,"NONE"),A=u[u.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...h],this._pathCameraController.polylinePath.duration=A/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const f=_0(h);this._pathCameraController.polylinePath.rotationRadius=!l||f==!1?[0]:f.map(d=>d/s*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=a,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new C.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&hw(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(s=>{o.setInputAction(a=>{yd(i.scene,a,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(a=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.LEFT_UP)},C.ScreenSpaceEventType.LEFT_UP)},C.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(s=>{o.setInputAction(a=>{yd(i.scene,a,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(a=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.RIGHT_UP)},C.ScreenSpaceEventType.RIGHT_UP)},C.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(s=>{o.setInputAction(a=>{yd(i.scene,a,r)},C.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(a=>{o.removeInputAction(C.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(C.ScreenSpaceEventType.MIDDLE_UP)},C.ScreenSpaceEventType.MIDDLE_UP)},C.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&hw(o),r.lookEventTypes=C.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=C.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[C.CameraEventType.MIDDLE_DRAG,C.CameraEventType.PINCH,{eventType:C.CameraEventType.LEFT_DRAG,modifier:C.KeyboardEventModifier.CTRL},{eventType:C.CameraEventType.RIGHT_DRAG,modifier:C.KeyboardEventModifier.CTRL}],r.translateEventTypes=C.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[C.CameraEventType.WHEEL,C.CameraEventType.PINCH,{eventType:C.CameraEventType.RIGHT_DRAG,modifier:C.KeyboardEventModifier.SHIFT}])}}const $I=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class YI extends p.Destroyable{constructor(e){super();L(this,"_show",this.dv(p.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new C.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=a=>({slice:a.slice,brightness:a.brightness,scale:Xe(a.scale),maximumSize:$n(a.maximumSize),color:Ie(a.color),position:dt(a.position)});(()=>{o.removeAll();for(let a of $I)o.add(r(a))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class nl extends p.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(C.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(nl||(nl={})),p.extendClassProps(nl.prototype,nl.createDefaultProps);const JI=`
|
|
171
171
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
172
172
|
{
|
|
173
173
|
float depth = czm_unpackDepth(texture(depthTexture, texCoords));
|
|
@@ -466,7 +466,7 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
466
466
|
`;function Hk(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
467
467
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
468
468
|
gitee地址:${t}
|
|
469
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Qt=class Qt extends Q.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(p.react(0)));L(this,"_viewer",this.dv(p.react(void 0)));L(this,"_viewerInstance");L(this,"_cameraChanged",this.dv(new p.Event));L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(p.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(p.react(0)));L(this,"_editingSystem",this.ad(EE()));L(this,"_moveObjectsProcess",this.ad(PE()));if(this.ad(new CP(this)),this.ad(new xP(this)),this.dv(new p.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new TP(this)})),this._viewerLegend=this.dv(new Ok(this)),this._viewerInstance=this.dv(new p.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bd(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=Ie([1,1,1,1]))})),e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");const i=e;this.d(this._viewer.changed.don(()=>{this.actived=!0,this.viewerChanged.emit(this.viewer)}));const o=this.disposeVar(p.createNextAnimateFrameEvent(this.subContainerChanged));this.dv(new p.ObjResettingWithEvent(o,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new EI(this.subContainer,this,r=>this._viewer.value=r,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&&Tn(this.viewer)}get viewerInstance(){return this._viewerInstance}get cameraChanged(){return this._cameraChanged}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)}getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=C.Cartographic.fromDegrees(e[0],e[1],e[2],Qt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xn(e),rotation:ma(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const s=C.Cartesian3.fromDegrees(...e),a=C.Cartesian3.distance(o.positionWC,s),l=C.Cartesian3.subtract(s,r,new C.Cartesian3);C.Cartesian3.normalize(l,l);const c=C.Transforms.rotationMatrixFromPositionVelocity(r,l,C.Ellipsoid.WGS84),h=C.Matrix4.fromRotationTranslation(c,r);var u=C.Transforms.eastNorthUpToFixedFrame(C.Matrix4.getTranslation(h,new C.Cartesian3),C.Ellipsoid.WGS84,new C.Matrix4),A=C.Matrix4.multiply(C.Matrix4.inverse(u,new C.Matrix4),h,new C.Matrix4),f=C.Matrix4.getMatrix3(A,new C.Matrix3),d=C.Quaternion.fromRotationMatrix(f),g=C.HeadingPitchRoll.fromQuaternion(d);const v=ma(o);return{distance:a,heading:C.Math.toDegrees(g.heading)+90,pitch:C.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(C.Math.toDegrees(g.heading)+90)),pDelta:v[1]-C.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;const s={position:e,rotation:i,duration:(o??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&js(a,s)}flyTo(e,i,o="default"){var f;const{distance:r,heading:s,pitch:a,flyDuration:l,hDelta:c,pDelta:h}=e,u={position:i,viewDistance:r,rotation:[s,a,0],duration:l*1e3,hdelta:c,pdelta:h},A=(f=this.viewer)==null?void 0:f.camera;return A&&js(A,u)}flyToBoundingSphere(e,i,o=1){var u;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=Q.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:l}=s,c={position:a,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},h=(u=this.viewer)==null?void 0:u.camera;return h&&js(h,c)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xn(e),rotation:ma(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2){var o,r;(r=(o=this._viewerInstance)==null?void 0:o.obj)==null||r.navigationManager.changeToWalk(e,i),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,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,s,a){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToLine(e,i,o,r,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式",e)}changeToRotatePoint(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){return window.g_XE3CopyRights??{}}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=C.Cartographic.fromDegrees(e,i,void 0,Qt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)}async getHeightsByLonLats(e,i){const o=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await M0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(dt(e));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.combinationClass?e.getMainClass():e;r&&(console.log(i,"这是Cesium的模式"),i!=null&&(r.editingID=`${o.callSource}_${p.createGuid()}`,this._editingSystem.restart(void 0,this,r,i,o.useKeyToSwitch)))}stopEditing(){this._editingSystem.isRunning&&this._editingSystem.cancel()}moveObjects(e){const i=[],o=p.createGuid();for(let r=0;r<e.length;r++){const s=e[r],a=s.combinationClass?s.getMainClass():s;a.editingID=o,a&&i.push(a)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Qt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Qt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Qt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return pn(e,i)}localPositionsToPositions(e,i){return vr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=dt(e),o=new C.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)}getProperties(){const e=Qt.defaults;return[...super.getProperties(),new Q.GroupProperty("通用","通用",[new Q.EvalStringProperty("CesiumViewer创建函数","CesiumViewer创建函数",!0,!1,[this,"createCesiumViewerFuncStr"],Nk,Vk),new Q.FunctionProperty("获取官方token","获取官方token",[],()=>Qt.getCesiumIonToken(),[]),new Q.FunctionProperty("当前token","重置为当前使用的Cesium版本的token",[],()=>this.setCurrentDefaultAccessToken(),[]),new Q.FunctionProperty("最新token","充值为当前Cesium官方的最新token",[],()=>this.setLatestDefaultAccessToken(),[]),new Q.BooleanProperty("头顶灯","设置为头顶灯,false时为太阳光",!0,!1,[this,"flashLighting"]),new Q.BooleanProperty("粒子全局控制播放","粒子全局控制播放",!0,!1,[this,"particleGlobalControl"])]),new Q.GroupProperty("Viewer","Viewer",[new Q.NumberProperty("分辨率比率","分辨率比率",!0,!1,[this,"resolutionScale"],e.resolutionScale),new Q.NumberProperty("msaaSamples","msaaSamples",!0,!1,[this,"msaaSamples"],e.msaaSamples),new Q.BooleanProperty("shadows","shadows",!1,!1,[this,"shadows"]),new Q.GroupProperty("比例尺","比例尺(Legend)",[new Q.NumberProperty("resolution","resolution",!0,!0,[this.viewerLegend,"resolution"]),new Q.NumberProperty("zoom","zoom",!0,!0,[this.viewerLegend,"zoom"]),new Q.Number3Property("center","center",!0,!0,[this.viewerLegend,"center"]),new Q.NumberProperty("lengthInPixels","lengthInPixels",!0,!1,[this.viewerLegend.legend,"lengthInPixels"]),new Q.NumberProperty("computedLengthInPixels","computedLengthInPixels",!0,!0,[this.viewerLegend.legend,"computedLengthInPixels"]),new Q.NumberProperty("computedLengthInMeters","computedLengthInMeters",!0,!0,[this.viewerLegend.legend,"computedLengthInMeters"]),new Q.StringProperty("computedLengthInStr","computedLengthInStr",!0,!0,[this.viewerLegend.legend,"computedLengthInStr"])]),new Q.GroupProperty("场景","场景(Scene)",[new Q.NumberProperty("内部视口分割比例","内部视口分割比例",!0,!1,[this,"sceneSplitPosition"],e.sceneSplitPosition),new Q.GroupProperty("Globe","Globe",[new Q.BooleanProperty("depthTestAgainstTerrain","depthTestAgainstTerrain",!0,!1,[this,"depthTestAgainstTerrain"],e.depthTestAgainstTerrain),new Q.EnumProperty("sceneGlobeShadows","sceneGlobeShadows",!0,!1,[this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],e.sceneGlobeShadows),new Q.NumberProperty("sceneGlobeTerrainExaggeration","sceneGlobeTerrainExaggeration,Cesium1.116废弃",!1,!1,[this,"sceneGlobeTerrainExaggeration"]),new Q.NumberProperty("sceneGlobeTerrainExaggerationRelativeHeight","sceneGlobeTerrainExaggerationRelativeHeight,Cesium1.116废弃",!1,!1,[this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new Q.NumberProperty("sceneGlobeVerticalExaggeration","sceneGlobeVerticalExaggeration",!1,!1,[this,"sceneGlobeVerticalExaggeration"]),new Q.NumberProperty("sceneGlobeVerticalExaggerationRelativeHeight","sceneGlobeVerticalExaggerationRelativeHeight",!1,!1,[this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new Q.BooleanProperty("sceneGlobeBackFaceCulling","sceneGlobeBackFaceCulling",!1,!1,[this,"sceneGlobeBackFaceCulling"]),new Q.BooleanProperty("sceneGlobeShowSkirts","sceneGlobeShowSkirts",!1,!1,[this,"sceneGlobeShowSkirts"]),new Q.BooleanProperty("sceneGlobeShowWaterEffect","sceneGlobeShowWaterEffect",!1,!1,[this,"sceneGlobeShowWaterEffect"]),new Q.ColorProperty("sceneGlobeBaseColor","sceneGlobeBaseColor",!1,!1,[this,"sceneGlobeBaseColor"]),new Q.Number4Property("sceneGlobeCartographicLimitRectangle","sceneGlobeCartographicLimitRectangle",!1,!1,[this,"sceneGlobeCartographicLimitRectangle"]),new Q.JsonProperty("sceneGlobeClippingPlanes","sceneGlobeClippingPlanes",!1,!1,[this,"sceneGlobeClippingPlanes"]),new Q.StringProperty("sceneGlobeClippingPlanesId","sceneGlobeClippingPlanesId",!1,!1,[this,"sceneGlobeClippingPlanesId"]),new Q.JsonProperty("sceneGlobeClippingPolygons","sceneGlobeClippingPolygons",!1,!1,[this,"sceneGlobeClippingPolygons"]),new Q.StringsProperty("sceneGlobeClippingPolygonsId","sceneGlobeClippingPolygonsId",!1,!1,[this,"sceneGlobeClippingPolygonsId"]),new Q.GroupProperty("Underground","Underground",[new Q.ColorProperty("sceneGlobeUndergroundColor","sceneGlobeUndergroundColor",!0,!1,[this,"sceneGlobeUndergroundColor"],e.sceneGlobeUndergroundColor),new Q.Number4Property("sceneGlobeUndergroundColorAlphaByDistance","sceneGlobeUndergroundColorAlphaByDistance",!0,!1,[this,"sceneGlobeUndergroundColorAlphaByDistance"],e.sceneGlobeUndergroundColorAlphaByDistance)]),new Q.GroupProperty("Translucency","Translucency",[new Q.BooleanProperty("启用","启用",!0,!1,[this,"sceneGlobeTranslucencyEnabled"],e.sceneGlobeTranslucencyEnabled),new Q.NumberProperty("背面透明度","背面透明度",!0,!1,[this,"sceneGlobeTranslucencyBackFaceAlpha"],e.sceneGlobeTranslucencyBackFaceAlpha),new Q.Number4Property("背面渐变透明度","背面渐变透明度",!0,!1,[this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],e.sceneGlobeTranslucencyBackFaceAlphaByDistance),new Q.NumberProperty("正面透明度","正面透明度",!0,!1,[this,"sceneGlobeTranslucencyFrontFaceAlpha"],e.sceneGlobeTranslucencyFrontFaceAlpha),new Q.Number4Property("正面渐变透明度","正面渐变透明度",!0,!1,[this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],e.sceneGlobeTranslucencyFrontFaceAlphaByDistance),new Q.Number4Property("矩形范围","矩形范围",!0,!1,[this,"sceneGlobeTranslucencyRectangle"],e.sceneGlobeTranslucencyRectangle)])]),new Q.GroupProperty("Sun","Sun",[new Q.BooleanProperty("sun","sun",!0,!1,[this,"sun"],e.sun),new Q.NumberProperty("sceneSunGlowFactor","sceneSunGlowFactor",!0,!1,[this,"sceneSunGlowFactor"],e.sceneSunGlowFactor)]),new Q.GroupProperty("Moon","Moon",[new Q.BooleanProperty("moon","moon",!0,!1,[this,"moon"],e.moon),new Q.StringProperty("sceneMoonTextureUrl","sceneMoonTextureUrl",!0,!1,[this,"sceneMoonTextureUrl"],e.sceneMoonTextureUrl),new Q.BooleanProperty("sceneMoonOnlySunLighting","sceneMoonOnlySunLighting",!0,!1,[this,"sceneMoonOnlySunLighting"],e.sceneMoonOnlySunLighting)]),new Q.GroupProperty("SkyBox","SkyBox",[new Q.BooleanProperty("sceneSkyBoxShow","sceneSkyBoxShow",!1,!1,[this,"sceneSkyBoxShow"]),new Q.JsonProperty("sceneSkyBoxSources","sceneSkyBoxSources",!0,!1,[this,"sceneSkyBoxSources"]),new Q.GroupProperty("Background","Background",[new Q.BooleanProperty("xbsjUseBackground","xbsjUseBackground",!1,!1,[this,"xbsjUseBackground"]),new Q.StringProperty("xbsjBackgroundImageUri","xbsjBackgroundImageUri",!1,!1,[this,"xbsjBackgroundImageUri"]),new Q.ColorProperty("xbsjBackgroundColor","xbsjBackgroundColor",!1,!1,[this,"xbsjBackgroundColor"])])]),new Q.GroupProperty("SkyAtmosphere","SkyAtmosphere",[new Q.JsonProperty("xbsjLocalBoxSources","xbsjLocalBoxSources",!0,!1,[this,"xbsjLocalBoxSources"],e.xbsjLocalBoxSources)]),new Q.ColorProperty("sceneBackgroundColor","sceneBackgroundColor",!1,!1,[this,"sceneBackgroundColor"]),new Q.GroupProperty("Fog","Fog",[new Q.BooleanProperty("sceneFogEnabled","sceneFogEnabled",!0,!1,[this,"sceneFogEnabled"],e.sceneFogEnabled),new Q.NumberProperty("sceneFogDensity","sceneFogDensity",!0,!1,[this,"sceneFogDensity"],e.sceneFogDensity),new Q.NumberProperty("sceneFogScreenSpaceErrorFactor","sceneFogScreenSpaceErrorFactor",!0,!1,[this,"sceneFogScreenSpaceErrorFactor"],e.sceneFogScreenSpaceErrorFactor),new Q.NumberProperty("sceneFogMinimumBrightness","sceneFogMinimumBrightness",!0,!1,[this,"sceneFogMinimumBrightness"],e.sceneFogMinimumBrightness)]),new Q.GroupProperty("Sscc","Sscc",[new Q.BooleanProperty("sceneSsccEnableInputs","sceneSsccEnableInputs",!0,!1,[this,"sceneSsccEnableInputs"],e.sceneSsccEnableInputs),new Q.BooleanProperty("sceneSsccEnableCollisionDetection","sceneSsccEnableCollisionDetection",!0,!1,[this,"sceneSsccEnableCollisionDetection"],e.sceneSsccEnableCollisionDetection),new Q.NumberProperty("sceneSsccZoomFactor","sceneSsccZoomFactor",!0,!1,[this,"sceneSsccZoomFactor"],e.sceneSsccZoomFactor)]),new Q.NumberProperty("相机广角","相机广角(sceneCameraFrustumFov)",!1,!1,[this,"sceneCameraFrustumFov"]),new Q.GroupProperty("后处理","后处理",[new Q.BooleanProperty("开启FXAA","开启FXAA",!0,!1,[this,"scenePpsfxaaEnabled"],e.scenePpsfxaaEnabled),new Q.GroupProperty("环境遮蔽","环境遮蔽",[new Q.BooleanProperty("Enabled","Enabled",!1,!1,[this,"scenePpsAmbientOcclusionEnabled"]),new Q.BooleanProperty("AmbientOcclusionOnly","AmbientOcclusionOnly",!1,!1,[this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new Q.NumberProperty("Intensity","Intensity",!1,!1,[this,"scenePpsAmbientOcclusionIntensity"]),new Q.NumberProperty("Bias","Bias",!1,!1,[this,"scenePpsAmbientOcclusionBias"]),new Q.NumberProperty("LengthCap","LengthCap",!1,!1,[this,"scenePpsAmbientOcclusionLengthCap"]),new Q.NumberProperty("StepSize","StepSize",!1,!1,[this,"scenePpsAmbientOcclusionStepSize"]),new Q.NumberProperty("BlurStepSize","BlurStepSize",!1,!1,[this,"scenePpsAmbientOcclusionBlurStepSize"])]),new Q.GroupProperty("Bloom","Bloom",[new Q.BooleanProperty("Enabled","Enabled",!1,!1,[this,"scenePpsBloomEnabled"]),new Q.BooleanProperty("GlowOnly","GlowOnly",!1,!1,[this,"scenePpsBloomGlowOnly"]),new Q.NumberProperty("Contrast","Contrast",!1,!1,[this,"scenePpsBloomContrast"]),new Q.NumberProperty("Brightness","Brightness",!1,!1,[this,"scenePpsBloomBrightness"]),new Q.NumberProperty("Delta","Delta",!1,!1,[this,"scenePpsBloomDelta"]),new Q.NumberProperty("Sigma","Sigma",!1,!1,[this,"scenePpsBloomSigma"]),new Q.NumberProperty("StepSize","StepSize",!1,!1,[this,"scenePpsBloomStepSize"])])]),new Q.GroupProperty("调试","调试",[new Q.BooleanProperty("sceneDebugShowFramesPerSecond","sceneDebugShowFramesPerSecond",!0,!1,[this,"sceneDebugShowFramesPerSecond"],e.sceneDebugShowFramesPerSecond),new Q.BooleanProperty("sceneDebugShowCommands","sceneDebugShowCommands",!0,!1,[this,"sceneDebugShowCommands"],e.sceneDebugShowCommands),new Q.BooleanProperty("sceneDebugShowFrustums","sceneDebugShowFrustums",!0,!1,[this,"sceneDebugShowFrustums"],e.sceneDebugShowFrustums),new Q.BooleanProperty("sceneDebugShowFrustumPlanes","sceneDebugShowFrustumPlanes",!0,!1,[this,"sceneDebugShowFrustumPlanes"],e.sceneDebugShowFrustumPlanes),new Q.NumberProperty("sceneDebugShowDepthFrustum","sceneDebugShowDepthFrustum",!0,!1,[this,"sceneDebugShowDepthFrustum"],e.sceneDebugShowDepthFrustum)])]),new Q.GroupProperty("Inspector","Inspector",[new Q.BooleanProperty("showCesiumInspector","showCesiumInspector",!0,!1,[this,"showCesiumInspector"],e.showCesiumInspector),new Q.BooleanProperty("cesiumInspectorWireframe","cesiumInspectorWireframe",!0,!1,[this,"cesiumInspectorWireframe"],e.cesiumInspectorWireframe),new Q.BooleanProperty("showCesium3DTilesInspector","showCesium3DTilesInspector",!0,!1,[this,"showCesium3DTilesInspector"],e.showCesium3DTilesInspector)])])]}};L(Qt,"type",Qt.register("ESCesiumViewer",Qt)),L(Qt,"getCesiumIonToken",Hk),L(Qt,"currentDefaultAccessToken",C.Ion.defaultAccessToken),L(Qt,"latestDefaultAccessToken"),L(Qt,"ObjectsToExcludeWrapper",PP),L(Qt,"defaults",{...Q.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,depthTestAgainstTerrain:!1,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha: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:C.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:C.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(Qt,"getHeightsScartchCarto",new C.Cartographic);let Ye=Qt;(t=>{t.createDefaultProps=()=>({...Q.ESViewer.createDefaultProps(),...Qk()})})(Ye||(Ye={})),p.extendClassProps(Ye.prototype,Ye.createDefaultProps);const zs=class zs extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_updateObjectsToExcludeWrapper",this.ad(new p.Event));const o=e.viewer;if(!o)return;const r=new C.PointPrimitiveCollection;let s;{const a=()=>{r&&(s&&r.remove(s),o.scene.primitives.remove(r),s=void 0)};this.ad(a),a(),s=r.add({}),C.PointPrimitive.prototype&&(s.ESSceneObjectID=i),o.scene.primitives.add(r)}{const a=this.ad(p.createNextAnimateFrameEvent(this.positionChanged,this.showChanged,this.pixelSizeChanged,this.colorChanged,this.outlineColorChanged,this.outlineWidthChanged,this.distanceDisplayConditionChanged,this.scaleByDistanceChanged,this.translucencyByDistanceChanged)),l=()=>{!s||!r||(s.show=(this.show??!0)&&!!this.position,this.position&&(s.position=dt(this.position)),s.pixelSize=this.pixelSize??1,s.color=Ie(this.color??zs.defaults.color),this.distanceDisplayCondition&&(s.distanceDisplayCondition=Ws(this.distanceDisplayCondition)),s.outlineColor=Ie(this.outlineColor??zs.defaults.outlineColor),s.outlineWidth=this.outlineWidth??zs.defaults.outlineWidth,this.scaleByDistance&&(s.scaleByDistance=fr(this.scaleByDistance)),this.translucencyByDistance&&(s.translucencyByDistance=fr(this.translucencyByDistance)))};l(),this.ad(a.don(l))}{const a=this.ad(p.createNextAnimateFrameEvent(this._updateObjectsToExcludeWrapper,this.allowPickingChanged));this.disposeVar(new p.ObjResettingWithEvent(a,()=>{if(!(this.allowPicking||!s))return new Ye.ObjectsToExcludeWrapper(e,s)}))}this.ad(this.flyToEvent.don(a=>{if(!this.position){console.warn("没有位置信息,无法飞行");return}const l=o.scene.camera.positionCartographic.height;Be(o,this.position,l,void 0,a)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(zs,"defaults",{pixelSize:1,outlineWidth:1,color:[1,1,1,.5],outlineColor:[1,1,1,1]});let zn=zs;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:!1,position:p.reactArrayWithUndefined(void 0),pixelSize:void 0,color:p.reactArrayWithUndefined(void 0),distanceDisplayCondition:void 0,disableDepthTestDistance:void 0,outlineColor:p.reactArrayWithUndefined(void 0),outlineWidth:void 0,scaleByDistance:p.reactArrayWithUndefined(void 0),translucencyByDistance:p.reactArrayWithUndefined(void 0)})})(zn||(zn={})),p.extendClassProps(zn.prototype,zn.createDefaultProps);class In extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_primitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.ad(r);const s=()=>{!this._primitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.primitives.lowerToBottom(this._primitive):this.topOrBottom=="top"&&o.scene.primitives.raiseToTop(this._primitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const u=()=>{this._primitive&&(this._primitive.show=this.show??!0)};u(),this.ad(this.showChanged.don(u));const A=()=>{if(r(),!this.positions){this._boundingSphere=void 0;return}const d=this.positions.map(Zt);this._primitive=h(d),this._primitive&&o.scene.primitives.add(this._primitive),s(),u();const g=[],v=d.length;for(let y=0;y<v;y++){const m=d[y].length;for(let w=0;w<m;w++)g.push(d[y][w])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g):void 0};A();const f=this.ad(p.createNextAnimateFrameEvent(this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.positionsChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(f.don(A)),this.ad(this.flyToEvent.don(()=>{e.actived&&(f.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,c=()=>{let u;return this.hasArrow?(u=C.Material.fromType("PolylineArrow"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(u=C.Material.fromType("PolylineDash"),u.uniforms.color=Ie(this.color??[1,1,1,1],a),u.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),u.uniforms.dashLength=this.dashLength??16,u.uniforms.dashPattern=this.dashPattern??255):(u=C.Material.fromType("Color"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)),u},h=u=>{const A=new C.PolylineMaterialAppearance({material:c(),renderState:{depthTest:{enabled:this.depthTest??!1}}});A.renderState.depthMask=!1;const f=[];for(let g=0;g<u.length;++g){const v=u[g];v.length<2||f.push(new C.GeometryInstance({geometry:new C.PolylineGeometry({positions:v,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(f.length===0)return;const d=new C.Primitive({geometryInstances:f,appearance:A,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.Primitive.prototype&&(d.ESSceneObjectID=i),d}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:p.reactPositionsSet(void 0),width:void 0,color:p.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:p.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(In||(In={})),p.extendClassProps(In.prototype,In.createDefaultProps);class Sa extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_groundPrimitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._groundPrimitive&&o.scene.groundPrimitives.remove(this._groundPrimitive),this._groundPrimitive=void 0};this.ad(r);const s=()=>{!this._groundPrimitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.groundPrimitives.lowerToBottom(this._groundPrimitive):this.topOrBottom=="top"&&o.scene.groundPrimitives.raiseToTop(this._groundPrimitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const u=()=>{if(r(),!(this.show??!0)||!this.positions)return;const f=this.positions.map(Zt);this._groundPrimitive=c(f),this._groundPrimitive&&o.scene.groundPrimitives.add(this._groundPrimitive),s(),this._groundPrimitive&&(this._groundPrimitive.show=this.show??!0);const d=new C.BoundingSphere;if(!f){this._boundingSphere=void 0;return}const g=[],v=f.length;for(let y=0;y<v;++y){const m=f[y].length;for(let w=0;w<m;++w)g.push(f[y][w])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g,d):void 0};u();const A=this.ad(p.createNextAnimateFrameEvent(this.showChanged,this.positionsChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(A.don(u)),this.dispose(this.flyToEvent.disposableOn(()=>{e.actived&&(A.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,c=u=>{const A=[];for(let d=0;d<u.length;++d){const g=u[d];g.length<2||A.push(new C.GeometryInstance({geometry:new C.GroundPolylineGeometry({positions:g,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(A.length===0)return;const f=new C.GroundPolylinePrimitive({geometryInstances:A,appearance:new C.PolylineMaterialAppearance({material:h(),renderState:{depthTest:{enabled:this.depthTest??!1}}}),asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.GroundPolylinePrimitive.prototype&&(f.ESSceneObjectID=i),f},h=()=>{let u;return this.hasArrow?(u=C.Material.fromType("PolylineArrow"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(u=C.Material.fromType("PolylineDash"),u.uniforms.color=Ie(this.color??[1,1,1,1],l),u.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),u.uniforms.dashLength=this.dashLength??16,u.uniforms.dashPattern=this.dashPattern??255):(u=C.Material.fromType("Color"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)),u}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:p.reactPositionsSet(void 0),width:void 0,color:p.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:p.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(Sa||(Sa={})),p.extendClassProps(Sa.prototype,Sa.createDefaultProps);class jn extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));if(!e.viewer)return;const r=this.ad(new In(e,i)),s=this.ad(new Sa(e,i));this.dispose(p.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"]));{const a=()=>{const c=this.ground??!1,h=this.show??!0;r.show=h&&!c,s.show=h&&c,r.positions=s.positions=Gk(this),r.arcType=s.arcType=this.arcType,r.width=s.width=this.width??1,r.hasDash=s.hasDash=this.hasDash,r.hasArrow=s.hasArrow=this.hasArrow,r.color=s.color=this.color,r.gapColor=s.gapColor=this.gapColor,r.dashLength=s.dashLength=this.dashLength,r.dashPattern=s.dashPattern=this.dashPattern,r.depthTest=s.depthTest=this.depthTest??!1,r.allowPicking=s.allowPicking=this.allowPicking??!1,r.topOrBottom=s.topOrBottom=this.topOrBottom??"none"};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(this.showChanged,this.groundChanged,this.positionsChanged,this.arcTypeChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.depthTestChanged,this.allowPickingChanged,this.topOrBottomChanged));this.dispose(l.disposableOn(()=>{a()})),this.dispose(this.flyToEvent.disposableOn(c=>{this.ground?s.flyTo(c):r.flyTo(c)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositionsSet(void 0),width:1,ground:!1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,topOrBottom:"none",loop:!1})})(jn||(jn={})),p.extendClassProps(jn.prototype,jn.createDefaultProps);function Gk(t){if(t.loop&&t.positions&&t.positions.length>0){const e=[];return t.positions.forEach(i=>{e.push([...i,i[0]])}),e}else return t.positions}const Wk=`
|
|
469
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Qt=class Qt extends Q.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(p.react(0)));L(this,"_viewer",this.dv(p.react(void 0)));L(this,"_viewerInstance");L(this,"_cameraChanged",this.dv(new p.Event));L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(p.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(p.react(0)));L(this,"_editingSystem",this.ad(EE()));L(this,"_moveObjectsProcess",this.ad(PE()));if(this.ad(new CP(this)),this.ad(new xP(this)),this.dv(new p.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new TP(this)})),this._viewerLegend=this.dv(new Ok(this)),this._viewerInstance=this.dv(new p.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bd(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=Ie([1,1,1,1]))})),e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");const i=e;this.d(this._viewer.changed.don(()=>{this.actived=!0,this.viewerChanged.emit(this.viewer)}));const o=this.disposeVar(p.createNextAnimateFrameEvent(this.subContainerChanged));this.dv(new p.ObjResettingWithEvent(o,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new EI(this.subContainer,this,r=>this._viewer.value=r,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&&Tn(this.viewer)}get viewerInstance(){return this._viewerInstance}get cameraChanged(){return this._cameraChanged}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)}getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=C.Cartographic.fromDegrees(e[0],e[1],e[2],Qt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xn(e),rotation:ma(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const s=C.Cartesian3.fromDegrees(...e),a=C.Cartesian3.distance(o.positionWC,s),l=C.Cartesian3.subtract(s,r,new C.Cartesian3);C.Cartesian3.normalize(l,l);const c=C.Transforms.rotationMatrixFromPositionVelocity(r,l,C.Ellipsoid.WGS84),h=C.Matrix4.fromRotationTranslation(c,r);var u=C.Transforms.eastNorthUpToFixedFrame(C.Matrix4.getTranslation(h,new C.Cartesian3),C.Ellipsoid.WGS84,new C.Matrix4),A=C.Matrix4.multiply(C.Matrix4.inverse(u,new C.Matrix4),h,new C.Matrix4),f=C.Matrix4.getMatrix3(A,new C.Matrix3),d=C.Quaternion.fromRotationMatrix(f),g=C.HeadingPitchRoll.fromQuaternion(d);const v=ma(o);return{distance:a,heading:C.Math.toDegrees(g.heading)+90,pitch:C.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(C.Math.toDegrees(g.heading)+90)),pDelta:v[1]-C.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;const s={position:e,rotation:i,duration:(o??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&js(a,s)}flyTo(e,i,o="default"){var f;const{distance:r,heading:s,pitch:a,flyDuration:l,hDelta:c,pDelta:h}=e,u={position:i,viewDistance:r,rotation:[s,a,0],duration:l*1e3,hdelta:c,pdelta:h},A=(f=this.viewer)==null?void 0:f.camera;return A&&js(A,u)}flyToBoundingSphere(e,i,o=1){var u;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=Q.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:l}=s,c={position:a,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},h=(u=this.viewer)==null?void 0:u.camera;return h&&js(h,c)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:xn(e),rotation:ma(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.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,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,s,a){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToLine(e,i,o,r,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式",e)}changeToRotatePoint(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){return window.g_XE3CopyRights??{}}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=C.Cartographic.fromDegrees(e,i,void 0,Qt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)}async getHeightsByLonLats(e,i){const o=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await M0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(dt(e));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.combinationClass?e.getMainClass():e;r&&(console.log(i,"这是Cesium的模式"),i!=null&&(r.editingID=`${o.callSource}_${p.createGuid()}`,this._editingSystem.restart(void 0,this,r,i,o.useKeyToSwitch)))}stopEditing(){this._editingSystem.isRunning&&this._editingSystem.cancel()}moveObjects(e){const i=[],o=p.createGuid();for(let r=0;r<e.length;r++){const s=e[r],a=s.combinationClass?s.getMainClass():s;a.editingID=o,a&&i.push(a)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Qt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Qt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Qt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return pn(e,i)}localPositionsToPositions(e,i){return vr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=dt(e),o=new C.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)}getProperties(){const e=Qt.defaults;return[...super.getProperties(),new Q.GroupProperty("通用","通用",[new Q.EvalStringProperty("CesiumViewer创建函数","CesiumViewer创建函数",!0,!1,[this,"createCesiumViewerFuncStr"],Nk,Vk),new Q.FunctionProperty("获取官方token","获取官方token",[],()=>Qt.getCesiumIonToken(),[]),new Q.FunctionProperty("当前token","重置为当前使用的Cesium版本的token",[],()=>this.setCurrentDefaultAccessToken(),[]),new Q.FunctionProperty("最新token","充值为当前Cesium官方的最新token",[],()=>this.setLatestDefaultAccessToken(),[]),new Q.BooleanProperty("头顶灯","设置为头顶灯,false时为太阳光",!0,!1,[this,"flashLighting"]),new Q.BooleanProperty("粒子全局控制播放","粒子全局控制播放",!0,!1,[this,"particleGlobalControl"])]),new Q.GroupProperty("Viewer","Viewer",[new Q.NumberProperty("分辨率比率","分辨率比率",!0,!1,[this,"resolutionScale"],e.resolutionScale),new Q.NumberProperty("msaaSamples","msaaSamples",!0,!1,[this,"msaaSamples"],e.msaaSamples),new Q.BooleanProperty("shadows","shadows",!1,!1,[this,"shadows"]),new Q.GroupProperty("比例尺","比例尺(Legend)",[new Q.NumberProperty("resolution","resolution",!0,!0,[this.viewerLegend,"resolution"]),new Q.NumberProperty("zoom","zoom",!0,!0,[this.viewerLegend,"zoom"]),new Q.Number3Property("center","center",!0,!0,[this.viewerLegend,"center"]),new Q.NumberProperty("lengthInPixels","lengthInPixels",!0,!1,[this.viewerLegend.legend,"lengthInPixels"]),new Q.NumberProperty("computedLengthInPixels","computedLengthInPixels",!0,!0,[this.viewerLegend.legend,"computedLengthInPixels"]),new Q.NumberProperty("computedLengthInMeters","computedLengthInMeters",!0,!0,[this.viewerLegend.legend,"computedLengthInMeters"]),new Q.StringProperty("computedLengthInStr","computedLengthInStr",!0,!0,[this.viewerLegend.legend,"computedLengthInStr"])]),new Q.GroupProperty("场景","场景(Scene)",[new Q.NumberProperty("内部视口分割比例","内部视口分割比例",!0,!1,[this,"sceneSplitPosition"],e.sceneSplitPosition),new Q.GroupProperty("Globe","Globe",[new Q.BooleanProperty("depthTestAgainstTerrain","depthTestAgainstTerrain",!0,!1,[this,"depthTestAgainstTerrain"],e.depthTestAgainstTerrain),new Q.EnumProperty("sceneGlobeShadows","sceneGlobeShadows",!0,!1,[this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],e.sceneGlobeShadows),new Q.NumberProperty("sceneGlobeTerrainExaggeration","sceneGlobeTerrainExaggeration,Cesium1.116废弃",!1,!1,[this,"sceneGlobeTerrainExaggeration"]),new Q.NumberProperty("sceneGlobeTerrainExaggerationRelativeHeight","sceneGlobeTerrainExaggerationRelativeHeight,Cesium1.116废弃",!1,!1,[this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new Q.NumberProperty("sceneGlobeVerticalExaggeration","sceneGlobeVerticalExaggeration",!1,!1,[this,"sceneGlobeVerticalExaggeration"]),new Q.NumberProperty("sceneGlobeVerticalExaggerationRelativeHeight","sceneGlobeVerticalExaggerationRelativeHeight",!1,!1,[this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new Q.BooleanProperty("sceneGlobeBackFaceCulling","sceneGlobeBackFaceCulling",!1,!1,[this,"sceneGlobeBackFaceCulling"]),new Q.BooleanProperty("sceneGlobeShowSkirts","sceneGlobeShowSkirts",!1,!1,[this,"sceneGlobeShowSkirts"]),new Q.BooleanProperty("sceneGlobeShowWaterEffect","sceneGlobeShowWaterEffect",!1,!1,[this,"sceneGlobeShowWaterEffect"]),new Q.ColorProperty("sceneGlobeBaseColor","sceneGlobeBaseColor",!1,!1,[this,"sceneGlobeBaseColor"]),new Q.Number4Property("sceneGlobeCartographicLimitRectangle","sceneGlobeCartographicLimitRectangle",!1,!1,[this,"sceneGlobeCartographicLimitRectangle"]),new Q.JsonProperty("sceneGlobeClippingPlanes","sceneGlobeClippingPlanes",!1,!1,[this,"sceneGlobeClippingPlanes"]),new Q.StringProperty("sceneGlobeClippingPlanesId","sceneGlobeClippingPlanesId",!1,!1,[this,"sceneGlobeClippingPlanesId"]),new Q.JsonProperty("sceneGlobeClippingPolygons","sceneGlobeClippingPolygons",!1,!1,[this,"sceneGlobeClippingPolygons"]),new Q.StringsProperty("sceneGlobeClippingPolygonsId","sceneGlobeClippingPolygonsId",!1,!1,[this,"sceneGlobeClippingPolygonsId"]),new Q.GroupProperty("Underground","Underground",[new Q.ColorProperty("sceneGlobeUndergroundColor","sceneGlobeUndergroundColor",!0,!1,[this,"sceneGlobeUndergroundColor"],e.sceneGlobeUndergroundColor),new Q.Number4Property("sceneGlobeUndergroundColorAlphaByDistance","sceneGlobeUndergroundColorAlphaByDistance",!0,!1,[this,"sceneGlobeUndergroundColorAlphaByDistance"],e.sceneGlobeUndergroundColorAlphaByDistance)]),new Q.GroupProperty("Translucency","Translucency",[new Q.BooleanProperty("启用","启用",!0,!1,[this,"sceneGlobeTranslucencyEnabled"],e.sceneGlobeTranslucencyEnabled),new Q.NumberProperty("背面透明度","背面透明度",!0,!1,[this,"sceneGlobeTranslucencyBackFaceAlpha"],e.sceneGlobeTranslucencyBackFaceAlpha),new Q.Number4Property("背面渐变透明度","背面渐变透明度",!0,!1,[this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],e.sceneGlobeTranslucencyBackFaceAlphaByDistance),new Q.NumberProperty("正面透明度","正面透明度",!0,!1,[this,"sceneGlobeTranslucencyFrontFaceAlpha"],e.sceneGlobeTranslucencyFrontFaceAlpha),new Q.Number4Property("正面渐变透明度","正面渐变透明度",!0,!1,[this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],e.sceneGlobeTranslucencyFrontFaceAlphaByDistance),new Q.Number4Property("矩形范围","矩形范围",!0,!1,[this,"sceneGlobeTranslucencyRectangle"],e.sceneGlobeTranslucencyRectangle)])]),new Q.GroupProperty("Sun","Sun",[new Q.BooleanProperty("sun","sun",!0,!1,[this,"sun"],e.sun),new Q.NumberProperty("sceneSunGlowFactor","sceneSunGlowFactor",!0,!1,[this,"sceneSunGlowFactor"],e.sceneSunGlowFactor)]),new Q.GroupProperty("Moon","Moon",[new Q.BooleanProperty("moon","moon",!0,!1,[this,"moon"],e.moon),new Q.StringProperty("sceneMoonTextureUrl","sceneMoonTextureUrl",!0,!1,[this,"sceneMoonTextureUrl"],e.sceneMoonTextureUrl),new Q.BooleanProperty("sceneMoonOnlySunLighting","sceneMoonOnlySunLighting",!0,!1,[this,"sceneMoonOnlySunLighting"],e.sceneMoonOnlySunLighting)]),new Q.GroupProperty("SkyBox","SkyBox",[new Q.BooleanProperty("sceneSkyBoxShow","sceneSkyBoxShow",!1,!1,[this,"sceneSkyBoxShow"]),new Q.JsonProperty("sceneSkyBoxSources","sceneSkyBoxSources",!0,!1,[this,"sceneSkyBoxSources"]),new Q.GroupProperty("Background","Background",[new Q.BooleanProperty("xbsjUseBackground","xbsjUseBackground",!1,!1,[this,"xbsjUseBackground"]),new Q.StringProperty("xbsjBackgroundImageUri","xbsjBackgroundImageUri",!1,!1,[this,"xbsjBackgroundImageUri"]),new Q.ColorProperty("xbsjBackgroundColor","xbsjBackgroundColor",!1,!1,[this,"xbsjBackgroundColor"])])]),new Q.GroupProperty("SkyAtmosphere","SkyAtmosphere",[new Q.JsonProperty("xbsjLocalBoxSources","xbsjLocalBoxSources",!0,!1,[this,"xbsjLocalBoxSources"],e.xbsjLocalBoxSources)]),new Q.ColorProperty("sceneBackgroundColor","sceneBackgroundColor",!1,!1,[this,"sceneBackgroundColor"]),new Q.GroupProperty("Fog","Fog",[new Q.BooleanProperty("sceneFogEnabled","sceneFogEnabled",!0,!1,[this,"sceneFogEnabled"],e.sceneFogEnabled),new Q.NumberProperty("sceneFogDensity","sceneFogDensity",!0,!1,[this,"sceneFogDensity"],e.sceneFogDensity),new Q.NumberProperty("sceneFogScreenSpaceErrorFactor","sceneFogScreenSpaceErrorFactor",!0,!1,[this,"sceneFogScreenSpaceErrorFactor"],e.sceneFogScreenSpaceErrorFactor),new Q.NumberProperty("sceneFogMinimumBrightness","sceneFogMinimumBrightness",!0,!1,[this,"sceneFogMinimumBrightness"],e.sceneFogMinimumBrightness)]),new Q.GroupProperty("Sscc","Sscc",[new Q.BooleanProperty("sceneSsccEnableInputs","sceneSsccEnableInputs",!0,!1,[this,"sceneSsccEnableInputs"],e.sceneSsccEnableInputs),new Q.BooleanProperty("sceneSsccEnableCollisionDetection","sceneSsccEnableCollisionDetection",!0,!1,[this,"sceneSsccEnableCollisionDetection"],e.sceneSsccEnableCollisionDetection),new Q.NumberProperty("sceneSsccZoomFactor","sceneSsccZoomFactor",!0,!1,[this,"sceneSsccZoomFactor"],e.sceneSsccZoomFactor)]),new Q.NumberProperty("相机广角","相机广角(sceneCameraFrustumFov)",!1,!1,[this,"sceneCameraFrustumFov"]),new Q.GroupProperty("后处理","后处理",[new Q.BooleanProperty("开启FXAA","开启FXAA",!0,!1,[this,"scenePpsfxaaEnabled"],e.scenePpsfxaaEnabled),new Q.GroupProperty("环境遮蔽","环境遮蔽",[new Q.BooleanProperty("Enabled","Enabled",!1,!1,[this,"scenePpsAmbientOcclusionEnabled"]),new Q.BooleanProperty("AmbientOcclusionOnly","AmbientOcclusionOnly",!1,!1,[this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new Q.NumberProperty("Intensity","Intensity",!1,!1,[this,"scenePpsAmbientOcclusionIntensity"]),new Q.NumberProperty("Bias","Bias",!1,!1,[this,"scenePpsAmbientOcclusionBias"]),new Q.NumberProperty("LengthCap","LengthCap",!1,!1,[this,"scenePpsAmbientOcclusionLengthCap"]),new Q.NumberProperty("StepSize","StepSize",!1,!1,[this,"scenePpsAmbientOcclusionStepSize"]),new Q.NumberProperty("BlurStepSize","BlurStepSize",!1,!1,[this,"scenePpsAmbientOcclusionBlurStepSize"])]),new Q.GroupProperty("Bloom","Bloom",[new Q.BooleanProperty("Enabled","Enabled",!1,!1,[this,"scenePpsBloomEnabled"]),new Q.BooleanProperty("GlowOnly","GlowOnly",!1,!1,[this,"scenePpsBloomGlowOnly"]),new Q.NumberProperty("Contrast","Contrast",!1,!1,[this,"scenePpsBloomContrast"]),new Q.NumberProperty("Brightness","Brightness",!1,!1,[this,"scenePpsBloomBrightness"]),new Q.NumberProperty("Delta","Delta",!1,!1,[this,"scenePpsBloomDelta"]),new Q.NumberProperty("Sigma","Sigma",!1,!1,[this,"scenePpsBloomSigma"]),new Q.NumberProperty("StepSize","StepSize",!1,!1,[this,"scenePpsBloomStepSize"])])]),new Q.GroupProperty("调试","调试",[new Q.BooleanProperty("sceneDebugShowFramesPerSecond","sceneDebugShowFramesPerSecond",!0,!1,[this,"sceneDebugShowFramesPerSecond"],e.sceneDebugShowFramesPerSecond),new Q.BooleanProperty("sceneDebugShowCommands","sceneDebugShowCommands",!0,!1,[this,"sceneDebugShowCommands"],e.sceneDebugShowCommands),new Q.BooleanProperty("sceneDebugShowFrustums","sceneDebugShowFrustums",!0,!1,[this,"sceneDebugShowFrustums"],e.sceneDebugShowFrustums),new Q.BooleanProperty("sceneDebugShowFrustumPlanes","sceneDebugShowFrustumPlanes",!0,!1,[this,"sceneDebugShowFrustumPlanes"],e.sceneDebugShowFrustumPlanes),new Q.NumberProperty("sceneDebugShowDepthFrustum","sceneDebugShowDepthFrustum",!0,!1,[this,"sceneDebugShowDepthFrustum"],e.sceneDebugShowDepthFrustum)])]),new Q.GroupProperty("Inspector","Inspector",[new Q.BooleanProperty("showCesiumInspector","showCesiumInspector",!0,!1,[this,"showCesiumInspector"],e.showCesiumInspector),new Q.BooleanProperty("cesiumInspectorWireframe","cesiumInspectorWireframe",!0,!1,[this,"cesiumInspectorWireframe"],e.cesiumInspectorWireframe),new Q.BooleanProperty("showCesium3DTilesInspector","showCesium3DTilesInspector",!0,!1,[this,"showCesium3DTilesInspector"],e.showCesium3DTilesInspector)])])]}};L(Qt,"type",Qt.register("ESCesiumViewer",Qt)),L(Qt,"getCesiumIonToken",Hk),L(Qt,"currentDefaultAccessToken",C.Ion.defaultAccessToken),L(Qt,"latestDefaultAccessToken"),L(Qt,"ObjectsToExcludeWrapper",PP),L(Qt,"defaults",{...Q.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,depthTestAgainstTerrain:!1,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha: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:C.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:C.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(Qt,"getHeightsScartchCarto",new C.Cartographic);let Ye=Qt;(t=>{t.createDefaultProps=()=>({...Q.ESViewer.createDefaultProps(),...Qk()})})(Ye||(Ye={})),p.extendClassProps(Ye.prototype,Ye.createDefaultProps);const zs=class zs extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_updateObjectsToExcludeWrapper",this.ad(new p.Event));const o=e.viewer;if(!o)return;const r=new C.PointPrimitiveCollection;let s;{const a=()=>{r&&(s&&r.remove(s),o.scene.primitives.remove(r),s=void 0)};this.ad(a),a(),s=r.add({}),C.PointPrimitive.prototype&&(s.ESSceneObjectID=i),o.scene.primitives.add(r)}{const a=this.ad(p.createNextAnimateFrameEvent(this.positionChanged,this.showChanged,this.pixelSizeChanged,this.colorChanged,this.outlineColorChanged,this.outlineWidthChanged,this.distanceDisplayConditionChanged,this.scaleByDistanceChanged,this.translucencyByDistanceChanged)),l=()=>{!s||!r||(s.show=(this.show??!0)&&!!this.position,this.position&&(s.position=dt(this.position)),s.pixelSize=this.pixelSize??1,s.color=Ie(this.color??zs.defaults.color),this.distanceDisplayCondition&&(s.distanceDisplayCondition=Ws(this.distanceDisplayCondition)),s.outlineColor=Ie(this.outlineColor??zs.defaults.outlineColor),s.outlineWidth=this.outlineWidth??zs.defaults.outlineWidth,this.scaleByDistance&&(s.scaleByDistance=fr(this.scaleByDistance)),this.translucencyByDistance&&(s.translucencyByDistance=fr(this.translucencyByDistance)))};l(),this.ad(a.don(l))}{const a=this.ad(p.createNextAnimateFrameEvent(this._updateObjectsToExcludeWrapper,this.allowPickingChanged));this.disposeVar(new p.ObjResettingWithEvent(a,()=>{if(!(this.allowPicking||!s))return new Ye.ObjectsToExcludeWrapper(e,s)}))}this.ad(this.flyToEvent.don(a=>{if(!this.position){console.warn("没有位置信息,无法飞行");return}const l=o.scene.camera.positionCartographic.height;Be(o,this.position,l,void 0,a)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(zs,"defaults",{pixelSize:1,outlineWidth:1,color:[1,1,1,.5],outlineColor:[1,1,1,1]});let zn=zs;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:!1,position:p.reactArrayWithUndefined(void 0),pixelSize:void 0,color:p.reactArrayWithUndefined(void 0),distanceDisplayCondition:void 0,disableDepthTestDistance:void 0,outlineColor:p.reactArrayWithUndefined(void 0),outlineWidth:void 0,scaleByDistance:p.reactArrayWithUndefined(void 0),translucencyByDistance:p.reactArrayWithUndefined(void 0)})})(zn||(zn={})),p.extendClassProps(zn.prototype,zn.createDefaultProps);class In extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_primitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.ad(r);const s=()=>{!this._primitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.primitives.lowerToBottom(this._primitive):this.topOrBottom=="top"&&o.scene.primitives.raiseToTop(this._primitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const u=()=>{this._primitive&&(this._primitive.show=this.show??!0)};u(),this.ad(this.showChanged.don(u));const A=()=>{if(r(),!this.positions){this._boundingSphere=void 0;return}const d=this.positions.map(Zt);this._primitive=h(d),this._primitive&&o.scene.primitives.add(this._primitive),s(),u();const g=[],v=d.length;for(let y=0;y<v;y++){const m=d[y].length;for(let w=0;w<m;w++)g.push(d[y][w])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g):void 0};A();const f=this.ad(p.createNextAnimateFrameEvent(this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.positionsChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(f.don(A)),this.ad(this.flyToEvent.don(()=>{e.actived&&(f.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,c=()=>{let u;return this.hasArrow?(u=C.Material.fromType("PolylineArrow"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(u=C.Material.fromType("PolylineDash"),u.uniforms.color=Ie(this.color??[1,1,1,1],a),u.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),u.uniforms.dashLength=this.dashLength??16,u.uniforms.dashPattern=this.dashPattern??255):(u=C.Material.fromType("Color"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)),u},h=u=>{const A=new C.PolylineMaterialAppearance({material:c(),renderState:{depthTest:{enabled:this.depthTest??!1}}});A.renderState.depthMask=!1;const f=[];for(let g=0;g<u.length;++g){const v=u[g];v.length<2||f.push(new C.GeometryInstance({geometry:new C.PolylineGeometry({positions:v,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(f.length===0)return;const d=new C.Primitive({geometryInstances:f,appearance:A,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.Primitive.prototype&&(d.ESSceneObjectID=i),d}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:p.reactPositionsSet(void 0),width:void 0,color:p.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:p.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(In||(In={})),p.extendClassProps(In.prototype,In.createDefaultProps);class Sa extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_groundPrimitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._groundPrimitive&&o.scene.groundPrimitives.remove(this._groundPrimitive),this._groundPrimitive=void 0};this.ad(r);const s=()=>{!this._groundPrimitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.groundPrimitives.lowerToBottom(this._groundPrimitive):this.topOrBottom=="top"&&o.scene.groundPrimitives.raiseToTop(this._groundPrimitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const u=()=>{if(r(),!(this.show??!0)||!this.positions)return;const f=this.positions.map(Zt);this._groundPrimitive=c(f),this._groundPrimitive&&o.scene.groundPrimitives.add(this._groundPrimitive),s(),this._groundPrimitive&&(this._groundPrimitive.show=this.show??!0);const d=new C.BoundingSphere;if(!f){this._boundingSphere=void 0;return}const g=[],v=f.length;for(let y=0;y<v;++y){const m=f[y].length;for(let w=0;w<m;++w)g.push(f[y][w])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g,d):void 0};u();const A=this.ad(p.createNextAnimateFrameEvent(this.showChanged,this.positionsChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(A.don(u)),this.dispose(this.flyToEvent.disposableOn(()=>{e.actived&&(A.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,c=u=>{const A=[];for(let d=0;d<u.length;++d){const g=u[d];g.length<2||A.push(new C.GeometryInstance({geometry:new C.GroundPolylineGeometry({positions:g,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(A.length===0)return;const f=new C.GroundPolylinePrimitive({geometryInstances:A,appearance:new C.PolylineMaterialAppearance({material:h(),renderState:{depthTest:{enabled:this.depthTest??!1}}}),asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.GroundPolylinePrimitive.prototype&&(f.ESSceneObjectID=i),f},h=()=>{let u;return this.hasArrow?(u=C.Material.fromType("PolylineArrow"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(u=C.Material.fromType("PolylineDash"),u.uniforms.color=Ie(this.color??[1,1,1,1],l),u.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),u.uniforms.dashLength=this.dashLength??16,u.uniforms.dashPattern=this.dashPattern??255):(u=C.Material.fromType("Color"),u.uniforms.color=Ie(this.color??[1,1,1,1],a)),u}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:p.reactPositionsSet(void 0),width:void 0,color:p.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:p.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(Sa||(Sa={})),p.extendClassProps(Sa.prototype,Sa.createDefaultProps);class jn extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));if(!e.viewer)return;const r=this.ad(new In(e,i)),s=this.ad(new Sa(e,i));this.dispose(p.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"]));{const a=()=>{const c=this.ground??!1,h=this.show??!0;r.show=h&&!c,s.show=h&&c,r.positions=s.positions=Gk(this),r.arcType=s.arcType=this.arcType,r.width=s.width=this.width??1,r.hasDash=s.hasDash=this.hasDash,r.hasArrow=s.hasArrow=this.hasArrow,r.color=s.color=this.color,r.gapColor=s.gapColor=this.gapColor,r.dashLength=s.dashLength=this.dashLength,r.dashPattern=s.dashPattern=this.dashPattern,r.depthTest=s.depthTest=this.depthTest??!1,r.allowPicking=s.allowPicking=this.allowPicking??!1,r.topOrBottom=s.topOrBottom=this.topOrBottom??"none"};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(this.showChanged,this.groundChanged,this.positionsChanged,this.arcTypeChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.depthTestChanged,this.allowPickingChanged,this.topOrBottomChanged));this.dispose(l.disposableOn(()=>{a()})),this.dispose(this.flyToEvent.disposableOn(c=>{this.ground?s.flyTo(c):r.flyTo(c)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositionsSet(void 0),width:1,ground:!1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,topOrBottom:"none",loop:!1})})(jn||(jn={})),p.extendClassProps(jn.prototype,jn.createDefaultProps);function Gk(t){if(t.loop&&t.positions&&t.positions.length>0){const e=[];return t.positions.forEach(i=>{e.push([...i,i[0]])}),e}else return t.positions}const Wk=`
|
|
470
470
|
类型说明:
|
|
471
471
|
\`\`\`javascript
|
|
472
472
|
|
|
@@ -4142,10 +4142,10 @@ void main()
|
|
|
4142
4142
|
{
|
|
4143
4143
|
out_FragColor = u_color;
|
|
4144
4144
|
}
|
|
4145
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class sV extends p.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const s=i=this._getStartInfo(r.pointerEvent);s&&(this.owner.hoveredPlaneType=s.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{do{const s=this._getStartInfo(r.pointerEvent);if(!s||s.currentPlaneType==="none")break;const{currentPlaneType:a}=s,l=[...this.owner.selfRotation];l[si.rotationNum[a]]=0,this.owner.selfRotation=l;return}while(!1);this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(p.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:s,offsetY:a}=r.pointerEvent,l=[s,a],{currentPlaneType:c}=i;if(c==="none")return;const h=this.owner.getPlane(c);if(!i.currentV)return;const u=h.pick(l);if(!u||!this.owner.cartesian)return;const A=C.Cartesian3.subtract(i.currentV,this.owner.cartesian,new C.Cartesian3);C.Cartesian3.normalize(A,A);const f=C.Cartesian3.subtract(u,this.owner.cartesian,new C.Cartesian3);if(C.Cartesian3.normalize(f,f),!h.normal||!h.origin)return;const d=Fv(A,f,h.normal),g=Fv(h.origin,A,h.normal),v=Fv(h.origin,f,h.normal);{const y=[...this.owner.selfRotation];y[si.rotationNum[c]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await p.step(n,r=>new Promise((s,a)=>{r.disposer.dispose(a),r.disposer.dispose(e.pointerUpEvent.don(()=>{s()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{s()}))}))}))}_pickPlane(n,e,i,o,r){const s=this.owner.cartesian;if(!s)return;const{selfRotation:a}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const c=C.Cartesian3.distance(s,l),h=r/4,u=h*3/128;if(!(c>=h-u&&c<=h+u))return;const f=C.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=f||(n.currentPlaneType=i,n.currentD2c=f,n.currentV=l,n.startRotation=a[si.rotationNum[i]])}_getStartInfo(n){var h;const{czmViewer:e}=this.owner,i=(h=e.viewer)==null?void 0:h.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Li(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:s}=n,a=[r,s],l=n.pointerId,c={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(c,i,"heading",a,o),this._pickPlane(c,i,"pitch",a,o),this._pickPlane(c,i,"roll",a,o),c}}function Fv(t,n,e){const i=C.Cartesian3.cross(n,t,new C.Cartesian3);if(i.equals(C.Cartesian3.ZERO))return 0;C.Cartesian3.normalize(i,i);const o=C.Cartesian3.dot(i,e);let r=Math.acos(C.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const Aa=class Aa extends Mn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(p.react("none")));L(this,"_movingPlaneType",this.disposeVar(p.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new nV(this)),pitch:this.disposeVar(new iV(this)),roll:this.disposeVar(new rV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new sV(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&dt(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new Nt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(p.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(p.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(p.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=at({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=C.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Bs(e));this.dispose(p.track([o,"position"],[this,"position"])),this.dispose(p.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(p.track([o,"debug"],[this,"debug"])),this.dispose(p.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=Aa.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[Aa.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const s=this.movingPlaneType===i,a=this.hoveredPlaneType===i,c=[0,0,0,s||a?1:.8];c[Aa.rotationNum[i]]=1,o.color=c};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(Aa,"rotationNum",{heading:0,pitch:1,roll:2}),L(Aa,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let si=Aa;(t=>{t.createDefaultProps=()=>({...Mn.createDefaultProps(),rotation:p.reactArray([0,0,0]),selfRotation:p.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(si||(si={})),p.extendClassProps(si.prototype,si.createDefaultProps);const fa=class fa extends p.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??fa.defaults.positions[0],this.stopPosition??fa.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??fa.defaults.positions[0],n??fa.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Je(n,e));o.arcType="RHUMB";const r=this.ad(new zn(n,e));this.ad(p.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(p.track([r,"allowPicking"],[this,"allowPicking"]));{const s=()=>{o.show=r.show=this.show};s(),this.ad(this.showChanged.don(s))}{const s=()=>{o.width=this.width/2,r.pixelSize=this.width};s(),this.ad(this.widthChanged.don(s))}{const s=()=>{o.color=r.color=this.color};s(),this.ad(this.colorChanged.don(s))}{const s=()=>{o.positions=this.positions,r.position=this.stopPosition};s(),this.dispose(this.startPositionChanged.disposableOn(s)),this.dispose(this.stopPositionChanged.disposableOn(s))}}};L(fa,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let ra=fa;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(t.defaults.positions),width:10,color:p.reactArray([1,0,0,1])})})(ra||(ra={})),p.extendClassProps(ra.prototype,ra.createDefaultProps);class lr extends Mn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(p.react(!1)),moved:this.ad(p.react(!1)),constraintMode:this.disposeVar(p.react("none")),originPosition:this.disposeVar(p.reactArray([0,0,0])),originHeading:this.disposeVar(p.react(0)),originDimensions:this.disposeVar(p.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(p.reactArray([0,0,0])),movingPosition:this.disposeVar(p.reactArray([0,0,0])),targetPosition:this.disposeVar(p.reactArray([0,0,0])),targetHeading:this.disposeVar(p.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new p.Processing((i,o,r)=>{const s=[0,0,0],a=new C.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const c=Yn(p.getDomEventCurrentTargetPos(l.pointerEvent));if(!ga(e.viewer.scene,c,this._opInfo.originPosition.value[2],a))return;pa(a,s),this._opInfo.constraintMode.value==="x"?vo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,s,s):this._opInfo.constraintMode.value==="y"?vo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,s,s):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=s,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const h=[0,0,0];Q.geoRhumbDestination(s,r,o,h),this._opInfo.targetPosition.value=h;let u=this.scale[0],A=this.scale[1];const f=Q.geoDistance(h,this._opInfo.originPosition.value)-Q.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...h];const d=this._opInfo.originDimensions.value[0]/100;f!=0&&this._opInfo.constraintMode.value==="y"&&(f>0?u+=d:u-=d),f!=0&&this._opInfo.constraintMode.value==="x"&&(f>0?A+=d:A-=d),u<=0&&(u+=d),A<=0&&(A+=d),this.scale=[u??1,A??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new p.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Yn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!ih(e.viewer.scene,dt(this._opInfo.originPosition.value),s,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const a=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+a];let c=this.scale[2];const h=o[2]-this._lastPosition[2];this._lastPosition=[...o];const u=this._opInfo.originDimensions.value[0]/100;h!=0&&(h>0?c+=u:c-=u),c<=0&&(c+=u),this.scale=[this.scale[0]??1,this.scale[1]??1,c??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new qf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const c=()=>{if(!this._scaleAxis)return;const{zAxis:h,yAxis:u,xAxis:A}=this._scaleAxis,f=this._opInfo.constraintMode.value,d=this._opInfo.step;h.color=[0,0,1,.99],u.color=[0,1,0,.99],A.color=[1,0,0,.99],f==="x"?A.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="y"?u.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="z"&&(h.color=d?[1,1,0,.8]:[1,1,0,.99])};c(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(c)),this.dispose(this._opInfo.step.changed.disposableOn(c))}{const c=()=>{if(!this._scaleAxis)return;const{position:u=lr.defaults.position}=this,{zAxis:A,yAxis:f,xAxis:d}=this._scaleAxis;A.startPosition=f.startPosition=d.startPosition=u;const[g,v,y]=u;A.stopPosition=[g,v,y+this._opInfo.originDimensions.value[2]];const m=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const w=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[1],0);w&&(f.stopPosition=w)};c();const h=this.ad(p.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(h.don(c))}{const c=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((h,u)=>h===this._opInfo.targetPosition.value[u])){this._opInfo.moved.value=!0;return}};c(),this.dispose(this._opInfo.originHeading.changed.disposableOn(c)),this.dispose(this._opInfo.originPosition.changed.disposableOn(c)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(c)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(c))}const r=this._pickingXYProcessing(e),s=this._pickingZProcessing(e),a=this.disposeVar(p.createProcessingFromAsyncFunc(async c=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",c.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await p.step(c,async h=>{const u=()=>{const d=[...this.position??lr.defaults.position];e.editingHeightOffset&&(d[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=d};h.disposer.dispose((u(),this.positionChanged.disposableOn(u)));const A={constraintMode:"none",startDragPos:[0,0,0]},f=d=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Df(d,o,g,this.axisSnapPixelSize,A),this._opInfo.constraintMode.value=A.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=A.startDragPos};h.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&f(d.pointerEvent)})),await p.step(h,d=>new Promise((g,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&f(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&A.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await p.step(c,async h=>{if(e.incrementDisabledInputStack(),h.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const u=Q.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),A=Q.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,u,A),h.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(s.restart(),h.disposer.dispose(()=>s.cancel()));await p.step(h,u=>new Promise((A,f)=>{u.disposer.dispose(f),u.disposer.dispose(e.pointerUpEvent.don(()=>{A()})),u.disposer.dispose(e.pointerOutEvent.don(()=>{A()}))})),this._lastPosition=void 0});while(!0)})),l=()=>{this.enabled?a.restart():a.isRunning&&a.cancel()};l(),this.dispose(this.enabledChanged.disposableOn(l))}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new ra(e));return o.width=10,this.ad(p.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Mn.createDefaultProps(),scale:p.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(lr||(lr={})),p.extendClassProps(lr.prototype,lr.createDefaultProps);const go=class go extends fn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new p.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(p.react(!1)));L(this,"_status",this.disposeVar(p.react("None")));L(this,"_positionsChanged",this.ad(new p.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:s}of i){for(const a of s)a.menuPoi.enabled=this.menuPoiEnabled??!1;for(let a=o;a<o+r;++a)this.editingPoints.get(a).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(p.nextAnimateFrame(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()}))})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??go.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((s,a)=>{const l=this.editingPoints.get(r);return l.position&&l.position[a]===s})))}forceResetPositions(e){(this.enabled??go.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Je(e));this.ad(p.track([i,"color"],[this,"polylineColor"])),this.ad(p.track([i,"width"],[this,"polylineWidth"])),this.ad(p.track([i,"show"],[this,"polylineShow"])),this.ad(p.track([i,"arcType"],[this,"polylineArcType"])),this.ad(p.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const s of this.getPositions())s[2]-=e.editingHeightOffset??0,r.push(s);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new p.CursorInfo(e.container,p.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(go,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(go,"defaults",{...fn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:go.baseImageUrl+"point-green.png",otherControlPointImageUrl:go.baseImageUrl+"point-yellow.png"});let Kn=go;(t=>{t.createDefaultProps=()=>({...fn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:p.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(Kn||(Kn={})),p.extendClassProps(Kn.prototype,Kn.createDefaultProps);let lV=0;class gE extends p.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_id",lV++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new Ta(e.czmViewer));o.enabled=!1,this.ad(p.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const s=[...this.position];s[2]-=e.czmViewer.editingHeightOffset??0,o.position=s,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const s=e.editingPoints.indexOf(this)+1;s!==0&&(o.title=`控制点${s}`,s===1?o.imageUri=e.firstControlPointImageUrl??Kn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??Kn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class yE extends gE{constructor(n,e){super(n,e)}}class Pt extends Kn{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new p.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new ai(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Pt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Pt.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(p.step(o,async r=>{const s=r.disposer,a=s.ad(this._addingEditingProcessing());s.dispose(()=>"adding canceled!"),s.dispose(this.cancelEvent.disposableOn(()=>a.cancel())),await r.promise(new Promise(l=>{s.dispose(a.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new yE(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Pt.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=p.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1;do if(!await o.promise(p.step(o,async a=>{let l;!e()&&(l=a.disposer.disposeVar(new uV(this,r)));const h=a.disposer.disposeVar(new hV(this,r));return a.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>h.do())),await a.promise(new Promise(u=>{l&&a.disposer.dispose(l.overEvent.disposableOnce(A=>{A?(r++,u(!0)):u(!1)})),a.disposer.dispose(h.overEvent.disposableOnce(A=>{A?(r--,u(!0)):u(!1)})),a.disposer.dispose(this.cancelEvent.disposableOn(()=>u(!1)))}))})))break;while(!0)});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...Kn.createDefaultProps()})})(Pt||(Pt={})),p.extendClassProps(Pt.prototype,Pt.createDefaultProps);class uV extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));const{placeEditing:o}=e;let r=new yE(e,void 0);e.editingPoints.splice(i,0,r);const s=()=>{(e.debug??Pt.defaults.debug)&&console.log("delete currentPosEditor");const c=e.editingPoints.indexOf(r);if(c===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(c,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(p.track([r,"position"],[o,"position"])),o.enabled=!0;let a=!1;const l=()=>{s(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!a&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{a=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Pt.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function cV(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class hV extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_doEvent",this.disposeVar(new p.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(cV(e,i)))),(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class vE extends Pt{constructor(n){super(n),this.loop=!1}}class wE extends Pt{constructor(n){super(n),this.loop=!0}}class _f extends gE{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new Ai(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{if(!(n.enabled??tt.defaults.enabled)){i.enabled=!1,i.show=!1;return}do{const s=n.editingPoints.indexOf(this);if(s===-1)break;const a=n.editingPoints.length;if(a===0){console.error("impl.positionEditors.length === 0!");break}if(!(n.loop??tt.defaults.loop)&&s+1>=a)break;const c=this.position;if(!c)break;let h=(s+1)%a;const A=n.editingPoints.get(h).position;if(!A)break;const f=Lf(c,A);if(!f)break;f[2]-=n.czmViewer.editingHeightOffset??0,i.position=f;const d=n.editingPoints.length<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=d,i.show=d;return}while(!1);i.enabled=!1,i.show=!1};o(),this.dispose(n.positionsChanged.disposableOn(o)),this.dispose(n.loopChanged.disposableOn(o)),this.dispose(n.enabledChanged.disposableOn(o))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const s=i.position?[...i.position]:void 0;s&&(s[2]+=n.czmViewer.editingHeightOffset??0);let a=new _f(n,s);n.editingPoints.splice(r+1,0,a),n.modify(a)}))}}}}class tt extends Kn{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"translationEditing");{const o=this.ad(p.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new p.ObjResettingWithEvent(o,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new AV(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new sr(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1});let r=-1;do if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await o.promise(p.step(o,async s=>{const a=s.disposer,l=a.ad(new fV(this));return a.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&l.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),a.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),a.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>l.modify(h))),await s.promise(new Promise(h=>{a.dispose(l.overEvent.disposableOnce(u=>{h(u)}))}))})),r===-1){(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");break}else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const a=this.editingPoints.get(r-1).position;if(!a)return;let l=r%this.editingPoints.length;const h=this.editingPoints.get(l).position;if(!h)return;const u=Lf(a,h);if(!u)return;u&&(u[2]+=this.czmViewer.editingHeightOffset??0);let A=new _f(this,u);this.editingPoints.splice(r,0,A)}while(!0);this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new _f(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...Kn.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),p.extendClassProps(tt.prototype,tt.createDefaultProps);class AV extends p.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const s=this.multiPointsModifyEditing.editingPoints.length;for(let a=1;a<s;a++){const l=this.multiPointsModifyEditing.editingPoints.get(a),c=l.position;c!==void 0&&(l.position=[c[0]+r[0],c[1]+r[1],c[2]+r[2]])}})}}class fV extends p.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=s=>{o(),e.status="Modifying_Point",i=new dV(e,s),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((s,a)=>{if(a==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(a==="modify")r(s);else if(a==="add"){const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else a==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${a})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class dV extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(p.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class bE extends tt{constructor(n){super(n),this.loop=!1}}class _E extends tt{constructor(n){super(n),this.loop=!0}}class Ms extends Pt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([90,0,0]),distance:p.react(1)})})(Ms||(Ms={})),p.extendClassProps(Ms.prototype,Ms.createDefaultProps);class oa extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{do{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];break}if(this.startPosition=this.positions[0],this.positions.length==1){this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;break}this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(Math.abs(o)<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a}while(!1)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),distance:p.react(0)})})(oa||(oa={})),p.extendClassProps(oa.prototype,oa.createDefaultProps);class CE extends Pt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class xE extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Ds extends Pt{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new jn(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Ds||(Ds={})),p.extendClassProps(Ds.prototype,Ds.createDefaultProps);class Rs extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new jn(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Rs||(Rs={})),p.extendClassProps(Rs.prototype,Rs.createDefaultProps);class SE extends oa{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class rn extends Q.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_supportEditing",this.disposeVar(p.react(!0)));L(this,"_currentEditing",this.disposeVar(p.react(void 0)));this.ad(this.supportEditingChanged.don(()=>{this.destroy()})),this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing){if(this.currentEditing instanceof Pt&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;this.currentEditing instanceof ai&&this.currentEditing.enabled&&(e.position=[0,0,0])}}))}get supportEditing(){return this._supportEditing.value}set supportEditing(e){this._supportEditing.value=e}get supportEditingChanged(){return this._supportEditing.changed}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const zc=class zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ai(e));this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"])),i.enabled=!i.position||Q.equalsN3(i.position,[0,0,0]);break}this.supportEditing=!1}while(!1)}};L(zc,"type",zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Place,zc));let Bv=zc;const Qc=class Qc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new si(e));i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"])))});break}if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"]));break}this.supportEditing=!1}while(!1)}};L(Qc,"type",Qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Rotation,Qc));let Mv=Qc;const Vc=class Vc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new lr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")&&Reflect.has(n,"scale")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"scale"],[n,"scale"]));break}this.supportEditing=!1}while(!1)}};L(Vc,"type",Vc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Scale,Vc));let Dv=Vc;const Nc=class Nc extends rn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new sr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const s=n[r];Reflect.has(s,"position")?o.push(s.position):s.points&&o.push(...s.points)}i.position=Q.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,s)=>{if(!(!r||!s)){var a=pn({originPosition:s},[r])[0][0];n.forEach(l=>{if(Reflect.has(l,"position")){const c=pn({originPosition:s},[l.position])[0][0];l.position=vr({originPosition:s},[[c[0]+a[0],c[1]+a[1],c[2]+a[2]]])[0][0]}else if(Reflect.has(l,"points")&&l.points){const c=pn({originPosition:s},l.points)[0];l.points=vr({originPosition:s},c.map(h=>[h[0]+a[0],h[1]+a[1],h[2]+a[2]]))[0]}})}}));break}if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"]));break}if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"]))});break}if(Reflect.has(n,"points")){if(n.points===void 0||n.points.length===0){this.destroy();break}i.position=Q.getMinMaxCorner(n.points).center,this.ad(i.positionChanged.disposableOn((o,r)=>{if(o===void 0||r===void 0||n.points===void 0||n.points.length===0){this.destroy();return}var s=pn({originPosition:r},[o])[0][0];const a=pn({originPosition:r},n.points)[0];n.points=vr({originPosition:r},a.map(l=>[l[0]+s[0],l[1]+s[1],l[2]+s[2]]))[0]}));break}this.supportEditing=!1}while(!1)}};L(Nc,"type",Nc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Translation,Nc));let Cf=Nc;const Hc=class Hc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ms(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const o=dt(n.position);if(C.Cartesian3.ZERO.equals(o)||!e.viewer)return;i.distance=Li(e.viewer.scene,o,100)??1}while(!1);break}if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1);i.startPosition&&!Q.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(Hc,"type",Hc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsAppend,Hc));let Rv=Hc;const Gc=class Gc extends rn{constructor(n,e){var r;if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new oa(e));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const s=dt(n.position);if(C.Cartesian3.ZERO.equals(s)||!e.viewer)return;i.distance=Li(e.viewer.scene,s,100)??1}while(!1);break}if(Reflect.has(n,"points")&&((r=n.points)==null?void 0:r.length)==2){i.moveWithFirstPosition=!1;const s=()=>i.positions=n.points??[];s(),this.ad(n.pointsChanged.don(()=>!i.enabled&&s())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(Gc,"type",Gc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsModify,Gc));let Uv=Gc;const Wc=class Wc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new wE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Wc,"type",Wc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularAppend,Wc));let Ov=Wc;const qc=class qc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new _E(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(qc,"type",qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularInsert,qc));let Lv=qc;const Kc=class Kc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new vE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Kc,"type",Kc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringAppend,Kc));let zv=Kc;const Zc=class Zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new bE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Zc,"type",Zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringInsert,Zc));let Qv=Zc;const Xc=class Xc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new CE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Xc,"type",Xc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterAppend,Xc));let Vv=Xc;const $c=class $c extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new xE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L($c,"type",$c.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterModify,$c));let Nv=$c;const Yc=class Yc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ds(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Yc,"type",Yc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityAppend,Yc));let Hv=Yc;const Jc=class Jc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Rs(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Jc,"type",Jc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityModify,Jc));let Gv=Jc;const jc=class jc extends rn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new SE(e));do{if(Reflect.has(n,"points")){const r=Reflect.has(n,"extrudedHeight"),s=Reflect.has(n,"height"),a=Reflect.has(n,"perPositionHeight")?n.perPositionHeight:!r,l=n instanceof Q.ESClassification||n instanceof Q.ESPolygonFence;let c=Q.getMinMaxCorner(n.points).center,h=[...c],u=l?n.points[0][2]:0;a?r?h[2]=n.extrudedHeight:h[2]=n.height+u:(s&&(c[2]=n.height),r&&(h[2]=n.extrudedHeight)),i.startPosition=c,i.distance=h[2]-c[2],i.moveWithFirstPosition=!1;let A=[...c];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(a?(n.points=n.points.map(f=>[f[0],f[1],f[2]+i.positions[0][2]-A[2]]),r?n.extrudedHeight=i.positions[1][2]:s&&(n.height=i.positions[1][2]-(l?i.positions[0][2]:0))):(s&&(n.height=i.positions[0][2]),r&&(n.extrudedHeight=i.positions[1][2])),A=[...i.positions[0]])}));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(jc,"type",jc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.HeightModify,jc));let Wv=jc;const on=class on extends p.Destroyable{constructor(e,i,o,r=!0){super();L(this,"czmViewer");L(this,"sceneObject");L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);const s=this.czmViewer=e,a=this.sceneObject=i,l=this.editingModes=Array.isArray(o)?[...o]:[o],c=this.editingID=a.editingID;this.useKeyToSwitch=r,s.editingEvent.emit({objectIDs:[a.parentID??a.id],editingID:c,type:"start",add:{modes:l}}),this.ad(a.toDestroyEvent.don(on.stop)),this.ad(s.keyDownEvent.don(h=>{h.code=="Escape"&&on.stop()})),this.createEditingMode(this.currentIndex)}createEditingMode(e){const{sceneObject:i,czmViewer:o,editingID:r}=this,s=new p.Destroyable;this.ad(()=>!s.isDestroyed()&&s.destroy());const a=this.editingModes[e%this.editingModes.length],l=Q.EngineObject.contextEditing.getEngineObjConstructor(a,o.typeName);if(!l||!i.supportEditingModes().includes(a))return this._createNextEditingMode(s,a);const c=new l(i,o);if(s.ad(()=>!c.isDestroyed()&&c.destroy()),c.isDestroyed())return this._createNextEditingMode(s,a);const h=()=>{console.log(`编辑模式${a}结束`),!s.isDestroyed()&&s.destroy(),p.nextAnimateFrame(()=>{this.createEditingMode(++this.currentIndex)})};if(s.ad(c.toDestroyEvent.don(h)),this.useKeyToSwitch&&s.ad(o.keyDownEvent.don(u=>{u.code=="Space"&&h()})),s.ad(o.dblclickEvent.donce(()=>this.useKeyToSwitch?on.stop():h())),c.supportEditing)o.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:r,type:"changed",add:{cMode:a,cIndex:e}}),o.notSupportEditingCount=0;else return this._createNextEditingMode(s,a)}_createNextEditingMode(e,i){const{sceneObject:o,czmViewer:r,editingID:s}=this;if(!e.isDestroyed()&&e.destroy(),console.log(`未找到编辑模式或不支持当前编辑模式${i},已跳过当前编辑模式,请检查输入`),r.editingEvent.emit({objectIDs:[o.parentID??o.id],editingID:s,type:"changedFailed",add:{cMode:i,cIndex:this.currentIndex}}),r.notSupportEditingCount++,r.notSupportEditingCount==this.editingModes.length)return on.stop();p.nextAnimateFrame(()=>{this.createEditingMode(++this.currentIndex)})}static create(e,i,o,r=!0){on.stop(),on.currentEditingInstance=new on(e,i,o,r)}static stop(){if(on.currentEditingInstance&&!on.currentEditingInstance.isDestroyed()){if(!on.currentEditingInstance)return;const{czmViewer:e,sceneObject:i,editingID:o,editingModes:r}=on.currentEditingInstance;on.currentEditingInstance.destroy(),e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:o,type:"end",add:{modes:r}})}on.currentEditingInstance=void 0}};L(on,"currentEditingInstance");let qv=on;function EE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o,r=!0)=>{const s=Array.isArray(o)?[...o]:[o],a=i.editingID;e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"start",add:{modes:s}});const l=()=>{e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"end",add:{modes:s}}),t.isRunning&&t.cancel()};n.disposer.ad(l),n.disposer.ad(i.toDestroyEvent.don(l));const c=u=>{u.code=="Escape"&&l()};n.disposer.ad(e.keyDownEvent.don(c));let h=0;do{const u=s[h%s.length],A=await p.step(n,async f=>{const d=f.disposer,g=Q.EngineObject.contextEditing.getEngineObjConstructor(u,e.typeName);if(!g||!i.supportEditingModes().includes(u))return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;const v=new g(i,e);if(d.ad(()=>{!v.isDestroyed()&&v.destroy()}),v.supportEditing)e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount=0;else return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;return await f.promise(new Promise(m=>{if(v.isDestroyed()&&m(!1),d.ad(v.toDestroyEvent.don(()=>{console.log(`编辑模式${u}结束`),m(!1)})),r){const w=_=>{_.code=="Space"&&(console.log(`编辑模式${u}结束`),m(!1))};d.ad(e.keyDownEvent.don(w)),d.ad(e.dblclickEvent.don(()=>m(!0)))}}))});if(r&&A||!r&&h==s.length-1||e.notSupportEditingCount==s.length)break;h++}while(!0)});return t}function PE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const s=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(s));const a=new Cf(i,e);n.disposer.ad(()=>{!a.isDestroyed()&&a.destroy()}),await n.promise(new Promise(l=>{a.isDestroyed()&&l(),n.disposer.ad(a.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.3.0-beta.16",e="2025-08-08T06:30:54.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="f816491ab81e0c5c7b39011a39ca38c7da7b8ced",a=((Date.now()-1754634654e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4145
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class sV extends p.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const s=i=this._getStartInfo(r.pointerEvent);s&&(this.owner.hoveredPlaneType=s.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{do{const s=this._getStartInfo(r.pointerEvent);if(!s||s.currentPlaneType==="none")break;const{currentPlaneType:a}=s,l=[...this.owner.selfRotation];l[si.rotationNum[a]]=0,this.owner.selfRotation=l;return}while(!1);this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(p.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:s,offsetY:a}=r.pointerEvent,l=[s,a],{currentPlaneType:c}=i;if(c==="none")return;const h=this.owner.getPlane(c);if(!i.currentV)return;const u=h.pick(l);if(!u||!this.owner.cartesian)return;const A=C.Cartesian3.subtract(i.currentV,this.owner.cartesian,new C.Cartesian3);C.Cartesian3.normalize(A,A);const f=C.Cartesian3.subtract(u,this.owner.cartesian,new C.Cartesian3);if(C.Cartesian3.normalize(f,f),!h.normal||!h.origin)return;const d=Fv(A,f,h.normal),g=Fv(h.origin,A,h.normal),v=Fv(h.origin,f,h.normal);{const y=[...this.owner.selfRotation];y[si.rotationNum[c]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await p.step(n,r=>new Promise((s,a)=>{r.disposer.dispose(a),r.disposer.dispose(e.pointerUpEvent.don(()=>{s()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{s()}))}))}))}_pickPlane(n,e,i,o,r){const s=this.owner.cartesian;if(!s)return;const{selfRotation:a}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const c=C.Cartesian3.distance(s,l),h=r/4,u=h*3/128;if(!(c>=h-u&&c<=h+u))return;const f=C.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=f||(n.currentPlaneType=i,n.currentD2c=f,n.currentV=l,n.startRotation=a[si.rotationNum[i]])}_getStartInfo(n){var h;const{czmViewer:e}=this.owner,i=(h=e.viewer)==null?void 0:h.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Li(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:s}=n,a=[r,s],l=n.pointerId,c={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(c,i,"heading",a,o),this._pickPlane(c,i,"pitch",a,o),this._pickPlane(c,i,"roll",a,o),c}}function Fv(t,n,e){const i=C.Cartesian3.cross(n,t,new C.Cartesian3);if(i.equals(C.Cartesian3.ZERO))return 0;C.Cartesian3.normalize(i,i);const o=C.Cartesian3.dot(i,e);let r=Math.acos(C.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const Aa=class Aa extends Mn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(p.react("none")));L(this,"_movingPlaneType",this.disposeVar(p.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new nV(this)),pitch:this.disposeVar(new iV(this)),roll:this.disposeVar(new rV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new sV(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&dt(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new Nt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(p.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(p.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(p.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=at({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=C.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Bs(e));this.dispose(p.track([o,"position"],[this,"position"])),this.dispose(p.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(p.track([o,"debug"],[this,"debug"])),this.dispose(p.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=Aa.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[Aa.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const s=this.movingPlaneType===i,a=this.hoveredPlaneType===i,c=[0,0,0,s||a?1:.8];c[Aa.rotationNum[i]]=1,o.color=c};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(Aa,"rotationNum",{heading:0,pitch:1,roll:2}),L(Aa,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let si=Aa;(t=>{t.createDefaultProps=()=>({...Mn.createDefaultProps(),rotation:p.reactArray([0,0,0]),selfRotation:p.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(si||(si={})),p.extendClassProps(si.prototype,si.createDefaultProps);const fa=class fa extends p.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??fa.defaults.positions[0],this.stopPosition??fa.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??fa.defaults.positions[0],n??fa.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Je(n,e));o.arcType="RHUMB";const r=this.ad(new zn(n,e));this.ad(p.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(p.track([r,"allowPicking"],[this,"allowPicking"]));{const s=()=>{o.show=r.show=this.show};s(),this.ad(this.showChanged.don(s))}{const s=()=>{o.width=this.width/2,r.pixelSize=this.width};s(),this.ad(this.widthChanged.don(s))}{const s=()=>{o.color=r.color=this.color};s(),this.ad(this.colorChanged.don(s))}{const s=()=>{o.positions=this.positions,r.position=this.stopPosition};s(),this.dispose(this.startPositionChanged.disposableOn(s)),this.dispose(this.stopPositionChanged.disposableOn(s))}}};L(fa,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let ra=fa;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(t.defaults.positions),width:10,color:p.reactArray([1,0,0,1])})})(ra||(ra={})),p.extendClassProps(ra.prototype,ra.createDefaultProps);class lr extends Mn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(p.react(!1)),moved:this.ad(p.react(!1)),constraintMode:this.disposeVar(p.react("none")),originPosition:this.disposeVar(p.reactArray([0,0,0])),originHeading:this.disposeVar(p.react(0)),originDimensions:this.disposeVar(p.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(p.reactArray([0,0,0])),movingPosition:this.disposeVar(p.reactArray([0,0,0])),targetPosition:this.disposeVar(p.reactArray([0,0,0])),targetHeading:this.disposeVar(p.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new p.Processing((i,o,r)=>{const s=[0,0,0],a=new C.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const c=Yn(p.getDomEventCurrentTargetPos(l.pointerEvent));if(!ga(e.viewer.scene,c,this._opInfo.originPosition.value[2],a))return;pa(a,s),this._opInfo.constraintMode.value==="x"?vo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,s,s):this._opInfo.constraintMode.value==="y"?vo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,s,s):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=s,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const h=[0,0,0];Q.geoRhumbDestination(s,r,o,h),this._opInfo.targetPosition.value=h;let u=this.scale[0],A=this.scale[1];const f=Q.geoDistance(h,this._opInfo.originPosition.value)-Q.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...h];const d=this._opInfo.originDimensions.value[0]/100;f!=0&&this._opInfo.constraintMode.value==="y"&&(f>0?u+=d:u-=d),f!=0&&this._opInfo.constraintMode.value==="x"&&(f>0?A+=d:A-=d),u<=0&&(u+=d),A<=0&&(A+=d),this.scale=[u??1,A??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new p.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Yn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!ih(e.viewer.scene,dt(this._opInfo.originPosition.value),s,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const a=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+a];let c=this.scale[2];const h=o[2]-this._lastPosition[2];this._lastPosition=[...o];const u=this._opInfo.originDimensions.value[0]/100;h!=0&&(h>0?c+=u:c-=u),c<=0&&(c+=u),this.scale=[this.scale[0]??1,this.scale[1]??1,c??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new qf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const c=()=>{if(!this._scaleAxis)return;const{zAxis:h,yAxis:u,xAxis:A}=this._scaleAxis,f=this._opInfo.constraintMode.value,d=this._opInfo.step;h.color=[0,0,1,.99],u.color=[0,1,0,.99],A.color=[1,0,0,.99],f==="x"?A.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="y"?u.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="z"&&(h.color=d?[1,1,0,.8]:[1,1,0,.99])};c(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(c)),this.dispose(this._opInfo.step.changed.disposableOn(c))}{const c=()=>{if(!this._scaleAxis)return;const{position:u=lr.defaults.position}=this,{zAxis:A,yAxis:f,xAxis:d}=this._scaleAxis;A.startPosition=f.startPosition=d.startPosition=u;const[g,v,y]=u;A.stopPosition=[g,v,y+this._opInfo.originDimensions.value[2]];const m=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const w=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[1],0);w&&(f.stopPosition=w)};c();const h=this.ad(p.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(h.don(c))}{const c=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((h,u)=>h===this._opInfo.targetPosition.value[u])){this._opInfo.moved.value=!0;return}};c(),this.dispose(this._opInfo.originHeading.changed.disposableOn(c)),this.dispose(this._opInfo.originPosition.changed.disposableOn(c)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(c)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(c))}const r=this._pickingXYProcessing(e),s=this._pickingZProcessing(e),a=this.disposeVar(p.createProcessingFromAsyncFunc(async c=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",c.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await p.step(c,async h=>{const u=()=>{const d=[...this.position??lr.defaults.position];e.editingHeightOffset&&(d[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=d};h.disposer.dispose((u(),this.positionChanged.disposableOn(u)));const A={constraintMode:"none",startDragPos:[0,0,0]},f=d=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Df(d,o,g,this.axisSnapPixelSize,A),this._opInfo.constraintMode.value=A.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=A.startDragPos};h.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&f(d.pointerEvent)})),await p.step(h,d=>new Promise((g,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&f(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&A.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await p.step(c,async h=>{if(e.incrementDisabledInputStack(),h.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const u=Q.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),A=Q.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,u,A),h.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(s.restart(),h.disposer.dispose(()=>s.cancel()));await p.step(h,u=>new Promise((A,f)=>{u.disposer.dispose(f),u.disposer.dispose(e.pointerUpEvent.don(()=>{A()})),u.disposer.dispose(e.pointerOutEvent.don(()=>{A()}))})),this._lastPosition=void 0});while(!0)})),l=()=>{this.enabled?a.restart():a.isRunning&&a.cancel()};l(),this.dispose(this.enabledChanged.disposableOn(l))}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new ra(e));return o.width=10,this.ad(p.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Mn.createDefaultProps(),scale:p.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(lr||(lr={})),p.extendClassProps(lr.prototype,lr.createDefaultProps);const go=class go extends fn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new p.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(p.react(!1)));L(this,"_status",this.disposeVar(p.react("None")));L(this,"_positionsChanged",this.ad(new p.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:s}of i){for(const a of s)a.menuPoi.enabled=this.menuPoiEnabled??!1;for(let a=o;a<o+r;++a)this.editingPoints.get(a).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(p.nextAnimateFrame(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()}))})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??go.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((s,a)=>{const l=this.editingPoints.get(r);return l.position&&l.position[a]===s})))}forceResetPositions(e){(this.enabled??go.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Je(e));this.ad(p.track([i,"color"],[this,"polylineColor"])),this.ad(p.track([i,"width"],[this,"polylineWidth"])),this.ad(p.track([i,"show"],[this,"polylineShow"])),this.ad(p.track([i,"arcType"],[this,"polylineArcType"])),this.ad(p.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const s of this.getPositions())s[2]-=e.editingHeightOffset??0,r.push(s);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new p.CursorInfo(e.container,p.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(go,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(go,"defaults",{...fn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:go.baseImageUrl+"point-green.png",otherControlPointImageUrl:go.baseImageUrl+"point-yellow.png"});let Kn=go;(t=>{t.createDefaultProps=()=>({...fn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:p.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(Kn||(Kn={})),p.extendClassProps(Kn.prototype,Kn.createDefaultProps);let lV=0;class gE extends p.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_id",lV++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new Ta(e.czmViewer));o.enabled=!1,this.ad(p.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const s=[...this.position];s[2]-=e.czmViewer.editingHeightOffset??0,o.position=s,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const s=e.editingPoints.indexOf(this)+1;s!==0&&(o.title=`控制点${s}`,s===1?o.imageUri=e.firstControlPointImageUrl??Kn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??Kn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class yE extends gE{constructor(n,e){super(n,e)}}class Pt extends Kn{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new p.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new ai(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Pt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Pt.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(p.step(o,async r=>{const s=r.disposer,a=s.ad(this._addingEditingProcessing());s.dispose(()=>"adding canceled!"),s.dispose(this.cancelEvent.disposableOn(()=>a.cancel())),await r.promise(new Promise(l=>{s.dispose(a.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new yE(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Pt.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=p.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1;do if(!await o.promise(p.step(o,async a=>{let l;!e()&&(l=a.disposer.disposeVar(new uV(this,r)));const h=a.disposer.disposeVar(new hV(this,r));return a.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>h.do())),await a.promise(new Promise(u=>{l&&a.disposer.dispose(l.overEvent.disposableOnce(A=>{A?(r++,u(!0)):u(!1)})),a.disposer.dispose(h.overEvent.disposableOnce(A=>{A?(r--,u(!0)):u(!1)})),a.disposer.dispose(this.cancelEvent.disposableOn(()=>u(!1)))}))})))break;while(!0)});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...Kn.createDefaultProps()})})(Pt||(Pt={})),p.extendClassProps(Pt.prototype,Pt.createDefaultProps);class uV extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));const{placeEditing:o}=e;let r=new yE(e,void 0);e.editingPoints.splice(i,0,r);const s=()=>{(e.debug??Pt.defaults.debug)&&console.log("delete currentPosEditor");const c=e.editingPoints.indexOf(r);if(c===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(c,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(p.track([r,"position"],[o,"position"])),o.enabled=!0;let a=!1;const l=()=>{s(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!a&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{a=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Pt.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function cV(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class hV extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_doEvent",this.disposeVar(new p.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(cV(e,i)))),(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class vE extends Pt{constructor(n){super(n),this.loop=!1}}class wE extends Pt{constructor(n){super(n),this.loop=!0}}class _f extends gE{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new Ai(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{if(!(n.enabled??tt.defaults.enabled)){i.enabled=!1,i.show=!1;return}do{const s=n.editingPoints.indexOf(this);if(s===-1)break;const a=n.editingPoints.length;if(a===0){console.error("impl.positionEditors.length === 0!");break}if(!(n.loop??tt.defaults.loop)&&s+1>=a)break;const c=this.position;if(!c)break;let h=(s+1)%a;const A=n.editingPoints.get(h).position;if(!A)break;const f=Lf(c,A);if(!f)break;f[2]-=n.czmViewer.editingHeightOffset??0,i.position=f;const d=n.editingPoints.length<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=d,i.show=d;return}while(!1);i.enabled=!1,i.show=!1};o(),this.dispose(n.positionsChanged.disposableOn(o)),this.dispose(n.loopChanged.disposableOn(o)),this.dispose(n.enabledChanged.disposableOn(o))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const s=i.position?[...i.position]:void 0;s&&(s[2]+=n.czmViewer.editingHeightOffset??0);let a=new _f(n,s);n.editingPoints.splice(r+1,0,a),n.modify(a)}))}}}}class tt extends Kn{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"translationEditing");{const o=this.ad(p.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new p.ObjResettingWithEvent(o,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new AV(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new sr(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1});let r=-1;do if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await o.promise(p.step(o,async s=>{const a=s.disposer,l=a.ad(new fV(this));return a.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&l.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),a.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),a.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>l.modify(h))),await s.promise(new Promise(h=>{a.dispose(l.overEvent.disposableOnce(u=>{h(u)}))}))})),r===-1){(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");break}else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const a=this.editingPoints.get(r-1).position;if(!a)return;let l=r%this.editingPoints.length;const h=this.editingPoints.get(l).position;if(!h)return;const u=Lf(a,h);if(!u)return;u&&(u[2]+=this.czmViewer.editingHeightOffset??0);let A=new _f(this,u);this.editingPoints.splice(r,0,A)}while(!0);this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new _f(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...Kn.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),p.extendClassProps(tt.prototype,tt.createDefaultProps);class AV extends p.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const s=this.multiPointsModifyEditing.editingPoints.length;for(let a=1;a<s;a++){const l=this.multiPointsModifyEditing.editingPoints.get(a),c=l.position;c!==void 0&&(l.position=[c[0]+r[0],c[1]+r[1],c[2]+r[2]])}})}}class fV extends p.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=s=>{o(),e.status="Modifying_Point",i=new dV(e,s),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((s,a)=>{if(a==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(a==="modify")r(s);else if(a==="add"){const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else a==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${a})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class dV extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(p.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class bE extends tt{constructor(n){super(n),this.loop=!1}}class _E extends tt{constructor(n){super(n),this.loop=!0}}class Ms extends Pt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([90,0,0]),distance:p.react(1)})})(Ms||(Ms={})),p.extendClassProps(Ms.prototype,Ms.createDefaultProps);class oa extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{do{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];break}if(this.startPosition=this.positions[0],this.positions.length==1){this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;break}this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(Math.abs(o)<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a}while(!1)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),distance:p.react(0)})})(oa||(oa={})),p.extendClassProps(oa.prototype,oa.createDefaultProps);class CE extends Pt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class xE extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Ds extends Pt{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new jn(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Ds||(Ds={})),p.extendClassProps(Ds.prototype,Ds.createDefaultProps);class Rs extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new jn(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Rs||(Rs={})),p.extendClassProps(Rs.prototype,Rs.createDefaultProps);class SE extends oa{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class rn extends Q.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_supportEditing",this.disposeVar(p.react(!0)));L(this,"_currentEditing",this.disposeVar(p.react(void 0)));this.ad(this.supportEditingChanged.don(()=>{this.destroy()})),this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing){if(this.currentEditing instanceof Pt&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;this.currentEditing instanceof ai&&this.currentEditing.enabled&&(e.position=[0,0,0])}}))}get supportEditing(){return this._supportEditing.value}set supportEditing(e){this._supportEditing.value=e}get supportEditingChanged(){return this._supportEditing.changed}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const zc=class zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ai(e));this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"])),i.enabled=!i.position||Q.equalsN3(i.position,[0,0,0]);break}this.supportEditing=!1}while(!1)}};L(zc,"type",zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Place,zc));let Bv=zc;const Qc=class Qc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new si(e));i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"])))});break}if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"]));break}this.supportEditing=!1}while(!1)}};L(Qc,"type",Qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Rotation,Qc));let Mv=Qc;const Vc=class Vc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new lr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")&&Reflect.has(n,"scale")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"scale"],[n,"scale"]));break}this.supportEditing=!1}while(!1)}};L(Vc,"type",Vc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Scale,Vc));let Dv=Vc;const Nc=class Nc extends rn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new sr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const s=n[r];Reflect.has(s,"position")?o.push(s.position):s.points&&o.push(...s.points)}i.position=Q.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,s)=>{if(!(!r||!s)){var a=pn({originPosition:s},[r])[0][0];n.forEach(l=>{if(Reflect.has(l,"position")){const c=pn({originPosition:s},[l.position])[0][0];l.position=vr({originPosition:s},[[c[0]+a[0],c[1]+a[1],c[2]+a[2]]])[0][0]}else if(Reflect.has(l,"points")&&l.points){const c=pn({originPosition:s},l.points)[0];l.points=vr({originPosition:s},c.map(h=>[h[0]+a[0],h[1]+a[1],h[2]+a[2]]))[0]}})}}));break}if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"]));break}if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"]))});break}if(Reflect.has(n,"points")){if(n.points===void 0||n.points.length===0){this.destroy();break}i.position=Q.getMinMaxCorner(n.points).center,this.ad(i.positionChanged.disposableOn((o,r)=>{if(o===void 0||r===void 0||n.points===void 0||n.points.length===0){this.destroy();return}var s=pn({originPosition:r},[o])[0][0];const a=pn({originPosition:r},n.points)[0];n.points=vr({originPosition:r},a.map(l=>[l[0]+s[0],l[1]+s[1],l[2]+s[2]]))[0]}));break}this.supportEditing=!1}while(!1)}};L(Nc,"type",Nc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Translation,Nc));let Cf=Nc;const Hc=class Hc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ms(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const o=dt(n.position);if(C.Cartesian3.ZERO.equals(o)||!e.viewer)return;i.distance=Li(e.viewer.scene,o,100)??1}while(!1);break}if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1);i.startPosition&&!Q.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(Hc,"type",Hc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsAppend,Hc));let Rv=Hc;const Gc=class Gc extends rn{constructor(n,e){var r;if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new oa(e));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const s=dt(n.position);if(C.Cartesian3.ZERO.equals(s)||!e.viewer)return;i.distance=Li(e.viewer.scene,s,100)??1}while(!1);break}if(Reflect.has(n,"points")&&((r=n.points)==null?void 0:r.length)==2){i.moveWithFirstPosition=!1;const s=()=>i.positions=n.points??[];s(),this.ad(n.pointsChanged.don(()=>!i.enabled&&s())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(Gc,"type",Gc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsModify,Gc));let Uv=Gc;const Wc=class Wc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new wE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Wc,"type",Wc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularAppend,Wc));let Ov=Wc;const qc=class qc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new _E(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(qc,"type",qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularInsert,qc));let Lv=qc;const Kc=class Kc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new vE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Kc,"type",Kc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringAppend,Kc));let zv=Kc;const Zc=class Zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new bE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Zc,"type",Zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringInsert,Zc));let Qv=Zc;const Xc=class Xc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new CE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Xc,"type",Xc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterAppend,Xc));let Vv=Xc;const $c=class $c extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new xE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L($c,"type",$c.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterModify,$c));let Nv=$c;const Yc=class Yc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ds(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Yc,"type",Yc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityAppend,Yc));let Hv=Yc;const Jc=class Jc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Rs(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Jc,"type",Jc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityModify,Jc));let Gv=Jc;const jc=class jc extends rn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new SE(e));do{if(Reflect.has(n,"points")){const r=Reflect.has(n,"extrudedHeight"),s=Reflect.has(n,"height"),a=Reflect.has(n,"perPositionHeight")?n.perPositionHeight:!r,l=n instanceof Q.ESClassification||n instanceof Q.ESPolygonFence;let c=Q.getMinMaxCorner(n.points).center,h=[...c],u=l?n.points[0][2]:0;a?r?h[2]=n.extrudedHeight:h[2]=n.height+u:(s&&(c[2]=n.height),r&&(h[2]=n.extrudedHeight)),i.startPosition=c,i.distance=h[2]-c[2],i.moveWithFirstPosition=!1;let A=[...c];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(a?(n.points=n.points.map(f=>[f[0],f[1],f[2]+i.positions[0][2]-A[2]]),r?n.extrudedHeight=i.positions[1][2]:s&&(n.height=i.positions[1][2]-(l?i.positions[0][2]:0))):(s&&(n.height=i.positions[0][2]),r&&(n.extrudedHeight=i.positions[1][2])),A=[...i.positions[0]])}));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(jc,"type",jc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.HeightModify,jc));let Wv=jc;const on=class on extends p.Destroyable{constructor(e,i,o,r=!0){super();L(this,"czmViewer");L(this,"sceneObject");L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);const s=this.czmViewer=e,a=this.sceneObject=i,l=this.editingModes=Array.isArray(o)?[...o]:[o],c=this.editingID=a.editingID;this.useKeyToSwitch=r,s.editingEvent.emit({objectIDs:[a.parentID??a.id],editingID:c,type:"start",add:{modes:l}}),this.ad(a.toDestroyEvent.don(on.stop)),this.ad(s.keyDownEvent.don(h=>{h.code=="Escape"&&on.stop()})),this.createEditingMode(this.currentIndex)}createEditingMode(e){const{sceneObject:i,czmViewer:o,editingID:r}=this,s=new p.Destroyable;this.ad(()=>!s.isDestroyed()&&s.destroy());const a=this.editingModes[e%this.editingModes.length],l=Q.EngineObject.contextEditing.getEngineObjConstructor(a,o.typeName);if(!l||!i.supportEditingModes().includes(a))return this._createNextEditingMode(s,a);const c=new l(i,o);if(s.ad(()=>!c.isDestroyed()&&c.destroy()),c.isDestroyed())return this._createNextEditingMode(s,a);const h=()=>{console.log(`编辑模式${a}结束`),!s.isDestroyed()&&s.destroy(),p.nextAnimateFrame(()=>{this.createEditingMode(++this.currentIndex)})};if(s.ad(c.toDestroyEvent.don(h)),this.useKeyToSwitch&&s.ad(o.keyDownEvent.don(u=>{u.code=="Space"&&h()})),s.ad(o.dblclickEvent.donce(()=>this.useKeyToSwitch?on.stop():h())),c.supportEditing)o.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:r,type:"changed",add:{cMode:a,cIndex:e}}),o.notSupportEditingCount=0;else return this._createNextEditingMode(s,a)}_createNextEditingMode(e,i){const{sceneObject:o,czmViewer:r,editingID:s}=this;if(!e.isDestroyed()&&e.destroy(),console.log(`未找到编辑模式或不支持当前编辑模式${i},已跳过当前编辑模式,请检查输入`),r.editingEvent.emit({objectIDs:[o.parentID??o.id],editingID:s,type:"changedFailed",add:{cMode:i,cIndex:this.currentIndex}}),r.notSupportEditingCount++,r.notSupportEditingCount==this.editingModes.length)return on.stop();p.nextAnimateFrame(()=>{this.createEditingMode(++this.currentIndex)})}static create(e,i,o,r=!0){on.stop(),on.currentEditingInstance=new on(e,i,o,r)}static stop(){if(on.currentEditingInstance&&!on.currentEditingInstance.isDestroyed()){if(!on.currentEditingInstance)return;const{czmViewer:e,sceneObject:i,editingID:o,editingModes:r}=on.currentEditingInstance;on.currentEditingInstance.destroy(),e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:o,type:"end",add:{modes:r}})}on.currentEditingInstance=void 0}};L(on,"currentEditingInstance");let qv=on;function EE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o,r=!0)=>{const s=Array.isArray(o)?[...o]:[o],a=i.editingID;e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"start",add:{modes:s}});const l=()=>{e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"end",add:{modes:s}}),t.isRunning&&t.cancel()};n.disposer.ad(l),n.disposer.ad(i.toDestroyEvent.don(l));const c=u=>{u.code=="Escape"&&l()};n.disposer.ad(e.keyDownEvent.don(c));let h=0;do{const u=s[h%s.length],A=await p.step(n,async f=>{const d=f.disposer,g=Q.EngineObject.contextEditing.getEngineObjConstructor(u,e.typeName);if(!g||!i.supportEditingModes().includes(u))return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;const v=new g(i,e);if(d.ad(()=>{!v.isDestroyed()&&v.destroy()}),v.supportEditing)e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount=0;else return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;return await f.promise(new Promise(m=>{if(v.isDestroyed()&&m(!1),d.ad(v.toDestroyEvent.don(()=>{console.log(`编辑模式${u}结束`),m(!1)})),r){const w=_=>{_.code=="Space"&&(console.log(`编辑模式${u}结束`),m(!1))};d.ad(e.keyDownEvent.don(w)),d.ad(e.dblclickEvent.don(()=>m(!0)))}}))});if(r&&A||!r&&h==s.length-1||e.notSupportEditingCount==s.length)break;h++}while(!0)});return t}function PE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const s=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(s));const a=new Cf(i,e);n.disposer.ad(()=>{!a.isDestroyed()&&a.destroy()}),await n.promise(new Promise(l=>{a.isDestroyed()&&l(),n.disposer.ad(a.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.3.0-beta.18",e="2025-08-09T09:17:14.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="0726e990dfd959605c6040b45cc99223148fee71",a=((Date.now()-1754731034e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4146
4146
|
%c${o?o+`
|
|
4147
4147
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4148
|
-
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4148
|
+
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","0726e990dfd959605c6040b45cc99223148fee71")},get info(){return l},get date(){return"2025-08-09T09:17:14.000Z"},get author(){return"suplyang"},get version(){return"3.3.0-beta.18"},get name(){return"earthsdk3-cesium"},get commitId(){return"0726e990dfd959605c6040b45cc99223148fee71"},print(){console.info(this.info,`
|
|
4149
4149
|
font-size: 18px;
|
|
4150
4150
|
font-weight: 1000;
|
|
4151
4151
|
line-height: 1;
|