earthsdk3-cesium 3.4.0-beta.3 → 3.4.0-beta.4
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.
|
@@ -3721,7 +3721,7 @@ void main()
|
|
|
3721
3721
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
3722
3722
|
}
|
|
3723
3723
|
`,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(f.track([this._customPrimitive,"show"],[this,"show"])),this.d(f.track([this._geoPolyline,"show"],[this,"show"])),this.d(f.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(f.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(f.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let r=function(u,h){const c=[];for(const A of h)switch(A){case"SquareMeter_SquareKilometer":u>=1e6?c.push(`面积:${(u/1e6).toFixed(2)} km²`):c.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const p=u*(1/666.7);if(p>=15){const d=p/15;c.push(`面积:${d.toFixed(2)} 公顷`)}else c.push(`面积:${p.toFixed(2)} 亩`);break}return c};const s=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...r(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=po([...u].join(`
|
|
3724
|
-
`),24))};s(),this.d(this.totalAreaChanged.don(s)),this.d(this.unitsChanged.don(s)),this.d(f.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Vb(this.positions):this._geoDivPoi.position=void 0)}));const a=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??ea.defaults.interpolationDistance,h=this.interpolation??ea.defaults.interpolation,c=this.offsetHeight??ea.defaults.offsetHeight,A=this.drillDepth??ea.defaults.drillDepth,p=[];if(this.positions)for(let O=0;O<this.positions.length;++O){const z=C.Cartesian3.fromDegrees(this.positions[O][0],this.positions[O][1],this.positions[O][2]);p.push(z)}var d=dz(p);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z)){console.warn("法向量计算错误!");return}var g=pz(p),v=C.Cartesian3.normalize(g,new C.Cartesian3),y=C.Cartesian3.dot(v,d);y<0&&(d=FS(d),p.reverse());let m=C.Transforms.eastNorthUpToFixedFrame(g),w=C.Matrix4.inverseTransformation(m,new C.Matrix4);if(Math.abs(y)<.999){const O=mz(d,v);var b=FS(g),E=C.Matrix4.fromTranslation(b,new C.Matrix4);w=C.Matrix4.multiply(O,E,E),m=C.Matrix4.inverse(w,new C.Matrix4)}var T=ms(p,w),P=[],k=[],D=yz(T);if(h&&u>0){var B=gz(T);const O=Math.max(B.maxy-B.miny,B.maxx-B.minx);var S=bz(D,B,u);const z=await av(S,m,w,d,o.scene,c,A,O);var I=Cz(T,u);const Q=await av(I,m,w,d,o.scene,c,A,O);k.push(...z.world_cartesian),P.push(...z.local),k.push(...Q.world_cartesian),P.push(...Q.local);for(let N=0;N<T.length;++N){const W=T[N];var _=await av([W],m,w,d,o.scene,c,A,O);if(_.local.length>0)P.push(..._.local),k.push(..._.world_cartesian);else{const J=[W.x,W.y,W.z+c];P.push(J);var x=ms([C.Cartesian3.fromArray(J)],m);for(let j=0;j<x.length;++j)k.push(x[j])}}}else{const O=T.map(z=>C.Cartesian3.fromArray([z.x,z.y,z.z+O]));P=O,k=ms(O,m)}var U=vz(P,D);const F=wz(k,U);this.totalArea=F;const M=[];P.forEach(O=>{const z=[O.x,O.y,O.z];z&&M.push(...z)});const R={position:{typedArray:new Float32Array(M),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=C.Matrix4.toArray(m),this.customPrimitive.attributes=R;const O=await fz([...U]);this.customPrimitive.indexTypedArray=new Uint32Array(O),this.customPrimitive.show=!0;const z=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:Q,max:N}=z;this.customPrimitive.setLocalAxisedBoundingBox(Q,N)}},l=this.dv(f.createProcessingFromAsyncFunc(async u=>{await u.promise(a()),this._starting=!1,s()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,s(),l.restart()})),this.d(this.stopEvent.don(()=>{l.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,s()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};L(ea,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Wo=ea;(t=>{t.createDefaultProps=()=>({positions:f.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:f.reactArray([1,1,1,1]),units:f.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Wo||(Wo={})),f.extendClassProps(Wo.prototype,Wo.createDefaultProps);async function fz(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await kS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function dz(t){var n=new C.Cartesian3(0,0,0),e=new C.Cartesian3(0,0,0),i=new C.Cartesian3(0,0,0),o=new C.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var s=t[u],a;u==0?a=t[t.length-1]:a=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=C.Cartesian3.subtract(s,a,n),e=C.Cartesian3.subtract(s,l,e),i=C.Cartesian3.cross(n,e,i),!i.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6)&&(i=C.Cartesian3.normalize(i,i),o=C.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function pz(t){var n=new C.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=C.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function FS(t){return new C.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function mz(t,n){var e=C.Cartesian3.cross(t,n,new C.Cartesian3);e=C.Cartesian3.normalize(e,e);var i=C.Cartesian3.cross(t,e,new C.Cartesian3);i=C.Cartesian3.normalize(i,i);var o=t,r=new C.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function ms(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=C.Matrix4.multiplyByPoint(n,i,new C.Cartesian3);e.push(o)}return e}function gz(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function yz(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function vz(t,n){var e=[];t.forEach(s=>{const a=[s.x,s.y];e.push(a)});var i=rv.from(e).triangles;const o=[],r=sn([n]);for(let s=0;s<i.length;s+=3){const a=i[s],l=i[s+1],u=i[s+2],h=(t[a].x+t[l].x+t[u].x)/3,c=(t[a].y+t[l].y+t[u].y)/3;ln([h,c],r)&&o.push(a,l,u)}return new Uint32Array(o.reverse())}function wz(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=_z(o)}return e}function _z(t){var n=C.Cartesian3.distance(t[0],t[1]),e=C.Cartesian3.distance(t[1],t[2]),i=C.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function bz(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)Sz([o,r],t)&&i.push(new C.Cartesian3(o,r,0));return i}function Cz(t,n){var e=[];for(let s=0;s<t.length;++s){var i=t[s],o;s==t.length-1?o=t[0]:o=t[s+1];var r=xz(i,o,n);e.push(...r)}return e}function xz(t,n,e){var i=[],o=C.Cartesian3.distance(t,n),r=C.Cartesian3.subtract(n,t,new C.Cartesian3);if(r.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6))return[];r=C.Cartesian3.normalize(r,r);for(var s=e;s<o;){var a=new C.Cartesian3(r.x*s,r.y*s,r.z*s),l=C.Cartesian3.add(t,a,new C.Cartesian3);i.push(l),s+=e}return i}function Sz(t,n){var e=Wr(t);if(!xL(Wr(n[0]),Wr(n[n.length-1])))return!1;var i=[];i.push(n);var o=sn(i);return ln(e,o)}async function av(t,n,e,i,o,r,s,a){var l=[];t.forEach(w=>{var b=w.clone();b.z=a,l.push(b)});var u=ms(l,n),h=new C.Cartesian3(-1*i.x,-1*i.y,-1*i.z),c=[],A=[],p=[];for(let w=0;w<u.length;++w){await kS();var d=u[w],g=new C.Ray(d,h),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new C.Ray(d,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=ms([y],e);m.forEach(b=>{b.z+=r}),y=ms(m,n)[0],p.push(y),y=C.Cartographic.fromCartesian(y),c.push([y.longitude,y.latitude,y.height]),A.push(m[0])}}}return{local:A,world:c,world_cartesian:p}}const yc=class yc extends kn{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Wo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(f.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(f.track([r,"units"],[e,"units"])),this.d(f.track([r,"show"],[e,"show"])),this.d(f.track([r,"positions"],[e,"points"])),this.d(f.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(f.track([r,"offsetHeight"],[e,"offsetHeight"]));{const s=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};s();const a=this.disposeVar(f.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(a.disposableOn(s))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}};L(yc,"type",yc.register("ESCesiumViewer",V.ESSurfaceAreaMeasurement.type,yc));let sv=yc;async function Ez(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const vc=class vc extends V.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new V.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends f.Destroyable{constructor(a,l,u){if(super(),this._subContainer=a,!u||!(u instanceof tt))return;u.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h)),h.style.width="100%",h.style.position="absolute",h.style.height=`${V.ESViewerStatusBar.defaults.height}px`,h.style.left="0",h.style.bottom="0",h.style.color="#fff",h.style.padding="0 20px 0 0",h.style.boxSizing="border-box",h.style.lineHeight=`${V.ESViewerStatusBar.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const c=document.createElement("span");h.appendChild(c),this.dispose(()=>h.removeChild(c));const A=document.createElement("span");c.appendChild(A),this.dispose(()=>c.removeChild(A));const p=document.createElement("span");c.appendChild(p),p.addEventListener("dblclick",function(){let g=p.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),Ez(g)}),p.style.cursor="pointer",this.dispose(()=>c.removeChild(p));const d=document.createElement("span");h.appendChild(d),this.dispose(()=>h.removeChild(d));{const g=()=>{h.style.height=(e.height??V.ESViewerStatusBar.defaults.height)+"px",h.style.lineHeight=(e.height??V.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{h.style.fontSize=(e.fontSize??V.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?h.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:h.style.background=`rgba(${V.ESViewerStatusBar.defaults.bgColor[0]},${V.ESViewerStatusBar.defaults.bgColor[1]},${V.ESViewerStatusBar.defaults.bgColor[2]},${V.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{d.innerText=`Cesium 版本 : ${C.VERSION} `;let g;const v=()=>{e.show?(h.style.display="flex",g=this.disposeVar(f.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const w=u.getCameraInfo();if(w){const T=(k,D)=>w.position[k].toFixed(D),P=(k,D)=>w.rotation[k].toFixed(D);y=`帧率:${u.getFPS()}FPS 经度: ${T(0,5)}° 纬度: ${T(1,5)}° 高度: ${T(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}A.innerText=y;const b=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(b){const T=(P,k)=>b[P].toFixed(k);m=`鼠标位置:${T(0,5)}° ${T(1,5)}° ${T(2,2)}m`}else m="暂时无法获取鼠标位置...";p.innerText=m})),g.start()):(h.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(vc,"type",vc.register("ESCesiumViewer",V.ESViewerStatusBar.type,vc));let lv=vc;const wc=class wc extends V.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new V.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(f.track([r,"show"],[e,"show"])),r.instanceClass=class extends f.Destroyable{constructor(a,l,u){if(super(),this._subContainer=a,!u||!(u instanceof tt))return;u.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));const c=document.createElement("div");h.appendChild(c),c.style.width="100%",c.className="ESViewerStatusBarScale",c.style.position="absolute",c.style.display="flex",c.style.height=`${V.ESViewerStatusBarScale.defaults.height}px`,c.style.left="0",c.style.bottom="0",c.style.color="#fff",c.style.padding="0 20px 0 0",c.style.boxSizing="border-box",c.style.lineHeight=`${V.ESViewerStatusBarScale.defaults.height}px`,c.style.zIndex="100",c.style.alignContent="center",c.style.justifyContent="space-between";const A=document.createElement("div");c.appendChild(A);const p=document.createElement("div");A.appendChild(p);const d=document.createElement("div");A.appendChild(d);const g=document.createElement("div");c.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const w=document.createElement("span");g.appendChild(w);{const k=()=>{c.style.height=(e.height??V.ESViewerStatusBarScale.defaults.height)+"px",c.style.lineHeight=(e.height??V.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(k)),k()}{const k=()=>{c.style.fontSize=(e.fontSize??V.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(k)),k()}{const k=()=>{e.bgColor?c.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:c.style.background=`rgba(${V.ESViewerStatusBarScale.defaults.bgColor[0]},${V.ESViewerStatusBarScale.defaults.bgColor[1]},${V.ESViewerStatusBarScale.defaults.bgColor[2]},${V.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(k)),k()}A.style.display="flex",p.style.fontWeight="bold",p.style.padding="0 0 0 25px";let b="EarthSDK";p.innerText=b,d.style.fontWeight="";let E="——免费开源地球可视化开发包";d.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",w.style.display="flex",w.style.zIndex="101",w.style.justifyContent="flex-end",w.style.right="0";const T=()=>{const k=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||k&&k>1e6)v.style.display="none";else{v.style.display="block";const D=i.viewerLegend.legend.computedLengthInStr;D&&(y.innerHTML=D);const B=i.viewerLegend.legend.computedLengthInPixels;if(B){m.style.width=`${B}px`;const S=(135-B)/2;m.style.left=`${S}px`}}};T();const P=setInterval(()=>{T()},200);this.dispose(()=>clearInterval(P));{let k;const D=()=>{e.show?(h.style.display="block",k=this.disposeVar(f.createAnimateFrameWithStartValues(()=>{var _;let B="";const S=u.getCameraInfo();if(S){const x=(U,F)=>S.position[U].toFixed(F);B+=`帧率:${u.getFPS()}FPS 相机: ${x(2,2)}米 `}const I=(_=u.extensions)==null?void 0:_.cursorPositionInfo.cursorPosition;if(I){const x=(U,F)=>I[U].toFixed(F);B+=`位置:${x(0,5)}° ${x(1,5)}° ${x(2,2)}米`}else B+="暂时无法获取鼠标位置...";w.innerText=B})),k.start()):(h.style.display="none",k.destroy())};this.dispose(e.showChanged.disposableOn(D)),D()}}}}get customDiv(){return this._customDiv}};L(wc,"type",wc.register("ESCesiumViewer",V.ESViewerStatusBarScale.type,wc));let uv=wc;const BS=C.Math.toDegrees,Pz=new C.Cartographic;function MS(t,n,e){const i=C.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=C.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=C.Cartesian3.subtract(o,i,new C.Cartesian3);C.Cartesian3.normalize(r,r);const s=new C.Ray(i,r),a=e.pickFromRay(s),l=e.globe.pick(s,e);var u;if(a&&a.position&&l){const d=C.Cartesian3.distance(i,a.position),g=C.Cartesian3.distance(i,l);u=d<g?a.position:l}else a&&a.position?u=a.position:l&&(u=l);if(!u)return;const h=C.Cartesian3.distance(i,o),A=C.Cartesian3.distance(i,u)>h?o:u,p=C.Cartographic.fromCartesian(A,void 0,Pz);return[BS(p.longitude),BS(p.latitude),p.height]}const _c=class _c extends tn{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new Tn(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new Tn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,s=this._visibleGeoPolylines;this.d(f.track([r,"show"],[e,"show"])),this.d(f.track([s,"show"],[e,"show"])),this.d(f.track([s,"color"],[e,"visibleColor"])),this.d(f.track([r,"color"],[e,"invisibleColor"]));{const a=()=>{const u=e.points,h=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,s.positions=void 0;return}const c=[],A=[],[p,d,g]=u[0],v=[p,d,g+h];try{u.forEach((y,m)=>{if(m===0)return;const w=MS(v,y,o.scene);w?(c.push([y,w]),A.push([v,w])):A.push([v,y])}),r.positions=c,s.positions=A}catch(y){console.warn(y)}};a();const l=this.dv(f.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(a))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}};L(_c,"type",_c.register("ESCesiumViewer",V.ESVisibilityAnalysis.type,_c));let cv=_c;class Kl extends f.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new f.Event));L(this,"_enableEvent",this.dv(new f.Event));L(this,"_clearEvent",this.dv(new f.Event));L(this,"_gridPoints",this.dv(f.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Tn(e,i)),s=this.dv(new Tn(e,i));this.excavationPolylines=r,this.fillPolylines=s;const a=r;a.color=[1,1,0,1],this.d(f.track([a,"show"],[this,"show"])),a.show=!1,a.depthTest=!0;const l=s;l.color=[0,0,1,1],this.d(f.track([l,"show"],[this,"show"])),l.show=!1;{const p=this.ad(new xi(e,i));this.d(f.track([p,"show"],[this,"show"])),this.d(f.bind([p,"allowPicking"],[this,"allowPicking"])),this.d(f.bind([p,"positions"],[this,"positions"])),this.d(f.bind([p,"depthTest"],[this,"depthTest"])),this.d(f.bind([p,"outlineWidth"],[this,"outlineWidth"])),this.d(f.bind([p,"outlineColor"],[this,"outlineColor"])),this.d(f.bind([p,"outline"],[this,"outline"])),this.d(f.bind([p,"color"],[this,"fillColor"])),this.d(f.bind([p,"fill"],[this,"filled"])),this.d(f.bind([p,"strokeGround"],[this,"strokeGround"])),this.d(f.bind([p,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{p.flyTo(v)}));const d=()=>{p.positions=this.positions};d();const g=this.dv(f.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(d))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:p,maxPos:d}=V.getMinMaxCorner(this.positions),g=p[0],v=p[1],y=d[0],m=d[1],b={type:"Polygon",coordinates:[[...this.positions.map(I=>[I[0],I[1]])]]},E=[g,v,y,m],T=this.gridWidth,D=VC(E,T,{units:"meters",mask:b}).features.map(I=>I.geometry.coordinates),B=C.Math.toRadians;return D.map(I=>new C.Cartographic(B(I[0]),B(I[1])))},h=()=>{a.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,a.depthTest=!0},c=this.dv(f.createProcessingFromAsyncFunc(async p=>{const d=u();let g=0,v=300;const y=Math.ceil(d.length/v),m=[];do{let w=[];g===y-1?w=d.slice(g*v):w=d.slice(g*v,(g+1)*v);const b=o.scene.sampleHeightMostDetailed(w),E=await p.promise(b);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const T=C.Math.toDegrees,P=E.filter(k=>k!=null).map(k=>[T(k.longitude),T(k.latitude),k.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let A=null;{const p=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let d=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const w=this.positions;m[2]>w[0][2]?(d+=this.gridWidth*this.gridWidth*(m[2]-w[0][2]),g.push([m,[m[0],m[1],w[0][2]]])):(v+=this.gridWidth*this.gridWidth*(w[0][2]-m[2]),y.push([m,[m[0],m[1],w[0][2]]]))}),a.positions=g,l.positions=y,a.show=!0,l.show=!0,this.area=Qb(this.positions),this.cutVolume=d,this.fillVolume=v,this.cutAndFillVolume=v-d,A&&clearTimeout(A),A=setTimeout(()=>{a.depthTest=!1},200)};p(),this.d(this.gridPointsChanged.don(p)),this.d(()=>clearTimeout(A))}{const p=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};p(),this.d(this.positionsChanged.don(p))}{const p=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const d=JSON.parse(JSON.stringify(this.positions.slice(1)));d.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=d};p(),this.d(this.planeHeightChanged.don(p))}this.d(this.enableEvent.don(()=>{h(),this.gridPoints=[],this.progress=0,c.restart()})),this.d(this.clearEvent.don(()=>{h()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:f.reactPositions(void 0),planeHeight:f.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(Kl||(Kl={})),f.extendClassProps(Kl.prototype,Kl.createDefaultProps);const bc=class bc extends kn{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Kl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(f.track([r,"show"],[e,"show"])),this.d(f.bind([r,"positions"],[e,"points"])),this.d(f.track([r,"allowPicking"],[e,"allowPicking"])),this.d(f.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(f.track([r,"gridWidth"],[e,"gridWidth"])),this.d(f.track([e,"cutVolume"],[r,"cutVolume"])),this.d(f.track([e,"fillVolume"],[r,"fillVolume"])),this.d(f.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(f.bind([e,"progress"],[r,"progress"])),this.d(f.track([r,"depthTest"],[e,"depthTest"])),this.d(f.track([r,"outline"],[e,"stroked"])),this.d(f.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(f.track([r,"outlineColor"],[e,"strokeColor"])),this.d(f.track([r,"filled"],[e,"filled"])),this.d(f.track([r,"fillColor"],[e,"fillColor"])),this.d(f.track([r,"fillGround"],[e,"fillGround"])),this.d(f.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(f.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(bc,"type",bc.register("ESCesiumViewer",V.ESVolumeMeasurement.type,bc));let hv=bc;const Cc=class Cc extends kn{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new V.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(f.bind([r,"show"],[e,"show"])),this.ad(f.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(f.bind([r,"stroked"],[e,"stroked"])),this.ad(f.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(f.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(f.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const c=structuredClone(e.points);c.push(c[0]),e.perPositionHeight?r.points=c:r.points=c.map(A=>(A[2]=e.height??V.ESGeoExtrudedPolygon.defaults.height,A))}};u();const h=this.ad(f.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(h.don(u))}const s=this.czmEntity=o.entities.add({polygon:{}});C.Entity.prototype&&(s.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(s));let a=new C.PolygonHierarchy;s.polygon&&(s.polygon.hierarchy=new C.CallbackProperty(()=>a,!1));const l=()=>{const u=Kt(e.points??V.ESGeoExtrudedPolygon.defaults.points);if(u.length<2){a=new C.PolygonHierarchy;return}a=new C.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{s.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!s.show&&e.filled)};u();const h=this.ad(f.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(h.don(u))}{const u=()=>{s.polygon&&(s.polygon.perPositionHeight=new C.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{s.polygon&&(s.polygon.height=new C.ConstantProperty(e.height??V.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{s.polygon&&(s.polygon.extrudedHeight=new C.ConstantProperty(e.extrudedHeight??V.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const h=C.Color.fromCartesian4(C.Cartesian4.fromArray(e.fillColor));s.polygon&&(s.polygon.material=h)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new f.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new tt.ObjectsToExcludeWrapper(i,s)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=V.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L(Cc,"type",Cc.register("ESCesiumViewer",V.ESGeoExtrudedPolygon.type,Cc));let Av=Cc;const xc=class xc extends V.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(f.bind([o,"position"],[n,"position"])),this.dispose(f.bind([o,"rotation"],[n,"rotation"])),this.ad(f.bind([o,"scale"],[n,"scale"])),this.ad(f.track([r,"scale"],[n,"scale"])),this.dispose(f.track([r,"rotation"],[n,"rotation"]));const s=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};s();const a=this.dv(f.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(a.don(s)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(xc,"type",xc.register("ESCesiumViewer",V.ESHumanPoi.type,xc));let fv=xc;const Sc=class Sc extends V.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var h,c,A,p;const u=(p=(A=(c=(h=l==null?void 0:l._root)==null?void 0:h._content)==null?void 0:c._model)==null?void 0:A._featureTables[0])==null?void 0:p._features[0];u?o.strokeFeature([u],C.Color.LIME.toBytes().map(d=>d/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),s=o.url,a=Date.now();s.includes("?reload=")?o.url=s.replace(/\?reload=\d+/,`?reload=${a}`):o.url=s+`?reload=${a}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const a=n.layerConfig;if(!a){o.style=void 0;return}const l=n.colorBlendMode,u=(A,p)=>{try{if(A.getPropertyIds().includes("materialName"))return C.Color.clone(C.Color.WHITE,p);const d=A.getProperty("layer"),g=A.getProperty("dataset"),v=d.toString(),y=g.toString(),m=a.find(b=>b.dataset.toString()===y&&b.layer.toString()===v);if(m&&m.value.color){const b=m.value.color;return C.Color.fromCssColorString(b,p)}const w=a.filter(b=>b.dataset.toString()===y);if(w.length==1&&w[0].value.color){const b=w[0].value.color;return C.Color.fromCssColorString(b,p)}else return C.Color.clone(C.Color.WHITE,p)}catch(d){return console.warn(d),C.Color.clone(C.Color.WHITE,p)}},h=A=>{try{if(A.getPropertyIds().includes("materialName"))return!0;const p=A.getProperty("layer"),d=A.getProperty("dataset"),g=p.toString(),v=d.toString(),y=a.find(w=>w.dataset.toString()===v&&w.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=a.filter(w=>w.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(p){return console.warn(p),!0}};let c;l!=="HIGHLIGHT"?c=new C.Cesium3DTileStyle({color:{evaluateColor:function(A,p){return u(A,p)}},show:{evaluate:function(A){return h(A)}}}):c=new C.Cesium3DTileStyle({show:{evaluate:function(A){return h(A)}}}),o.style=c};r();const s=this.dv(f.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged));this.d(s.don(()=>{r()}))}))}};L(Sc,"type",Sc.register("ESCesiumViewer",V.ESRtsTileset.type,Sc));let dv=Sc;const Ec=class Ec extends Ja{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Ec,"type",Ec.register("ESCesiumViewer",V.ESRtsFeatureEditing.type,Ec));let pv=Ec;const Pc=class Pc extends Ja{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Pc,"type",Pc.register("ESCesiumViewer",V.ESMsTileset.type,Pc));let mv=Pc;const Tc=class Tc extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new zn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(f.track([r,"show"],[e,"show"])),this.dispose(f.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Tc,"type",Tc.register("ESCesiumViewer",V.ESStaticMesh.type,Tc));let gv=Tc;const Ic=class Ic extends tn{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new F0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),s=Number.isFinite(n.radius)?n.radius:V.ESSkylineAnalysis.defaults.radius,{depths:a,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,s),h=Ue(i.camera.position);u.push(h),n.depths=a,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(Ic,"type",Ic.register("ESCesiumViewer",V.ESSkylineAnalysis.type,Ic));let yv=Ic;class Tz extends f.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new f.Event));const o=e.sceneObject;this._rectangle=this.ad(new gi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(f.bind([this.rectangle,"show"],[o,"show"])),this.ad(f.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class Iz extends f.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new f.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,s=r.sceneObject,a=o.viewer;if(!a)return;let l,u;const h=this.ad(new f.Event),c=()=>{A(),!(!l||!u)&&(this._primitive=a.scene.primitives.add(new C.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:s.allowPicking})))},A=()=>{this.primitive&&a.scene.primitives.remove(this.primitive)};this.ad(A);{const p=()=>{this.primitive&&(this.primitive.show=s.show)};p(),this.ad(s.showChanged.don(p))}{const p=this.ad(f.createNextAnimateFrameEvent(s.allowPickingChanged,h));this.ad(p.don(c))}{const p=()=>{r.rectangle&&(l=new C.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(d=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=V.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new C.MaterialAppearance({material:new C.Material({fabric:{type:"Image",uniforms:{image:d}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=d,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),p(),this.primitive||h.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
3724
|
+
`),24))};s(),this.d(this.totalAreaChanged.don(s)),this.d(this.unitsChanged.don(s)),this.d(f.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Vb(this.positions):this._geoDivPoi.position=void 0)}));const a=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??ea.defaults.interpolationDistance,h=this.interpolation??ea.defaults.interpolation,c=this.offsetHeight??ea.defaults.offsetHeight,A=this.drillDepth??ea.defaults.drillDepth,p=[];if(this.positions)for(let O=0;O<this.positions.length;++O){const z=C.Cartesian3.fromDegrees(this.positions[O][0],this.positions[O][1],this.positions[O][2]);p.push(z)}var d=dz(p);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z)){console.warn("法向量计算错误!");return}var g=pz(p),v=C.Cartesian3.normalize(g,new C.Cartesian3),y=C.Cartesian3.dot(v,d);y<0&&(d=FS(d),p.reverse());let m=C.Transforms.eastNorthUpToFixedFrame(g),w=C.Matrix4.inverseTransformation(m,new C.Matrix4);if(Math.abs(y)<.999){const O=mz(d,v);var b=FS(g),E=C.Matrix4.fromTranslation(b,new C.Matrix4);w=C.Matrix4.multiply(O,E,E),m=C.Matrix4.inverse(w,new C.Matrix4)}var T=ms(p,w),P=[],k=[],D=yz(T);if(h&&u>0){var B=gz(T);const O=Math.max(B.maxy-B.miny,B.maxx-B.minx);var S=bz(D,B,u);const z=await av(S,m,w,d,o.scene,c,A,O);var I=Cz(T,u);const Q=await av(I,m,w,d,o.scene,c,A,O);k.push(...z.world_cartesian),P.push(...z.local),k.push(...Q.world_cartesian),P.push(...Q.local);for(let N=0;N<T.length;++N){const W=T[N];var _=await av([W],m,w,d,o.scene,c,A,O);if(_.local.length>0)P.push(..._.local),k.push(..._.world_cartesian);else{const J=[W.x,W.y,W.z+c];P.push(J);var x=ms([C.Cartesian3.fromArray(J)],m);for(let j=0;j<x.length;++j)k.push(x[j])}}}else{const O=T.map(z=>C.Cartesian3.fromArray([z.x,z.y,z.z+O]));P=O,k=ms(O,m)}var U=vz(P,D);const F=wz(k,U);this.totalArea=F;const M=[];P.forEach(O=>{const z=[O.x,O.y,O.z];z&&M.push(...z)});const R={position:{typedArray:new Float32Array(M),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=C.Matrix4.toArray(m),this.customPrimitive.attributes=R;const O=await fz([...U]);this.customPrimitive.indexTypedArray=new Uint32Array(O),this.customPrimitive.show=!0;const z=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:Q,max:N}=z;this.customPrimitive.setLocalAxisedBoundingBox(Q,N)}},l=this.dv(f.createProcessingFromAsyncFunc(async u=>{await u.promise(a()),this._starting=!1,s()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,s(),l.restart()})),this.d(this.stopEvent.don(()=>{l.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,s()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};L(ea,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Wo=ea;(t=>{t.createDefaultProps=()=>({positions:f.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:f.reactArray([1,1,1,1]),units:f.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Wo||(Wo={})),f.extendClassProps(Wo.prototype,Wo.createDefaultProps);async function fz(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await kS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function dz(t){var n=new C.Cartesian3(0,0,0),e=new C.Cartesian3(0,0,0),i=new C.Cartesian3(0,0,0),o=new C.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var s=t[u],a;u==0?a=t[t.length-1]:a=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=C.Cartesian3.subtract(s,a,n),e=C.Cartesian3.subtract(s,l,e),i=C.Cartesian3.cross(n,e,i),!i.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6)&&(i=C.Cartesian3.normalize(i,i),o=C.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function pz(t){var n=new C.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=C.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function FS(t){return new C.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function mz(t,n){var e=C.Cartesian3.cross(t,n,new C.Cartesian3);e=C.Cartesian3.normalize(e,e);var i=C.Cartesian3.cross(t,e,new C.Cartesian3);i=C.Cartesian3.normalize(i,i);var o=t,r=new C.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function ms(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=C.Matrix4.multiplyByPoint(n,i,new C.Cartesian3);e.push(o)}return e}function gz(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function yz(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function vz(t,n){var e=[];t.forEach(s=>{const a=[s.x,s.y];e.push(a)});var i=rv.from(e).triangles;const o=[],r=sn([n]);for(let s=0;s<i.length;s+=3){const a=i[s],l=i[s+1],u=i[s+2],h=(t[a].x+t[l].x+t[u].x)/3,c=(t[a].y+t[l].y+t[u].y)/3;ln([h,c],r)&&o.push(a,l,u)}return new Uint32Array(o.reverse())}function wz(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=_z(o)}return e}function _z(t){var n=C.Cartesian3.distance(t[0],t[1]),e=C.Cartesian3.distance(t[1],t[2]),i=C.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function bz(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)Sz([o,r],t)&&i.push(new C.Cartesian3(o,r,0));return i}function Cz(t,n){var e=[];for(let s=0;s<t.length;++s){var i=t[s],o;s==t.length-1?o=t[0]:o=t[s+1];var r=xz(i,o,n);e.push(...r)}return e}function xz(t,n,e){var i=[],o=C.Cartesian3.distance(t,n),r=C.Cartesian3.subtract(n,t,new C.Cartesian3);if(r.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6))return[];r=C.Cartesian3.normalize(r,r);for(var s=e;s<o;){var a=new C.Cartesian3(r.x*s,r.y*s,r.z*s),l=C.Cartesian3.add(t,a,new C.Cartesian3);i.push(l),s+=e}return i}function Sz(t,n){var e=Wr(t);if(!xL(Wr(n[0]),Wr(n[n.length-1])))return!1;var i=[];i.push(n);var o=sn(i);return ln(e,o)}async function av(t,n,e,i,o,r,s,a){var l=[];t.forEach(w=>{var b=w.clone();b.z=a,l.push(b)});var u=ms(l,n),h=new C.Cartesian3(-1*i.x,-1*i.y,-1*i.z),c=[],A=[],p=[];for(let w=0;w<u.length;++w){await kS();var d=u[w],g=new C.Ray(d,h),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new C.Ray(d,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=ms([y],e);m.forEach(b=>{b.z+=r}),y=ms(m,n)[0],p.push(y),y=C.Cartographic.fromCartesian(y),c.push([y.longitude,y.latitude,y.height]),A.push(m[0])}}}return{local:A,world:c,world_cartesian:p}}const yc=class yc extends kn{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Wo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(f.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(f.track([r,"units"],[e,"units"])),this.d(f.track([r,"show"],[e,"show"])),this.d(f.track([r,"positions"],[e,"points"])),this.d(f.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(f.track([r,"offsetHeight"],[e,"offsetHeight"]));{const s=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};s();const a=this.disposeVar(f.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(a.disposableOn(s))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}};L(yc,"type",yc.register("ESCesiumViewer",V.ESSurfaceAreaMeasurement.type,yc));let sv=yc;async function Ez(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const vc=class vc extends V.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new V.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends f.Destroyable{constructor(a,l,u){if(super(),this._subContainer=a,!u||!(u instanceof tt))return;u.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h)),h.style.width="100%",h.style.position="absolute",h.style.height=`${V.ESViewerStatusBar.defaults.height}px`,h.style.left="0",h.style.bottom="0",h.style.color="#fff",h.style.padding="0 20px 0 0",h.style.boxSizing="border-box",h.style.lineHeight=`${V.ESViewerStatusBar.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const c=document.createElement("span");h.appendChild(c),this.dispose(()=>h.removeChild(c));const A=document.createElement("span");c.appendChild(A),this.dispose(()=>c.removeChild(A));const p=document.createElement("span");c.appendChild(p),p.addEventListener("dblclick",function(){let g=p.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),Ez(g)}),p.style.cursor="pointer",this.dispose(()=>c.removeChild(p));const d=document.createElement("span");h.appendChild(d),this.dispose(()=>h.removeChild(d));{const g=()=>{h.style.height=(e.height??V.ESViewerStatusBar.defaults.height)+"px",h.style.lineHeight=(e.height??V.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{h.style.fontSize=(e.fontSize??V.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?h.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:h.style.background=`rgba(${V.ESViewerStatusBar.defaults.bgColor[0]},${V.ESViewerStatusBar.defaults.bgColor[1]},${V.ESViewerStatusBar.defaults.bgColor[2]},${V.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{d.innerText=`Cesium 版本 : ${C.VERSION} `;let g;const v=()=>{e.show?(h.style.display="flex",g=this.disposeVar(f.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const w=u.getCameraInfo();if(w){const T=(k,D)=>w.position[k].toFixed(D),P=(k,D)=>w.rotation[k].toFixed(D);y=`帧率:${u.getFPS()}FPS 经度: ${T(0,5)}° 纬度: ${T(1,5)}° 高度: ${T(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}A.innerText=y;const b=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(b){const T=(P,k)=>b[P].toFixed(k);m=`鼠标位置:${T(0,5)}° ${T(1,5)}° ${T(2,2)}m`}else m="暂时无法获取鼠标位置...";p.innerText=m})),g.start()):(h.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(vc,"type",vc.register("ESCesiumViewer",V.ESViewerStatusBar.type,vc));let lv=vc;const wc=class wc extends V.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new V.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(f.track([r,"show"],[e,"show"])),r.instanceClass=class extends f.Destroyable{constructor(a,l,u){if(super(),this._subContainer=a,!u||!(u instanceof tt))return;u.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));const c=document.createElement("div");h.appendChild(c),c.style.width="100%",c.className="ESViewerStatusBarScale",c.style.position="absolute",c.style.display="flex",c.style.height=`${V.ESViewerStatusBarScale.defaults.height}px`,c.style.left="0",c.style.bottom="0",c.style.color="#fff",c.style.padding="0 20px 0 0",c.style.boxSizing="border-box",c.style.lineHeight=`${V.ESViewerStatusBarScale.defaults.height}px`,c.style.zIndex="100",c.style.alignContent="center",c.style.justifyContent="space-between";const A=document.createElement("div");c.appendChild(A);const p=document.createElement("div");A.appendChild(p);const d=document.createElement("div");A.appendChild(d);const g=document.createElement("div");c.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const w=document.createElement("span");g.appendChild(w);{const k=()=>{c.style.height=(e.height??V.ESViewerStatusBarScale.defaults.height)+"px",c.style.lineHeight=(e.height??V.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(k)),k()}{const k=()=>{c.style.fontSize=(e.fontSize??V.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(k)),k()}{const k=()=>{e.bgColor?c.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:c.style.background=`rgba(${V.ESViewerStatusBarScale.defaults.bgColor[0]},${V.ESViewerStatusBarScale.defaults.bgColor[1]},${V.ESViewerStatusBarScale.defaults.bgColor[2]},${V.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(k)),k()}A.style.display="flex",p.style.fontWeight="bold",p.style.padding="0 0 0 25px";let b="EarthSDK";p.innerText=b,d.style.fontWeight="";let E="——免费开源地球可视化开发包";d.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",w.style.display="flex",w.style.zIndex="101",w.style.justifyContent="flex-end",w.style.right="0";const T=()=>{const k=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||k&&k>1e6)v.style.display="none";else{v.style.display="block";const D=i.viewerLegend.legend.computedLengthInStr;D&&(y.innerHTML=D);const B=i.viewerLegend.legend.computedLengthInPixels;if(B){m.style.width=`${B}px`;const S=(135-B)/2;m.style.left=`${S}px`}}};T();const P=setInterval(()=>{T()},200);this.dispose(()=>clearInterval(P));{let k;const D=()=>{e.show?(h.style.display="block",k=this.disposeVar(f.createAnimateFrameWithStartValues(()=>{var _;let B="";const S=u.getCameraInfo();if(S){const x=(U,F)=>S.position[U].toFixed(F);B+=`帧率:${u.getFPS()}FPS 相机: ${x(2,2)}米 `}const I=(_=u.extensions)==null?void 0:_.cursorPositionInfo.cursorPosition;if(I){const x=(U,F)=>I[U].toFixed(F);B+=`位置:${x(0,5)}° ${x(1,5)}° ${x(2,2)}米`}else B+="暂时无法获取鼠标位置...";w.innerText=B})),k.start()):(h.style.display="none",k.destroy())};this.dispose(e.showChanged.disposableOn(D)),D()}}}}get customDiv(){return this._customDiv}};L(wc,"type",wc.register("ESCesiumViewer",V.ESViewerStatusBarScale.type,wc));let uv=wc;const BS=C.Math.toDegrees,Pz=new C.Cartographic;function MS(t,n,e){const i=C.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=C.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=C.Cartesian3.subtract(o,i,new C.Cartesian3);C.Cartesian3.normalize(r,r);const s=new C.Ray(i,r),a=e.pickFromRay(s),l=e.globe.pick(s,e);var u;if(a&&a.position&&l){const d=C.Cartesian3.distance(i,a.position),g=C.Cartesian3.distance(i,l);u=d<g?a.position:l}else a&&a.position?u=a.position:l&&(u=l);if(!u)return;const h=C.Cartesian3.distance(i,o),A=C.Cartesian3.distance(i,u)>h?o:u,p=C.Cartographic.fromCartesian(A,void 0,Pz);return[BS(p.longitude),BS(p.latitude),p.height]}const _c=class _c extends tn{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new Tn(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new Tn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,s=this._visibleGeoPolylines;this.d(f.track([r,"show"],[e,"show"])),this.d(f.track([s,"show"],[e,"show"])),this.d(f.track([s,"color"],[e,"visibleColor"])),this.d(f.track([r,"color"],[e,"invisibleColor"]));{const a=()=>{const u=e.points,h=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,s.positions=void 0;return}const c=[],A=[],[p,d,g]=u[0],v=[p,d,g+h];try{u.forEach((y,m)=>{if(m===0)return;const w=MS(v,y,o.scene);w?(c.push([y,w]),A.push([v,w])):A.push([v,y])}),r.positions=c,s.positions=A}catch(y){console.warn(y)}};a();const l=this.dv(f.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(a))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}};L(_c,"type",_c.register("ESCesiumViewer",V.ESVisibilityAnalysis.type,_c));let cv=_c;class Kl extends f.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new f.Event));L(this,"_enableEvent",this.dv(new f.Event));L(this,"_clearEvent",this.dv(new f.Event));L(this,"_gridPoints",this.dv(f.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Tn(e,i)),s=this.dv(new Tn(e,i));this.excavationPolylines=r,this.fillPolylines=s;const a=r;a.color=[1,1,0,1],this.d(f.track([a,"show"],[this,"show"])),a.show=!1,a.depthTest=!0;const l=s;l.color=[0,0,1,1],this.d(f.track([l,"show"],[this,"show"])),l.show=!1;{const p=this.ad(new xi(e,i));this.d(f.track([p,"show"],[this,"show"])),this.d(f.bind([p,"allowPicking"],[this,"allowPicking"])),this.d(f.bind([p,"positions"],[this,"positions"])),this.d(f.bind([p,"depthTest"],[this,"depthTest"])),this.d(f.bind([p,"outlineWidth"],[this,"outlineWidth"])),this.d(f.bind([p,"outlineColor"],[this,"outlineColor"])),this.d(f.bind([p,"outline"],[this,"outline"])),this.d(f.bind([p,"color"],[this,"fillColor"])),this.d(f.bind([p,"fill"],[this,"filled"])),this.d(f.bind([p,"strokeGround"],[this,"strokeGround"])),this.d(f.bind([p,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{p.flyTo(v)}));const d=()=>{p.positions=this.positions};d();const g=this.dv(f.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(d))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:p,maxPos:d}=V.getMinMaxCorner(this.positions),g=p[0],v=p[1],y=d[0],m=d[1],b={type:"Polygon",coordinates:[[...this.positions.map(I=>[I[0],I[1]])]]},E=[g,v,y,m],T=this.gridWidth,D=VC(E,T,{units:"meters",mask:b}).features.map(I=>I.geometry.coordinates),B=C.Math.toRadians;return D.map(I=>new C.Cartographic(B(I[0]),B(I[1])))},h=()=>{a.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,a.depthTest=!0},c=this.dv(f.createProcessingFromAsyncFunc(async p=>{const d=u();let g=0,v=300;const y=Math.ceil(d.length/v),m=[];do{let w=[];g===y-1?w=d.slice(g*v):w=d.slice(g*v,(g+1)*v);const b=o.scene.sampleHeightMostDetailed(w),E=await p.promise(b);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const T=C.Math.toDegrees,P=E.filter(k=>k!=null).map(k=>[T(k.longitude),T(k.latitude),k.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let A=null;{const p=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let d=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const w=this.positions;m[2]>w[0][2]?(d+=this.gridWidth*this.gridWidth*(m[2]-w[0][2]),g.push([m,[m[0],m[1],w[0][2]]])):(v+=this.gridWidth*this.gridWidth*(w[0][2]-m[2]),y.push([m,[m[0],m[1],w[0][2]]]))}),a.positions=g,l.positions=y,a.show=!0,l.show=!0,this.area=Qb(this.positions),this.cutVolume=d,this.fillVolume=v,this.cutAndFillVolume=v-d,A&&clearTimeout(A),A=setTimeout(()=>{a.depthTest=!1},200)};p(),this.d(this.gridPointsChanged.don(p)),this.d(()=>clearTimeout(A))}{const p=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};p(),this.d(this.positionsChanged.don(p))}{const p=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const d=JSON.parse(JSON.stringify(this.positions.slice(1)));d.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=d};p(),this.d(this.planeHeightChanged.don(p))}this.d(this.enableEvent.don(()=>{h(),this.gridPoints=[],this.progress=0,c.restart()})),this.d(this.clearEvent.don(()=>{h()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:f.reactPositions(void 0),planeHeight:f.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(Kl||(Kl={})),f.extendClassProps(Kl.prototype,Kl.createDefaultProps);const bc=class bc extends kn{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Kl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(f.track([r,"show"],[e,"show"])),this.d(f.bind([r,"positions"],[e,"points"])),this.d(f.track([r,"allowPicking"],[e,"allowPicking"])),this.d(f.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(f.track([r,"gridWidth"],[e,"gridWidth"])),this.d(f.track([e,"cutVolume"],[r,"cutVolume"])),this.d(f.track([e,"fillVolume"],[r,"fillVolume"])),this.d(f.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(f.bind([e,"progress"],[r,"progress"])),this.d(f.track([r,"depthTest"],[e,"depthTest"])),this.d(f.track([r,"outline"],[e,"stroked"])),this.d(f.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(f.track([r,"outlineColor"],[e,"strokeColor"])),this.d(f.track([r,"filled"],[e,"filled"])),this.d(f.track([r,"fillColor"],[e,"fillColor"])),this.d(f.track([r,"fillGround"],[e,"fillGround"])),this.d(f.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(f.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(bc,"type",bc.register("ESCesiumViewer",V.ESVolumeMeasurement.type,bc));let hv=bc;const Cc=class Cc extends kn{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new V.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(f.bind([r,"show"],[e,"show"])),this.ad(f.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(f.bind([r,"stroked"],[e,"stroked"])),this.ad(f.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(f.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(f.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const c=structuredClone(e.points);c.push(c[0]),e.perPositionHeight?r.points=c:r.points=c.map(A=>(A[2]=e.height??V.ESGeoExtrudedPolygon.defaults.height,A))}};u();const h=this.ad(f.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(h.don(u))}const s=this.czmEntity=o.entities.add({polygon:{}});C.Entity.prototype&&(s.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(s));let a=new C.PolygonHierarchy;s.polygon&&(s.polygon.hierarchy=new C.CallbackProperty(()=>a,!1));const l=()=>{const u=Kt(e.points??[]);if(u.length<2){a=new C.PolygonHierarchy;return}a=new C.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{s.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!s.show&&e.filled)};u();const h=this.ad(f.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(h.don(u))}{const u=()=>{s.polygon&&(s.polygon.perPositionHeight=new C.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{s.polygon&&(s.polygon.height=new C.ConstantProperty(e.height??V.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{s.polygon&&(s.polygon.extrudedHeight=new C.ConstantProperty(e.extrudedHeight??V.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const h=C.Color.fromCartesian4(C.Cartesian4.fromArray(e.fillColor));s.polygon&&(s.polygon.material=h)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new f.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new tt.ObjectsToExcludeWrapper(i,s)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=V.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L(Cc,"type",Cc.register("ESCesiumViewer",V.ESGeoExtrudedPolygon.type,Cc));let Av=Cc;const xc=class xc extends V.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(f.bind([o,"position"],[n,"position"])),this.dispose(f.bind([o,"rotation"],[n,"rotation"])),this.ad(f.bind([o,"scale"],[n,"scale"])),this.ad(f.track([r,"scale"],[n,"scale"])),this.dispose(f.track([r,"rotation"],[n,"rotation"]));const s=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};s();const a=this.dv(f.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(a.don(s)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(xc,"type",xc.register("ESCesiumViewer",V.ESHumanPoi.type,xc));let fv=xc;const Sc=class Sc extends V.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var h,c,A,p;const u=(p=(A=(c=(h=l==null?void 0:l._root)==null?void 0:h._content)==null?void 0:c._model)==null?void 0:A._featureTables[0])==null?void 0:p._features[0];u?o.strokeFeature([u],C.Color.LIME.toBytes().map(d=>d/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),s=o.url,a=Date.now();s.includes("?reload=")?o.url=s.replace(/\?reload=\d+/,`?reload=${a}`):o.url=s+`?reload=${a}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const a=n.layerConfig;if(!a){o.style=void 0;return}const l=n.colorBlendMode,u=(A,p)=>{try{if(A.getPropertyIds().includes("materialName"))return C.Color.clone(C.Color.WHITE,p);const d=A.getProperty("layer"),g=A.getProperty("dataset"),v=d.toString(),y=g.toString(),m=a.find(b=>b.dataset.toString()===y&&b.layer.toString()===v);if(m&&m.value.color){const b=m.value.color;return C.Color.fromCssColorString(b,p)}const w=a.filter(b=>b.dataset.toString()===y);if(w.length==1&&w[0].value.color){const b=w[0].value.color;return C.Color.fromCssColorString(b,p)}else return C.Color.clone(C.Color.WHITE,p)}catch(d){return console.warn(d),C.Color.clone(C.Color.WHITE,p)}},h=A=>{try{if(A.getPropertyIds().includes("materialName"))return!0;const p=A.getProperty("layer"),d=A.getProperty("dataset"),g=p.toString(),v=d.toString(),y=a.find(w=>w.dataset.toString()===v&&w.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=a.filter(w=>w.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(p){return console.warn(p),!0}};let c;l!=="HIGHLIGHT"?c=new C.Cesium3DTileStyle({color:{evaluateColor:function(A,p){return u(A,p)}},show:{evaluate:function(A){return h(A)}}}):c=new C.Cesium3DTileStyle({show:{evaluate:function(A){return h(A)}}}),o.style=c};r();const s=this.dv(f.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged));this.d(s.don(()=>{r()}))}))}};L(Sc,"type",Sc.register("ESCesiumViewer",V.ESRtsTileset.type,Sc));let dv=Sc;const Ec=class Ec extends Ja{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Ec,"type",Ec.register("ESCesiumViewer",V.ESRtsFeatureEditing.type,Ec));let pv=Ec;const Pc=class Pc extends Ja{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Pc,"type",Pc.register("ESCesiumViewer",V.ESMsTileset.type,Pc));let mv=Pc;const Tc=class Tc extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new zn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(f.track([r,"show"],[e,"show"])),this.dispose(f.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Tc,"type",Tc.register("ESCesiumViewer",V.ESStaticMesh.type,Tc));let gv=Tc;const Ic=class Ic extends tn{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new F0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),s=Number.isFinite(n.radius)?n.radius:V.ESSkylineAnalysis.defaults.radius,{depths:a,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,s),h=Ue(i.camera.position);u.push(h),n.depths=a,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(Ic,"type",Ic.register("ESCesiumViewer",V.ESSkylineAnalysis.type,Ic));let yv=Ic;class Tz extends f.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new f.Event));const o=e.sceneObject;this._rectangle=this.ad(new gi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(f.bind([this.rectangle,"show"],[o,"show"])),this.ad(f.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class Iz extends f.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new f.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,s=r.sceneObject,a=o.viewer;if(!a)return;let l,u;const h=this.ad(new f.Event),c=()=>{A(),!(!l||!u)&&(this._primitive=a.scene.primitives.add(new C.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:s.allowPicking})))},A=()=>{this.primitive&&a.scene.primitives.remove(this.primitive)};this.ad(A);{const p=()=>{this.primitive&&(this.primitive.show=s.show)};p(),this.ad(s.showChanged.don(p))}{const p=this.ad(f.createNextAnimateFrameEvent(s.allowPickingChanged,h));this.ad(p.don(c))}{const p=()=>{r.rectangle&&(l=new C.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(d=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=V.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new C.MaterialAppearance({material:new C.Material({fabric:{type:"Image",uniforms:{image:d}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=d,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),p(),this.primitive||h.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
3725
3725
|
in vec3 position3DHigh;
|
|
3726
3726
|
in vec3 position3DLow;
|
|
3727
3727
|
in vec3 normal;
|
|
@@ -4089,10 +4089,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4089
4089
|
`;function gV(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4090
4090
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4091
4091
|
gitee地址:${t}
|
|
4092
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends V.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(f.react(0)));L(this,"_viewer",this.dv(f.react(void 0)));L(this,"_viewerInstance");L(this,"_cameraChanged",this.dv(new f.Event));L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(f.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(f.react(0)));L(this,"_editingSystem",wf);L(this,"_moveObjectsProcess",this.ad(WS()));if(this.ad(new Yz(this)),this.ad(new Jz(this)),this.dv(new f.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new n6(this)})),this._viewerLegend=this.dv(new hV(this)),this._viewerInstance=this.dv(new f.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Xv(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.viewerChanged.emit(this.viewer)}));const o=this.disposeVar(f.createNextAnimateFrameEvent(this.subContainerChanged));this.dv(new f.ObjResettingWithEvent(o,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new e8(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&&Dn(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],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(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 u=C.Transforms.rotationMatrixFromPositionVelocity(r,l,C.Ellipsoid.WGS84),h=C.Matrix4.fromRotationTranslation(u,r);var c=C.Transforms.eastNorthUpToFixedFrame(C.Matrix4.getTranslation(h,new C.Cartesian3),C.Ellipsoid.WGS84,new C.Matrix4),A=C.Matrix4.multiply(C.Matrix4.inverse(c,new C.Matrix4),h,new C.Matrix4),p=C.Matrix4.getMatrix3(A,new C.Matrix3),d=C.Quaternion.fromRotationMatrix(p),g=C.HeadingPitchRoll.fromQuaternion(d);const v=aa(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;if(!i)return;i[0]=-i[0];const s={position:e,rotation:i,duration:(o??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&Ns(a,s)}flyTo(e,i,o="default"){var p;const{distance:r,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,c={position:i,viewDistance:r,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},A=(p=this.viewer)==null?void 0:p.camera;return A&&Ns(A,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=V.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},h=(c=this.viewer)==null?void 0:c.camera;return h&&Ns(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(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,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.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,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}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 O0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.mainClass;r&&(console.log(i,"这是Cesium的模式"),i!=null&&(r.editingID=`${o.callSource}_${f.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch)))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=f.createGuid();for(let r=0;r<e.length;r++){const a=e[r].mainClass;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=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return fn(e,i)}localPositionsToPositions(e,i){return mr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(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)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new V.GroupProperty([],"通用","通用"),new V.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",mV,pV,!0),new V.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new V.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new V.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new V.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new V.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new V.GroupProperty([],"Viewer","Viewer"),new V.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new V.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new V.BooleanProperty([this,"shadows"]),new V.GroupProperty([],"比例尺","比例尺(Legend)"),new V.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new V.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new V.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new V.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new V.GroupProperty([],"场景","场景(Scene)"),new V.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new V.GroupProperty([],"Globe","Globe"),new V.BooleanProperty([this,"depthTestAgainstTerrain"],"depthTestAgainstTerrain",i.depthTestAgainstTerrain,!0),new V.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new V.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new V.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new V.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new V.BooleanProperty([this,"sceneGlobeShowSkirts"]),new V.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new V.ColorProperty([this,"sceneGlobeBaseColor"]),new V.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new V.JsonProperty([this,"sceneGlobeClippingPlanes"]),new V.StringProperty([this,"sceneGlobeClippingPlanesId"]),new V.JsonProperty([this,"sceneGlobeClippingPolygons"]),new V.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new V.GroupProperty([],"underground","underground"),new V.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new V.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new V.GroupProperty([],"Translucency","Translucency"),new V.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",i.sceneGlobeTranslucencyEnabled,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",i.sceneGlobeTranslucencyBackFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",i.sceneGlobeTranslucencyFrontFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new V.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new V.GroupProperty([],"Sun","Sun"),new V.BooleanProperty([this,"sun"],"sun",i.sun,!0),new V.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new V.GroupProperty([],"Moon","Moon"),new V.BooleanProperty([this,"moon"],"moon",i.moon,!0),new V.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new V.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new V.GroupProperty([],"SkyBox","SkyBox"),new V.BooleanProperty([this,"sceneSkyBoxShow"]),new V.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new V.GroupProperty([],"Background","Background"),new V.BooleanProperty([this,"xbsjUseBackground"]),new V.StringProperty([this,"xbsjBackgroundImageUri"]),new V.ColorProperty([this,"xbsjBackgroundColor"]),new V.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new V.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new V.ColorProperty([this,"sceneBackgroundColor"]),new V.GroupProperty([],"Fog","Fog"),new V.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new V.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new V.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new V.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new V.GroupProperty([],"Sscc","Sscc"),new V.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new V.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new V.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new V.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new V.GroupProperty([],"后处理","后处理"),new V.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new V.GroupProperty([],"环境遮蔽","环境遮蔽"),new V.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new V.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new V.GroupProperty([],"Bloom","Bloom"),new V.BooleanProperty([this,"scenePpsBloomEnabled"]),new V.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new V.NumberProperty([this,"scenePpsBloomContrast"]),new V.NumberProperty([this,"scenePpsBloomBrightness"]),new V.NumberProperty([this,"scenePpsBloomDelta"]),new V.NumberProperty([this,"scenePpsBloomSigma"]),new V.NumberProperty([this,"scenePpsBloomStepSize"]),new V.GroupProperty([],"调试","调试"),new V.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new V.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new V.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new V.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new V.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new V.GroupProperty([],"Inspector","Inspector"),new V.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new V.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new V.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(zt,"type",zt.register("ESCesiumViewer",zt)),L(zt,"getCesiumIonToken",gV),L(zt,"currentDefaultAccessToken",C.Ion.defaultAccessToken),L(zt,"latestDefaultAccessToken"),L(zt,"ObjectsToExcludeWrapper",t6),L(zt,"defaults",{...V.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(zt,"getHeightsScartchCarto",new C.Cartographic);let tt=zt;(t=>{t.createDefaultProps=()=>({...V.ESViewer.createDefaultProps(),...dV()})})(tt||(tt={})),f.extendClassProps(tt.prototype,tt.createDefaultProps),ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.4.0-beta.3",e="2025-08-28T09:20:02.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="27c0506b6271f81fa83b6f81a48f38960b6c87bc",a=((Date.now()-1756372802e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4092
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends V.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(f.react(0)));L(this,"_viewer",this.dv(f.react(void 0)));L(this,"_viewerInstance");L(this,"_cameraChanged",this.dv(new f.Event));L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(f.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(f.react(0)));L(this,"_editingSystem",wf);L(this,"_moveObjectsProcess",this.ad(WS()));if(this.ad(new Yz(this)),this.ad(new Jz(this)),this.dv(new f.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new n6(this)})),this._viewerLegend=this.dv(new hV(this)),this._viewerInstance=this.dv(new f.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Xv(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.viewerChanged.emit(this.viewer)}));const o=this.disposeVar(f.createNextAnimateFrameEvent(this.subContainerChanged));this.dv(new f.ObjResettingWithEvent(o,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new e8(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&&Dn(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],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(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 u=C.Transforms.rotationMatrixFromPositionVelocity(r,l,C.Ellipsoid.WGS84),h=C.Matrix4.fromRotationTranslation(u,r);var c=C.Transforms.eastNorthUpToFixedFrame(C.Matrix4.getTranslation(h,new C.Cartesian3),C.Ellipsoid.WGS84,new C.Matrix4),A=C.Matrix4.multiply(C.Matrix4.inverse(c,new C.Matrix4),h,new C.Matrix4),p=C.Matrix4.getMatrix3(A,new C.Matrix3),d=C.Quaternion.fromRotationMatrix(p),g=C.HeadingPitchRoll.fromQuaternion(d);const v=aa(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;if(!i)return;i[0]=-i[0];const s={position:e,rotation:i,duration:(o??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&Ns(a,s)}flyTo(e,i,o="default"){var p;const{distance:r,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,c={position:i,viewDistance:r,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},A=(p=this.viewer)==null?void 0:p.camera;return A&&Ns(A,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=V.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},h=(c=this.viewer)==null?void 0:c.camera;return h&&Ns(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(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,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.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,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}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 O0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.mainClass;r&&(console.log(i,"这是Cesium的模式"),i!=null&&(r.editingID=`${o.callSource}_${f.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch)))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=f.createGuid();for(let r=0;r<e.length;r++){const a=e[r].mainClass;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=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return fn(e,i)}localPositionsToPositions(e,i){return mr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(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)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new V.GroupProperty([],"通用","通用"),new V.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",mV,pV,!0),new V.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new V.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new V.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new V.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new V.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new V.GroupProperty([],"Viewer","Viewer"),new V.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new V.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new V.BooleanProperty([this,"shadows"]),new V.GroupProperty([],"比例尺","比例尺(Legend)"),new V.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new V.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new V.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new V.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new V.GroupProperty([],"场景","场景(Scene)"),new V.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new V.GroupProperty([],"Globe","Globe"),new V.BooleanProperty([this,"depthTestAgainstTerrain"],"depthTestAgainstTerrain",i.depthTestAgainstTerrain,!0),new V.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new V.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new V.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new V.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new V.BooleanProperty([this,"sceneGlobeShowSkirts"]),new V.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new V.ColorProperty([this,"sceneGlobeBaseColor"]),new V.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new V.JsonProperty([this,"sceneGlobeClippingPlanes"]),new V.StringProperty([this,"sceneGlobeClippingPlanesId"]),new V.JsonProperty([this,"sceneGlobeClippingPolygons"]),new V.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new V.GroupProperty([],"underground","underground"),new V.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new V.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new V.GroupProperty([],"Translucency","Translucency"),new V.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",i.sceneGlobeTranslucencyEnabled,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",i.sceneGlobeTranslucencyBackFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",i.sceneGlobeTranslucencyFrontFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new V.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new V.GroupProperty([],"Sun","Sun"),new V.BooleanProperty([this,"sun"],"sun",i.sun,!0),new V.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new V.GroupProperty([],"Moon","Moon"),new V.BooleanProperty([this,"moon"],"moon",i.moon,!0),new V.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new V.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new V.GroupProperty([],"SkyBox","SkyBox"),new V.BooleanProperty([this,"sceneSkyBoxShow"]),new V.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new V.GroupProperty([],"Background","Background"),new V.BooleanProperty([this,"xbsjUseBackground"]),new V.StringProperty([this,"xbsjBackgroundImageUri"]),new V.ColorProperty([this,"xbsjBackgroundColor"]),new V.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new V.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new V.ColorProperty([this,"sceneBackgroundColor"]),new V.GroupProperty([],"Fog","Fog"),new V.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new V.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new V.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new V.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new V.GroupProperty([],"Sscc","Sscc"),new V.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new V.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new V.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new V.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new V.GroupProperty([],"后处理","后处理"),new V.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new V.GroupProperty([],"环境遮蔽","环境遮蔽"),new V.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new V.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new V.GroupProperty([],"Bloom","Bloom"),new V.BooleanProperty([this,"scenePpsBloomEnabled"]),new V.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new V.NumberProperty([this,"scenePpsBloomContrast"]),new V.NumberProperty([this,"scenePpsBloomBrightness"]),new V.NumberProperty([this,"scenePpsBloomDelta"]),new V.NumberProperty([this,"scenePpsBloomSigma"]),new V.NumberProperty([this,"scenePpsBloomStepSize"]),new V.GroupProperty([],"调试","调试"),new V.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new V.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new V.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new V.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new V.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new V.GroupProperty([],"Inspector","Inspector"),new V.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new V.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new V.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(zt,"type",zt.register("ESCesiumViewer",zt)),L(zt,"getCesiumIonToken",gV),L(zt,"currentDefaultAccessToken",C.Ion.defaultAccessToken),L(zt,"latestDefaultAccessToken"),L(zt,"ObjectsToExcludeWrapper",t6),L(zt,"defaults",{...V.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(zt,"getHeightsScartchCarto",new C.Cartographic);let tt=zt;(t=>{t.createDefaultProps=()=>({...V.ESViewer.createDefaultProps(),...dV()})})(tt||(tt={})),f.extendClassProps(tt.prototype,tt.createDefaultProps),ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.4.0-beta.4",e="2025-08-28T09:27:27.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="1a32b3e6b5db3af1400f485b8e37d33a513b8678",a=((Date.now()-1756373247e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4093
4093
|
%c${o?o+`
|
|
4094
4094
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4095
|
-
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4095
|
+
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","1a32b3e6b5db3af1400f485b8e37d33a513b8678")},get info(){return l},get date(){return"2025-08-28T09:27:27.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.4"},get name(){return"earthsdk3-cesium"},get commitId(){return"1a32b3e6b5db3af1400f485b8e37d33a513b8678"},print(){console.info(this.info,`
|
|
4096
4096
|
font-size: 18px;
|
|
4097
4097
|
font-weight: 1000;
|
|
4098
4098
|
line-height: 1;
|