earthsdk3-cesium 3.6.0-beta.5 → 3.6.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +77 -77
- package/dist/earthsdk3-cesium.js +246 -231
- package/dist/earthsdk3-cesium.umd.cjs +20 -20
- package/dist/types/CzmObjects/general/CzmES3DTileset/Czm3DTiles/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/StyleManager.d.ts +16 -9
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/StyleManager.d.ts.map +1 -1
- package/dist/types/utils/czmUtils/getCzmCode/getCzmCodeFromESImageryLayer.d.ts.map +1 -1
- package/dist/types/utils/czmUtils/getCzmCode/getCzmCodeFromESTerrainLayer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(M,we){typeof exports=="object"&&typeof module<"u"?we(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut"),require("pbf"),require("@mapbox/vector-tile")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut","pbf","@mapbox/vector-tile"],we):(M=typeof globalThis<"u"?globalThis:M||self,we(M.EarthSDK3_Cesium={},M.Cesium,M.EarthSDK3,M.html2canvas,M.Mapbox,M.Delaunator,M.earcut,M.Pbf,M.vectorTile))})(this,function(M,we,a,jh,p_,f_,g_,m_,v_){"use strict";var nN=Object.defineProperty;var oN=(M,we,a)=>we in M?nN(M,we,{enumerable:!0,configurable:!0,writable:!0,value:a}):M[we]=a;var m=(M,we,a)=>oN(M,typeof we!="symbol"?we+"":we,a);var Ko=typeof document<"u"?document.currentScript:null;function Lg(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=Lg(we),y_=Lg(p_);globalThis.Cesium=h;function w_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}h.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhN2VkNDM5ZS1jMDk0LTQ3NDItOTM5ZS00MzU3M2M1MTc2ZTkiLCJpZCI6MjU5LCJpYXQiOjE3NjIxODg4MDB9.ZZG574sONzeHxsX8HJMaL_ZiGA3dh_HrOxL7DrKRcd4";const ma=class ma extends a.Destroyable{};m(ma,"defaults",{enabled:!0}),m(ma,"createDefaultProps",()=>({...ma.defaults}));let Gt=ma;a.extendClassProps(Gt.prototype,Gt.createDefaultProps);class jt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s,r)=>this.flyTo(o,s,r))),this.d(i.flyInEvent.don((o,s,r)=>this.flyIn(o,s,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l,c="default"){const{sceneObject:u,czmViewer:d}=this,p=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e,c);p&&p.then(f=>{})}flyTo(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}flyIn(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}get czmViewer(){return this.viewer}}function Se(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const C_=new h.Cartographic;function se(t,i){const e=h.Cartographic.fromCartesian(t,void 0,C_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function Pe(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function Og(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function hi(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function vr(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function eu(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function Ng(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ui(t,i){if(t.length===4)return eu(t,i);if(t.length===3)return hi(t,i);if(t.length===2)return Pe(t,i);throw new Error("toCartesian error: should not be here!")}function __(t,i){if(t instanceof h.Cartesian2)return Og(t,i);if(t instanceof h.Cartesian3)return vr(t,i);if(t instanceof h.Cartesian4)return Ng(t,i);throw new Error("fromCartesian error: should not be here!")}function P_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function jn(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function b_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function dn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function S_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function Bg(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function x_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function yr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function E_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function A_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function T_(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const M_=new h.HeadingPitchRoll,I_=new h.Cartesian3;function D_(t,i,e){const n=Bg(i,M_),o=Se(t,I_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ve(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function R_(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const F_=new h.Cartesian3;function Ce(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,F_),i)}function z_(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function di(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),rectangle:t.rectangle&&Ve(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ty({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new iy({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function wr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(hi(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function dc(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(hi(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function pc(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Se(s))})),enabled:e,inverse:n})}function fc(t,i){return tu(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function Vg(t,i){return tu(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function tu(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function pn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Ug(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Re(t,i){if(!((!t.localScale||pn(t.localScale,3))&&(!t.localRotation||pn(t.localRotation,3))&&(!t.localPosition||pn(t.localPosition,3))&&(!t.localModelMatrix||pn(t.localModelMatrix,16))&&(!t.scale||pn(t.scale,3))&&(!t.rotation||pn(t.rotation,3))&&(!t.position||pn(t.position,3))&&(!t.modelMatrix||pn(t.modelMatrix,16)))||t.localScale&&!Ug(t.localScale)||t.scale&&!Ug(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=fc(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=fc(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const L_=new h.Cartesian3,Cr=new h.HeadingPitchRoll,O_=new h.Matrix4,N_=new h.Cartesian3,B_=new h.Cartographic;function V_(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,L_),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){Cr.heading=c[0],Cr.pitch=c[1],Cr.roll=c[2],Cr.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,Cr,void 0,void 0,O_),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,N_);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,B_);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function Wg(t,i,e,n){return V_(t,i,e,n)}const fn=h.Math.toDegrees;function Ht(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=o,i):[fn(e),fn(n),o]}function Jo(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=fn(o),i):[e,n,o].map(fn)}class gc extends a.Destroyable{constructor(e){super();m(this,"_originViewMatrix",new h.Matrix4);m(this,"_originProjMatrix",new h.Matrix4);m(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class U_ extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class W_ extends a.Destroyable{constructor(e){super();m(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new U_(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class eo extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_visibleAlpha",this.disposeVar(a.react(1)));m(this,"_viewDistance",this.disposeVar(a.react(0)));m(this,"_debug",this.disposeVar(a.react(!1)));m(this,"_viewDistanceDebug",this.disposeVar(new W_(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,g]=a.getReactFuncs(r),[v,y,w]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let E=1,A=Number.NEGATIVE_INFINITY;const R=c(),O=p(),B=v?v():0,V=l.getCurrentCameraInfo();if(!R||!O||!V){this._viewDistance.value=A,this._visibleAlpha.value=E;return}A=a.cartesianDistance(V.position,O)-(B??0);const[U,z,N,C]=R;U>z||z>N||N>C?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=z&&A<=N?E=1:A<=U||A>=C?E=0:A>U&&A<z?z-U<=0?E=0:E=(A-U)/(z-U):A>N&&A<C?(C<=N&&(E=0),E=(C-A)/(C-N)):(E=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=E};P();const _=[l.cameraChanged,d,g];w&&_.push(w);const S=this.disposeVar(a.createNextAnimateFrameEvent(..._));this.dispose(S.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const G_=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Wi(t,i,e){var n=G_;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function pt(t,i=!1){const e=t.length;let n;const o=[];for(let s=0;s<e;++s){const[r,l,c]=t[s],u=i?h.Cartesian3.fromDegrees(r,l):h.Cartesian3.fromDegrees(r,l,c);if(!u)continue;const{x:d,y:p,z:f}=u;[d,p,f].every(Number.isFinite)&&(!n||!h.Cartesian3.equals(n,u))&&(n=u,o.push(n))}return o}function to(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function H_(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function $_(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const Gg=new h.Cartesian3,q_=new h.Ray,X_=new h.Plane(h.Cartesian3.UNIT_X,0);function mc(t,i,e,n){const o=h.Cartesian3.normalize(i,Gg),s=h.Cartesian3.cross(t.camera.right,o,Gg);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,X_),l=t.camera.getPickRay(e,q_);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const iu=new h.Cartesian3,Y_=new h.Ray,Z_=new h.Cartographic,Q_=new h.Ellipsoid;function jo(t,i,e,n){const o=t.camera.getPickRay(i,Y_);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,iu),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,iu),l=h.Ellipsoid.fromCartesian3(r,Q_),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,iu),p=h.Cartographic.fromCartesian(d,void 0,Z_);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function es(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function Hg(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const $g=new h.Cartographic,qg=new h.Cartesian3,Mt=[0,0,0],gn=[0,0,0],nu=new h.Cartesian2,ou=new h.Cartesian3;function su(t,i,e,n,o,s){o.constraintMode="none",es([0,0,0],o.startDragPos),s=s||{},ui(a.getDomEventCurrentTargetPos(t),nu);const r=e.position;if(!Se(r,ou))return;const l=Wi(i,ou,n);if(l===void 0||!mc(i,ou,nu,qg)||!se(qg,Mt))return;const c=Hg(Mt[2])*a.geoDistance(r,Mt);if(!s.z&&c<l&&Math.abs(r[2]-Mt[2])<e.dimensions[0]&&Mt[2]>r[2])return o.constraintMode="z",es(Mt,o.startDragPos),!0;if(!jo(i,nu,r[2],$g)||!jn($g,Mt))return;const u=Hg(r[2])*a.geoDistance(r,Mt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",es(Mt,o.startDragPos);return}{const[p,f]=to(r,e.heading+90,Mt,gn);if(!s.x&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="x",es(gn,o.startDragPos);return}}{const[p,f]=to(r,e.heading,Mt,gn);if(!s.y&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="y",es(gn,o.startDragPos);return}}s.xy||(o.constraintMode="xy",es(Mt,o.startDragPos))}}async function Xg(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ui(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=jo(o,r,e);return c?jn(c):void 0}}let ru,au;function Yg(t,i,e,n,o){o=o||new h.Cartesian3,ru=ru||new h.Ray,au=au||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,ru),r=h.Plane.fromPointNormal(i,e,au);return o=h.IntersectionTests.rayPlane(s,r,o),o}function Zg(t){const i=h.Material.fromType(t.type);return lu(i,t),i}function It(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function k_(t){return{x:t[0],y:t[1]}}function lu(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=Pe(i.lineCount??[8,8]),t.uniforms.lineThickness=Pe(i.lineThickness??[1,1]),t.uniforms.lineOffset=Pe(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=It(i.specularMap),t.uniforms.normalMap=It(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=k_(i.fadeDirection??[!0,!0]),t.uniforms.time=Pe(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=It(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=It(i.image):i.type==="ElevationBand"?(t.uniforms.color=It(i.colors),t.uniforms.heights=It(i.heights)):i.type==="XbsjPolylineArrow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.image=It(i.image),t.uniforms.repeat=i.repeat??60,t.uniforms.speed=i.speed??1,t.uniforms.lineLength=i.lineLength??1,t.uniforms.arrowColor=te(i.arrowColor??[1,1,1,1])):console.warn(`未知材质类型,无法更新 ${i.type}`)}function pi(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Zg(c)):e.value&&lu(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Gi(t,i=!1){const e=pt(t.positions,i),n=t.holes&&t.holes.map(o=>Gi(o));return{positions:e,holes:n}}function cu(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const Qg=new h.Cartesian4,K_=new h.Matrix4;function J_(){return{left:0,top:0,right:0,bottom:0,depth:0}}function kg(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Kg(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,K_),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Qg),Qg);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,g=c.z;if(!(u<0||d<0||p<0||f<0||g<0||g>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=g):e={left:u,top:f,right:p,bottom:d,depth:g},e}const io={left:0,top:0,right:0,bottom:0,depth:0};class vc extends a.Destroyable{constructor(e,n=!0,o){super();m(this,"_cartesian",new h.Cartesian3);m(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});m(this,"_winPosValid",!1);m(this,"_changedEvent",new a.Event);m(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new gc(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Kg(this._viewer,this._cartesian,io);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?kg(this._winPos,io)||(e=!0,this._winPos.left=io.left,this._winPos.top=io.top,this._winPos.right=io.right,this._winPos.bottom=io.bottom,this._winPos.depth=io.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function Jg(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const j_=h.Check,no=h.defined,jg=h.Math.EPSILON10;function e1(t,i,e,n){if(j_.defined("equalsEpsilon",i),!no(t))return;e=e??!1;const o=no(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,jg)?(no(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(no(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],jg)&&(o&&(no(u)?n.splice(p,0,d):n.push(s-1)),no(u)?u.length-=1:u=t.slice(0,-1)),no(u)?u:t}const ge=h.Cartesian3,ts=h.Cartographic,oo=h.defined,em=h.DeveloperError,tm=h.Ellipsoid,t1=h.EllipsoidGeodesic,im=h.EllipsoidRhumbLine,i1=h.IntersectionTests,hu=h.Math,is=h.Matrix4,so=h.Plane,Je={};Je.numberOfPoints=function(t,i,e){const n=ge.distance(t,i);return Math.ceil(n/e)},Je.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const n1=new ts;Je.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,n1).height}return n};const o1=new is,s1=new ge,nm=new ge,r1=new so(ge.UNIT_X,0),om=new ge,a1=new so(ge.UNIT_X,0),l1=new ge,c1=new ge,uu=[];function sm(t,i,e){const n=uu;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const yc=new ts,wc=new ts,mn=new ge,du=new ge,h1=new ge,pu=new t1;let _r=new im;function u1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,du),u=n.scaleToGeodeticSurface(i,h1),d=Je.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,yc),f=n.cartesianToCartographic(u,wc),g=sm(d,o,s);pu.setEndPoints(p,f);const v=pu.surfaceDistance/d;let y=l;p.height=o;let w=n.cartographicToCartesian(p,mn);ge.pack(w,r,y),y+=3;for(let P=1;P<d;P++){const _=pu.interpolateUsingSurfaceDistance(P*v,wc);_.height=g[P],w=n.cartographicToCartesian(_,mn),ge.pack(w,r,y),y+=3}return y}function d1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,yc),u=n.cartesianToCartographic(i,wc),d=Je.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=sm(d,o,s);_r.ellipsoid.equals(n)||(_r=new im(void 0,void 0,n)),_r.setEndPoints(c,u);const f=_r.surfaceDistance/d;let g=l;c.height=o;let v=n.cartographicToCartesian(c,mn);ge.pack(v,r,g),g+=3;for(let y=1;y<d;y++){const w=_r.interpolateUsingSurfaceDistance(y*f,wc);w.height=p[y],v=n.cartographicToCartesian(w,mn),ge.pack(v,r,g),g+=3}return g}Je.wrapLongitude=function(t,i){const e=[],n=[];if(oo(t)&&t.length>0){i=i??is.IDENTITY;const o=is.inverseTransformation(i,o1),s=is.multiplyByPoint(o,ge.ZERO,s1),r=ge.normalize(is.multiplyByPointAsVector(o,ge.UNIT_Y,nm),nm),l=so.fromPointNormal(s,r,r1),c=ge.normalize(is.multiplyByPointAsVector(o,ge.UNIT_X,om),om),u=so.fromPointNormal(s,c,a1);let d=1;e.push(ge.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const v=t[g];if(so.getPointDistance(u,p)<0||so.getPointDistance(u,v)<0){const y=i1.lineSegmentPlane(p,v,l,l1);if(oo(y)){const w=ge.multiplyByScalar(r,5e-9,c1);so.getPointDistance(l,p)<0&&ge.negate(w,w),e.push(ge.add(y,w,new ge)),n.push(d+1),ge.negate(w,w),e.push(ge.add(y,w,new ge)),d=1}}e.push(ge.clone(t[g])),d++,p=v}n.push(d)}return{positions:e,lengths:n}},Je.generateArc=function(t){oo(t)||(t={});const i=t.positions;if(!oo(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],du);if(o=s?o[0]:o,o!==0){const w=n.geodeticSurfaceNormal(y,mn);ge.multiplyByScalar(w,o,w),ge.add(y,w,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!oo(r)){const y=t.granularity??hu.RADIANS_PER_DEGREE;r=hu.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=Je.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],w=i[c+1],P=s?o[c]:o,_=s?o[c+1]:o;p=u1(y,w,r,n,P,_,d,p)}uu.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,yc);g.height=s?o[e-1]:o;const v=n.cartographicToCartesian(g,mn);return ge.pack(v,d,u-3),d};const rm=new ts,p1=new ts;Je.generateRhumbArc=function(t){oo(t)||(t={});const i=t.positions;if(!oo(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],du);if(o=s?o[0]:o,o!==0){const _=n.geodeticSurfaceNormal(P,mn);ge.multiplyByScalar(_,o,_),ge.add(P,_,P)}return[P.x,P.y,P.z]}const r=t.granularity??hu.RADIANS_PER_DEGREE;let l=0,c,u=n.cartesianToCartographic(i[0],rm),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],p1),l+=Je.numberOfPointsRhumbLine(u,d,r),u=ts.clone(d,rm);const p=(l+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const P=i[c],_=i[c+1],S=s?o[c]:o,E=s?o[c+1]:o;g=d1(P,_,r,n,S,E,f,g)}uu.length=0;const v=i[e-1],y=n.cartesianToCartographic(v,yc);y.height=s?o[e-1]:o;const w=n.cartographicToCartesian(y,mn);return ge.pack(w,f,p-3),f},Je.generateCartesianArc=function(t){const i=Je.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n},Je.generateCartesianRhumbArc=function(t){const i=Je.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n};const Cc=h.ArcType,f1=h.Cartesian3,g1=h.Math;function am(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=e1(t.positions,f1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===Cc.GEODESIC||i===Cc.RHUMB){let l;i===Cc.GEODESIC?(l=g1.chordLength(e,n.maximumRadius),Je.numberOfPoints):(l=e,Je.numberOfPointsRhumbLine);const c=Je.extractHeights(s,n);i===Cc.GEODESIC?s=Je.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=Je.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function fu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=am({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function lm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function gu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?fc(o,l):r==="XForwardZUp"&&Vg(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ui(s),e),lm(e,i)}const m1=new h.Matrix4;function cm(t,i){const e=h.Matrix4.fromArray(t,0,m1);return h.Matrix4.inverse(e,e),lm(e,i)}const v1=new h.Matrix4,y1=new h.Cartesian3;function hm(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,y1),l=h.Matrix4.fromArray(t,0,v1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const w1=new h.Matrix4,C1=new h.Cartesian3,_1=new h.Cartographic;function vn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,C1),l=h.Matrix4.fromArray(t,0,w1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,_1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function Dt(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=gu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=cm(r);return[i.map(u=>hm(l,u)),r,l]}function yn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=gu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>vn(r,c)),r]}function um(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=we.Cartesian3.fromDegrees(...t[e]),o=we.Cartesian3.fromDegrees(...t[e+1]),s=we.Cartesian3.fromDegrees(...t[e+2]),r=we.Cartesian3.angleBetween(we.Cartesian3.subtract(n,o,new we.Cartesian3),we.Cartesian3.subtract(s,o,new we.Cartesian3));i.push(isNaN(r)?0:we.Math.toDegrees(r))}return i}function mu(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>se(n)))),t.holes&&t.holes.forEach(n=>{e=mu(n,e)}),e}function $t(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class vu extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let v=r();v&&(v=[...v],i.editingHeightOffset&&(v[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...v,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const v=Wi(s,f,o);v!==void 0?d([v,v,v]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${v??"undefined"}`)}))}}function P1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=se(e),u=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=se(n),d=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=se(o),p=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=vn(i,[e.x,e.y,e.z]),u=vn(i,[-e.x,-e.y,-e.z]),l=vn(i,[n.x,n.y,n.z]),d=vn(i,[-n.x,-n.y,-n.z]),c=vn(i,[o.x,o.y,o.z]),p=vn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const dm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&u()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=P1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function b1(t){return new Promise((i,e)=>{dm.restart(void 0,t),dm.completeEvent.don(n=>{i(n)})})}class yu extends a.Destroyable{constructor(e){super();m(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function pm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
1
|
+
(function(M,we){typeof exports=="object"&&typeof module<"u"?we(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut"),require("pbf"),require("@mapbox/vector-tile")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut","pbf","@mapbox/vector-tile"],we):(M=typeof globalThis<"u"?globalThis:M||self,we(M.EarthSDK3_Cesium={},M.Cesium,M.EarthSDK3,M.html2canvas,M.Mapbox,M.Delaunator,M.earcut,M.Pbf,M.vectorTile))})(this,function(M,we,a,jh,p_,f_,g_,m_,v_){"use strict";var iN=Object.defineProperty;var nN=(M,we,a)=>we in M?iN(M,we,{enumerable:!0,configurable:!0,writable:!0,value:a}):M[we]=a;var m=(M,we,a)=>nN(M,typeof we!="symbol"?we+"":we,a);var Ko=typeof document<"u"?document.currentScript:null;function Lg(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=Lg(we),y_=Lg(p_);globalThis.Cesium=h;function w_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}h.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhN2VkNDM5ZS1jMDk0LTQ3NDItOTM5ZS00MzU3M2M1MTc2ZTkiLCJpZCI6MjU5LCJpYXQiOjE3NjIxODg4MDB9.ZZG574sONzeHxsX8HJMaL_ZiGA3dh_HrOxL7DrKRcd4";const ma=class ma extends a.Destroyable{};m(ma,"defaults",{enabled:!0}),m(ma,"createDefaultProps",()=>({...ma.defaults}));let Gt=ma;a.extendClassProps(Gt.prototype,Gt.createDefaultProps);class jt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s,r)=>this.flyTo(o,s,r))),this.d(i.flyInEvent.don((o,s,r)=>this.flyIn(o,s,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l,c="default"){const{sceneObject:u,czmViewer:d}=this,p=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e,c);p&&p.then(f=>{})}flyTo(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}flyIn(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}get czmViewer(){return this.viewer}}function Se(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const C_=new h.Cartographic;function se(t,i){const e=h.Cartographic.fromCartesian(t,void 0,C_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function Pe(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function Og(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function hi(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function vr(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function eu(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function Ng(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ui(t,i){if(t.length===4)return eu(t,i);if(t.length===3)return hi(t,i);if(t.length===2)return Pe(t,i);throw new Error("toCartesian error: should not be here!")}function __(t,i){if(t instanceof h.Cartesian2)return Og(t,i);if(t instanceof h.Cartesian3)return vr(t,i);if(t instanceof h.Cartesian4)return Ng(t,i);throw new Error("fromCartesian error: should not be here!")}function P_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function jn(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function b_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function dn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function S_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function Bg(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function x_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function yr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function E_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function A_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function T_(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const M_=new h.HeadingPitchRoll,I_=new h.Cartesian3;function D_(t,i,e){const n=Bg(i,M_),o=Se(t,I_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ve(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function R_(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const F_=new h.Cartesian3;function Ce(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,F_),i)}function z_(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function di(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),rectangle:t.rectangle&&Ve(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ty({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new iy({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Pe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Pe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function wr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(hi(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function dc(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(hi(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function pc(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Se(s))})),enabled:e,inverse:n})}function fc(t,i){return tu(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function Vg(t,i){return tu(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function tu(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function pn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Ug(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Re(t,i){if(!((!t.localScale||pn(t.localScale,3))&&(!t.localRotation||pn(t.localRotation,3))&&(!t.localPosition||pn(t.localPosition,3))&&(!t.localModelMatrix||pn(t.localModelMatrix,16))&&(!t.scale||pn(t.scale,3))&&(!t.rotation||pn(t.rotation,3))&&(!t.position||pn(t.position,3))&&(!t.modelMatrix||pn(t.modelMatrix,16)))||t.localScale&&!Ug(t.localScale)||t.scale&&!Ug(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=fc(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=fc(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const L_=new h.Cartesian3,Cr=new h.HeadingPitchRoll,O_=new h.Matrix4,N_=new h.Cartesian3,B_=new h.Cartographic;function V_(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,L_),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){Cr.heading=c[0],Cr.pitch=c[1],Cr.roll=c[2],Cr.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,Cr,void 0,void 0,O_),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,N_);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,B_);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function Wg(t,i,e,n){return V_(t,i,e,n)}const fn=h.Math.toDegrees;function Ht(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=o,i):[fn(e),fn(n),o]}function Jo(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=fn(o),i):[e,n,o].map(fn)}class gc extends a.Destroyable{constructor(e){super();m(this,"_originViewMatrix",new h.Matrix4);m(this,"_originProjMatrix",new h.Matrix4);m(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class U_ extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class W_ extends a.Destroyable{constructor(e){super();m(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new U_(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class eo extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_visibleAlpha",this.disposeVar(a.react(1)));m(this,"_viewDistance",this.disposeVar(a.react(0)));m(this,"_debug",this.disposeVar(a.react(!1)));m(this,"_viewDistanceDebug",this.disposeVar(new W_(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,g]=a.getReactFuncs(r),[v,y,w]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let E=1,A=Number.NEGATIVE_INFINITY;const R=c(),O=p(),B=v?v():0,V=l.getCurrentCameraInfo();if(!R||!O||!V){this._viewDistance.value=A,this._visibleAlpha.value=E;return}A=a.cartesianDistance(V.position,O)-(B??0);const[U,z,N,C]=R;U>z||z>N||N>C?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=z&&A<=N?E=1:A<=U||A>=C?E=0:A>U&&A<z?z-U<=0?E=0:E=(A-U)/(z-U):A>N&&A<C?(C<=N&&(E=0),E=(C-A)/(C-N)):(E=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=E};P();const _=[l.cameraChanged,d,g];w&&_.push(w);const S=this.disposeVar(a.createNextAnimateFrameEvent(..._));this.dispose(S.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const G_=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Wi(t,i,e){var n=G_;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function pt(t,i=!1){const e=t.length;let n;const o=[];for(let s=0;s<e;++s){const[r,l,c]=t[s],u=i?h.Cartesian3.fromDegrees(r,l):h.Cartesian3.fromDegrees(r,l,c);if(!u)continue;const{x:d,y:p,z:f}=u;[d,p,f].every(Number.isFinite)&&(!n||!h.Cartesian3.equals(n,u))&&(n=u,o.push(n))}return o}function to(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function H_(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function $_(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const Gg=new h.Cartesian3,q_=new h.Ray,X_=new h.Plane(h.Cartesian3.UNIT_X,0);function mc(t,i,e,n){const o=h.Cartesian3.normalize(i,Gg),s=h.Cartesian3.cross(t.camera.right,o,Gg);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,X_),l=t.camera.getPickRay(e,q_);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const iu=new h.Cartesian3,Y_=new h.Ray,Z_=new h.Cartographic,Q_=new h.Ellipsoid;function jo(t,i,e,n){const o=t.camera.getPickRay(i,Y_);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,iu),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,iu),l=h.Ellipsoid.fromCartesian3(r,Q_),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,iu),p=h.Cartographic.fromCartesian(d,void 0,Z_);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function es(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function Hg(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const $g=new h.Cartographic,qg=new h.Cartesian3,Mt=[0,0,0],gn=[0,0,0],nu=new h.Cartesian2,ou=new h.Cartesian3;function su(t,i,e,n,o,s){o.constraintMode="none",es([0,0,0],o.startDragPos),s=s||{},ui(a.getDomEventCurrentTargetPos(t),nu);const r=e.position;if(!Se(r,ou))return;const l=Wi(i,ou,n);if(l===void 0||!mc(i,ou,nu,qg)||!se(qg,Mt))return;const c=Hg(Mt[2])*a.geoDistance(r,Mt);if(!s.z&&c<l&&Math.abs(r[2]-Mt[2])<e.dimensions[0]&&Mt[2]>r[2])return o.constraintMode="z",es(Mt,o.startDragPos),!0;if(!jo(i,nu,r[2],$g)||!jn($g,Mt))return;const u=Hg(r[2])*a.geoDistance(r,Mt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",es(Mt,o.startDragPos);return}{const[p,f]=to(r,e.heading+90,Mt,gn);if(!s.x&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="x",es(gn,o.startDragPos);return}}{const[p,f]=to(r,e.heading,Mt,gn);if(!s.y&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Mt)<l)){o.constraintMode="y",es(gn,o.startDragPos);return}}s.xy||(o.constraintMode="xy",es(Mt,o.startDragPos))}}async function Xg(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ui(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=jo(o,r,e);return c?jn(c):void 0}}let ru,au;function Yg(t,i,e,n,o){o=o||new h.Cartesian3,ru=ru||new h.Ray,au=au||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,ru),r=h.Plane.fromPointNormal(i,e,au);return o=h.IntersectionTests.rayPlane(s,r,o),o}function Zg(t){const i=h.Material.fromType(t.type);return lu(i,t),i}function It(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function k_(t){return{x:t[0],y:t[1]}}function lu(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=It(i.image),t.uniforms.repeat=Pe(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=Pe(i.lineCount??[8,8]),t.uniforms.lineThickness=Pe(i.lineThickness??[1,1]),t.uniforms.lineOffset=Pe(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=Pe(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=It(i.specularMap),t.uniforms.normalMap=It(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=k_(i.fadeDirection??[!0,!0]),t.uniforms.time=Pe(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=It(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=It(i.image):i.type==="ElevationBand"?(t.uniforms.color=It(i.colors),t.uniforms.heights=It(i.heights)):i.type==="XbsjPolylineArrow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.image=It(i.image),t.uniforms.repeat=i.repeat??60,t.uniforms.speed=i.speed??1,t.uniforms.lineLength=i.lineLength??1,t.uniforms.arrowColor=te(i.arrowColor??[1,1,1,1])):console.warn(`未知材质类型,无法更新 ${i.type}`)}function pi(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Zg(c)):e.value&&lu(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Gi(t,i=!1){const e=pt(t.positions,i),n=t.holes&&t.holes.map(o=>Gi(o));return{positions:e,holes:n}}function cu(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const Qg=new h.Cartesian4,K_=new h.Matrix4;function J_(){return{left:0,top:0,right:0,bottom:0,depth:0}}function kg(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Kg(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,K_),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Qg),Qg);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,g=c.z;if(!(u<0||d<0||p<0||f<0||g<0||g>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=g):e={left:u,top:f,right:p,bottom:d,depth:g},e}const io={left:0,top:0,right:0,bottom:0,depth:0};class vc extends a.Destroyable{constructor(e,n=!0,o){super();m(this,"_cartesian",new h.Cartesian3);m(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});m(this,"_winPosValid",!1);m(this,"_changedEvent",new a.Event);m(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new gc(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Kg(this._viewer,this._cartesian,io);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?kg(this._winPos,io)||(e=!0,this._winPos.left=io.left,this._winPos.top=io.top,this._winPos.right=io.right,this._winPos.bottom=io.bottom,this._winPos.depth=io.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function Jg(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const j_=h.Check,no=h.defined,jg=h.Math.EPSILON10;function e1(t,i,e,n){if(j_.defined("equalsEpsilon",i),!no(t))return;e=e??!1;const o=no(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,jg)?(no(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(no(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],jg)&&(o&&(no(u)?n.splice(p,0,d):n.push(s-1)),no(u)?u.length-=1:u=t.slice(0,-1)),no(u)?u:t}const ge=h.Cartesian3,ts=h.Cartographic,oo=h.defined,em=h.DeveloperError,tm=h.Ellipsoid,t1=h.EllipsoidGeodesic,im=h.EllipsoidRhumbLine,i1=h.IntersectionTests,hu=h.Math,is=h.Matrix4,so=h.Plane,Je={};Je.numberOfPoints=function(t,i,e){const n=ge.distance(t,i);return Math.ceil(n/e)},Je.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const n1=new ts;Je.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,n1).height}return n};const o1=new is,s1=new ge,nm=new ge,r1=new so(ge.UNIT_X,0),om=new ge,a1=new so(ge.UNIT_X,0),l1=new ge,c1=new ge,uu=[];function sm(t,i,e){const n=uu;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const yc=new ts,wc=new ts,mn=new ge,du=new ge,h1=new ge,pu=new t1;let _r=new im;function u1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,du),u=n.scaleToGeodeticSurface(i,h1),d=Je.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,yc),f=n.cartesianToCartographic(u,wc),g=sm(d,o,s);pu.setEndPoints(p,f);const v=pu.surfaceDistance/d;let y=l;p.height=o;let w=n.cartographicToCartesian(p,mn);ge.pack(w,r,y),y+=3;for(let P=1;P<d;P++){const _=pu.interpolateUsingSurfaceDistance(P*v,wc);_.height=g[P],w=n.cartographicToCartesian(_,mn),ge.pack(w,r,y),y+=3}return y}function d1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,yc),u=n.cartesianToCartographic(i,wc),d=Je.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=sm(d,o,s);_r.ellipsoid.equals(n)||(_r=new im(void 0,void 0,n)),_r.setEndPoints(c,u);const f=_r.surfaceDistance/d;let g=l;c.height=o;let v=n.cartographicToCartesian(c,mn);ge.pack(v,r,g),g+=3;for(let y=1;y<d;y++){const w=_r.interpolateUsingSurfaceDistance(y*f,wc);w.height=p[y],v=n.cartographicToCartesian(w,mn),ge.pack(v,r,g),g+=3}return g}Je.wrapLongitude=function(t,i){const e=[],n=[];if(oo(t)&&t.length>0){i=i??is.IDENTITY;const o=is.inverseTransformation(i,o1),s=is.multiplyByPoint(o,ge.ZERO,s1),r=ge.normalize(is.multiplyByPointAsVector(o,ge.UNIT_Y,nm),nm),l=so.fromPointNormal(s,r,r1),c=ge.normalize(is.multiplyByPointAsVector(o,ge.UNIT_X,om),om),u=so.fromPointNormal(s,c,a1);let d=1;e.push(ge.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const v=t[g];if(so.getPointDistance(u,p)<0||so.getPointDistance(u,v)<0){const y=i1.lineSegmentPlane(p,v,l,l1);if(oo(y)){const w=ge.multiplyByScalar(r,5e-9,c1);so.getPointDistance(l,p)<0&&ge.negate(w,w),e.push(ge.add(y,w,new ge)),n.push(d+1),ge.negate(w,w),e.push(ge.add(y,w,new ge)),d=1}}e.push(ge.clone(t[g])),d++,p=v}n.push(d)}return{positions:e,lengths:n}},Je.generateArc=function(t){oo(t)||(t={});const i=t.positions;if(!oo(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],du);if(o=s?o[0]:o,o!==0){const w=n.geodeticSurfaceNormal(y,mn);ge.multiplyByScalar(w,o,w),ge.add(y,w,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!oo(r)){const y=t.granularity??hu.RADIANS_PER_DEGREE;r=hu.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=Je.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],w=i[c+1],P=s?o[c]:o,_=s?o[c+1]:o;p=u1(y,w,r,n,P,_,d,p)}uu.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,yc);g.height=s?o[e-1]:o;const v=n.cartographicToCartesian(g,mn);return ge.pack(v,d,u-3),d};const rm=new ts,p1=new ts;Je.generateRhumbArc=function(t){oo(t)||(t={});const i=t.positions;if(!oo(i))throw new em("options.positions is required.");const e=i.length,n=t.ellipsoid??tm.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],du);if(o=s?o[0]:o,o!==0){const _=n.geodeticSurfaceNormal(P,mn);ge.multiplyByScalar(_,o,_),ge.add(P,_,P)}return[P.x,P.y,P.z]}const r=t.granularity??hu.RADIANS_PER_DEGREE;let l=0,c,u=n.cartesianToCartographic(i[0],rm),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],p1),l+=Je.numberOfPointsRhumbLine(u,d,r),u=ts.clone(d,rm);const p=(l+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const P=i[c],_=i[c+1],S=s?o[c]:o,E=s?o[c+1]:o;g=d1(P,_,r,n,S,E,f,g)}uu.length=0;const v=i[e-1],y=n.cartesianToCartographic(v,yc);y.height=s?o[e-1]:o;const w=n.cartographicToCartesian(y,mn);return ge.pack(w,f,p-3),f},Je.generateCartesianArc=function(t){const i=Je.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n},Je.generateCartesianRhumbArc=function(t){const i=Je.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=ge.unpack(i,o*3);return n};const Cc=h.ArcType,f1=h.Cartesian3,g1=h.Math;function am(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=e1(t.positions,f1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===Cc.GEODESIC||i===Cc.RHUMB){let l;i===Cc.GEODESIC?(l=g1.chordLength(e,n.maximumRadius),Je.numberOfPoints):(l=e,Je.numberOfPointsRhumbLine);const c=Je.extractHeights(s,n);i===Cc.GEODESIC?s=Je.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=Je.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function fu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=am({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function lm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function gu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?fc(o,l):r==="XForwardZUp"&&Vg(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ui(s),e),lm(e,i)}const m1=new h.Matrix4;function cm(t,i){const e=h.Matrix4.fromArray(t,0,m1);return h.Matrix4.inverse(e,e),lm(e,i)}const v1=new h.Matrix4,y1=new h.Cartesian3;function hm(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,y1),l=h.Matrix4.fromArray(t,0,v1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const w1=new h.Matrix4,C1=new h.Cartesian3,_1=new h.Cartographic;function vn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,C1),l=h.Matrix4.fromArray(t,0,w1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,_1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function Dt(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=gu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=cm(r);return[i.map(u=>hm(l,u)),r,l]}function yn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=gu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>vn(r,c)),r]}function um(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=we.Cartesian3.fromDegrees(...t[e]),o=we.Cartesian3.fromDegrees(...t[e+1]),s=we.Cartesian3.fromDegrees(...t[e+2]),r=we.Cartesian3.angleBetween(we.Cartesian3.subtract(n,o,new we.Cartesian3),we.Cartesian3.subtract(s,o,new we.Cartesian3));i.push(isNaN(r)?0:we.Math.toDegrees(r))}return i}function mu(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>se(n)))),t.holes&&t.holes.forEach(n=>{e=mu(n,e)}),e}function $t(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class vu extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let v=r();v&&(v=[...v],i.editingHeightOffset&&(v[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...v,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const v=Wi(s,f,o);v!==void 0?d([v,v,v]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${v??"undefined"}`)}))}}function P1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=se(e),u=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=se(n),d=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=se(o),p=se(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=vn(i,[e.x,e.y,e.z]),u=vn(i,[-e.x,-e.y,-e.z]),l=vn(i,[n.x,n.y,n.z]),d=vn(i,[-n.x,-n.y,-n.z]),c=vn(i,[o.x,o.y,o.z]),p=vn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const dm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&u()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=P1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function b1(t){return new Promise((i,e)=>{dm.restart(void 0,t),dm.completeEvent.don(n=>{i(n)})})}class yu extends a.Destroyable{constructor(e){super();m(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function pm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
2
2
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
3
3
|
|
|
4
4
|
uniform sampler2D specularMap;
|
|
@@ -64,22 +64,22 @@
|
|
|
64
64
|
material.shininess = 10.0;
|
|
65
65
|
|
|
66
66
|
return material;
|
|
67
|
-
}`}})}const S1=(t,i)=>{let e=!0;return t.primitives.forEach(n=>{const o=i[n.material.name]??i.default;o!=null&&(Reflect.has(o,"baseColorFactor")&&o.baseColorFactor&&(n.material.metallicRoughness.baseColorFactor=eu(o.baseColorFactor)),Reflect.has(o,"alphaMode")&&(n.material.alphaMode=o.alphaMode),Reflect.has(o,"doubleSided")&&(n.material.doubleSided=o.doubleSided),Reflect.has(o,"unlit")&&(n.material.unlit=o.unlit),Reflect.has(o,"emissiveFactor")&&o.emissiveFactor&&(n.material.emissiveFactor=hi(o.emissiveFactor)),Reflect.has(o,"metallicFactor")&&(n.material.metallicRoughness.metallicFactor=o.metallicFactor),Reflect.has(o,"roughnessFactor")&&(n.material.metallicRoughness.roughnessFactor=o.roughnessFactor),Reflect.has(o,"baseColorTexture")&&o.baseColorTexture!=null&&(n.material.metallicRoughness.baseColorTexture?(n.material.metallicRoughness.baseColorTexture.texture=o.baseColorTexture.texture,n.material.metallicRoughness.baseColorTexture.transform=o.baseColorTexture.transform):e=!1),Reflect.has(o,"normalTexture")&&n.material.metallicRoughness.baseColorTexture&&(n.material.normalTexture=o.normalTexture),Reflect.has(o,"metallicRoughnessTexture")&&(n.material.metallicRoughness.metallicRoughnessTexture=o.metallicRoughnessTexture))}),e};function Pr(t,i){let e=!0;if(i==="default")t._resourcesLoaded=t._texturesLoaded=!1,t._loader._state=2,t._loader._loadResourcesPromise=void 0;else{let n=function(o,s){o.forEach(r=>{const l=S1(r,s);e=e&&l,r.children&&r.children.length>0&&n(r.children,s)})};n(t.loader.components.nodes,i)}return t._drawCommandsBuilt=!1,e}async function ro(t,i,e){let n;const o=i!=null&&i.offset?h.Cartesian2.unpack(i.offset):h.Cartesian2.ZERO;let s=h.Math.toRadians((i==null?void 0:i.rotate)??0);const r=i!=null&&i.scale?h.Cartesian2.unpack(i==null?void 0:i.scale):new h.Cartesian2(1,1);return s=-s,n=new h.Matrix3(Math.cos(s)*r.x,-Math.sin(s)*r.y,o.x,Math.sin(s)*r.x,Math.cos(s)*r.y,o.y,0,0,1),h.Resource.createIfNeeded(i.value).fetchImage().then(l=>{if(!t)return;const c=Du(t.scene.context,l,{flipY:!1,minificationFilter:e==null?void 0:e.minFilter,magnificationFilter:e==null?void 0:e.magFilter}),u=new h.ModelComponents.TextureReader;return u.index=0,u.texture=c,u.texCoord=0,u.scale=void 0,u.transform=n,u.channels=void 0,u})}function x1(t){if(t.url)return`(async ()=>{
|
|
67
|
+
}`}})}const S1=(t,i)=>{let e=!0;return t.primitives.forEach(n=>{const o=i[n.material.name]??i.default;o!=null&&(Reflect.has(o,"baseColorFactor")&&o.baseColorFactor&&(n.material.metallicRoughness.baseColorFactor=eu(o.baseColorFactor)),Reflect.has(o,"alphaMode")&&(n.material.alphaMode=o.alphaMode),Reflect.has(o,"doubleSided")&&(n.material.doubleSided=o.doubleSided),Reflect.has(o,"unlit")&&(n.material.unlit=o.unlit),Reflect.has(o,"emissiveFactor")&&o.emissiveFactor&&(n.material.emissiveFactor=hi(o.emissiveFactor)),Reflect.has(o,"metallicFactor")&&(n.material.metallicRoughness.metallicFactor=o.metallicFactor),Reflect.has(o,"roughnessFactor")&&(n.material.metallicRoughness.roughnessFactor=o.roughnessFactor),Reflect.has(o,"baseColorTexture")&&o.baseColorTexture!=null&&(n.material.metallicRoughness.baseColorTexture?(n.material.metallicRoughness.baseColorTexture.texture=o.baseColorTexture.texture,n.material.metallicRoughness.baseColorTexture.transform=o.baseColorTexture.transform):e=!1),Reflect.has(o,"normalTexture")&&n.material.metallicRoughness.baseColorTexture&&(n.material.normalTexture=o.normalTexture),Reflect.has(o,"metallicRoughnessTexture")&&(n.material.metallicRoughness.metallicRoughnessTexture=o.metallicRoughnessTexture))}),e};function Pr(t,i){let e=!0;if(i==="default")t._resourcesLoaded=t._texturesLoaded=!1,t._loader._state=2,t._loader._loadResourcesPromise=void 0;else{let n=function(o,s){o.forEach(r=>{const l=S1(r,s);e=e&&l,r.children&&r.children.length>0&&n(r.children,s)})};n(t.loader.components.nodes,i)}return t._drawCommandsBuilt=!1,e}async function ro(t,i,e){let n;const o=i!=null&&i.offset?h.Cartesian2.unpack(i.offset):h.Cartesian2.ZERO;let s=h.Math.toRadians((i==null?void 0:i.rotate)??0);const r=i!=null&&i.scale?h.Cartesian2.unpack(i==null?void 0:i.scale):new h.Cartesian2(1,1);return s=-s,n=new h.Matrix3(Math.cos(s)*r.x,-Math.sin(s)*r.y,o.x,Math.sin(s)*r.x,Math.cos(s)*r.y,o.y,0,0,1),h.Resource.createIfNeeded(i.value).fetchImage().then(l=>{if(!t)return;const c=Du(t.scene.context,l,{flipY:!1,minificationFilter:e==null?void 0:e.minFilter,magnificationFilter:e==null?void 0:e.magFilter}),u=new h.ModelComponents.TextureReader;return u.index=0,u.texture=c,u.texCoord=0,u.scale=void 0,u.transform=n,u.channels=void 0,u})}function x1(t){if(!t.url)return;const[i,e,n,o]=t.rectangle;return`(async ()=>{
|
|
68
68
|
var terrainProvider = await Cesium.CesiumTerrainProvider.fromUrl(
|
|
69
69
|
${E1(typeof t.url=="object"?t.url.url:t.url)}
|
|
70
70
|
);
|
|
71
71
|
viewer.terrainProvider = terrainProvider;
|
|
72
72
|
viewer.camera.flyTo({
|
|
73
|
-
destination: Cesium.Rectangle.fromDegrees(
|
|
73
|
+
destination: Cesium.Rectangle.fromDegrees(${i}, ${e}, ${n}, ${o})
|
|
74
74
|
});
|
|
75
|
-
})()`}function E1(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=`Cesium.IonResource.fromAssetId(${n})`)}else i=`'${a.ESSceneObject.context.getStrFromEnv(t)}'`;return i}function A1(t){if(!t.url)return;const i=a.ESSceneObject.context.getStrFromEnv(typeof t.url=="string"?t.url:t.url.url),e=[];
|
|
76
|
-
var imageryProvider = new Cesium.${
|
|
77
|
-
${e.map(
|
|
75
|
+
})()`}function E1(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=`Cesium.IonResource.fromAssetId(${n})`)}else i=`'${a.ESSceneObject.context.getStrFromEnv(t).replace("/layer.json","")}'`;return i}function A1(t){if(!t.url)return;const i=a.ESSceneObject.context.getStrFromEnv(typeof t.url=="string"?t.url:t.url.url),e=[];e.push(`url: '${i}'`);const n=i.endsWith(".xml")?"TileMapServiceImageryProvider":"UrlTemplateImageryProvider",[o,s,r,l]=t.rectangle??[-180,-90,180,90];return`
|
|
76
|
+
var imageryProvider = new Cesium.${n}({
|
|
77
|
+
${e.map(u=>`${u}`).join(`,
|
|
78
78
|
`)}
|
|
79
79
|
});
|
|
80
80
|
viewer.imageryLayers.addImageryProvider(imageryProvider);
|
|
81
81
|
viewer.camera.flyTo({
|
|
82
|
-
destination: Cesium.Rectangle.fromDegrees(
|
|
82
|
+
destination: Cesium.Rectangle.fromDegrees(${o}, ${s}, ${r}, ${l})
|
|
83
83
|
});`}function T1(t){var s,r;if(!t.url)return;const i=M1(t.url),e=(s=t.activeViewer)==null?void 0:s.getEngineObject(t);e||console.warn("未找到Czm3DTileset,请确保Czm3DTileset已加载");const n=(e&&((r=e.czm3DTiles.tileset)==null?void 0:r.modelMatrix))??h.Matrix4.IDENTITY,o=h.Matrix4.toArray(n);return` (async function () {
|
|
84
84
|
var tileset = await Cesium.Cesium3DTileset.fromUrl(
|
|
85
85
|
${i},
|
|
@@ -1420,7 +1420,7 @@ ${Fy}
|
|
|
1420
1420
|
out_FragColor.rgb *= vec3(clamp((distance - realDistance)*.5, 0.5, 1.0));
|
|
1421
1421
|
out_FragColor.a = 0.9;
|
|
1422
1422
|
}
|
|
1423
|
-
`;{const d=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),p=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??a.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??a.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},xc[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};p(),this.d(d.don(p))}{const d=f=>{if(f==0||!this.isTimestamp(f))return;const g=e.getAllMoments(),v=e.getSubmergingData;if(g.length==0||!v)return;const y=this.getClosestTimestampIndex(f,g);s.attributes={position:{typedArray:v[y].posBuffer,componentsPerAttribute:3}},s.indexTypedArray=v[y].indicesBuffer;const w=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!w)return;const{min:P,max:_}=w;s.setLocalAxisedBoundingBox(P,_)},p=this.dv(a.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(p.don(()=>{d(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:n,sceneObject:o,heightMapTexture:s,normalMapTexture:r,foamTexture:l,causticsTexture:c}=this,u=o.materialParams[Object.keys(o.materialParams).filter(d=>d.toUpperCase().includes("BASECOLOR"))[0]];n.uniformMap={u_image:{type:"texture",id:s.id},u_heightmap_image:{type:"texture",id:s.id},u_normalmap_image:{type:"texture",id:r.id},u_foam_image:{type:"texture",id:l.id},u_caustics_image:{type:"texture",id:c.id},u_color:e.waterColor??u??a.ESSubmergingAnalysis.defaults.waterColor}}};m(nl,"type",nl.register("ESCesiumViewer",a.ESSubmergingAnalysis.type,nl));let _p=nl;const{getStrFromEnv:By}=a.ESSceneObject.context;function sT(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=h.IonResource.fromAssetId(n))}else i=By(t);return i}async function rT(t,i){if(t.type==="EllipsoidTerrainProvider")return new h.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tilingScheme:t.tilingScheme&&di(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=sT(typeof t.url=="string"?t.url:t.url.url);return e?await h.CesiumTerrainProvider.fromUrl(typeof e=="string"?$t(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await h.GoogleEarthEnterpriseMetadata.fromUrl(By(t.url));return await h.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await h.ArcGISTiledElevationTerrainProvider.fromUrl($t(t.url),{token:t.token,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new h.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await h.VRTheWorldTerrainProvider.fromUrl($t(t.url),{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}}const ol=class ol extends jt{constructor(e,n){super(e,n);m(this,"_provider",this.disposeVar(a.react(void 0)));m(this,"_czmProvider",this.dv(a.react(void 0)));const o=n.viewer;if(!o)return;const s=Ke(o);if(!s)return;const{terrainManager:r}=s,l=()=>{r.delete(this),this.provider=void 0};this.dispose(l);let c=!1;const u=this.disposeVar(a.createProcessingFromAsyncFunc(async(p,f)=>{if(f){if(c=!0,l(),!this.czmProvider)return;this.provider=await p.promise(rT(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),r.add(this),c=!1}}));u.restart(void 0,!0);const d=this.disposeVar(new a.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{d.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{d.emit()})),this.dispose(d.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{c||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((p,f)=>this.flyTo(p,f)));{const p=this.ad(a.reactJson(""));{const g=()=>{if(typeof e.url=="string")p.value=a.ESSceneObject.context.getStrFromEnv(e.url??a.ESTerrainLayer.defaults.url);else{const v=e.url;v.url=a.ESSceneObject.context.getStrFromEnv(v.url??a.ESTerrainLayer.defaults.url),p.value=v}};g(),this.ad(e.urlChanged.don(g))}const f=()=>{if(!p.value)return;let g=p.value,v=typeof g=="string"?g:g.url;if(v.includes(a.ESTerrainLayer.defaults.url)){const y=aT(v);if(y&&y.h){const w=Number(y.h),P={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[P.x+w,P.y+w,P.z+w]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else v.includes("/layer.json")&&(typeof g=="string"?g=v.split("/layer.json").join(""):g.url=v.split("/layer.json").join("")),this._czmProvider.value={type:"CesiumTerrainProvider",url:g,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(p.changed.disposableOn(f))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,n){const{czmViewer:o,sceneObject:s}=this;if(!o.actived)return!1;const{viewer:r}=o;return r?(s.rectangle&&!_u(s.rectangle)?r.camera.flyTo({destination:Ve(s.rectangle),duration:e}):r.camera.flyHome(e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?super.flyIn(e,n):this.flyTo(e,n):!1}};m(ol,"type",ol.register("ESCesiumViewer",a.ESTerrainLayer.type,ol));let Pp=ol;function aT(t){const i=t.indexOf("?"),n=t.slice(i+1).split("&"),o={};for(var s=0;s<n.length;s++){var r=n[s].split("=");o[r[0]]=r[1]}return o}class Vy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"flyTo",(e,n)=>{if(this.czmTextLabel.position){ne(this.czmViewer.viewer,this.czmTextLabel.position,1e3,ei,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id));const o=this._czmTextLabel,s=()=>{const l=e.anchor,c=e.offset;l?o.originRatioAndOffset=[...l,-c[0],-c[1]]:o.originRatioAndOffset=[0,0,0,0]},r=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(r.disposableOn(()=>s())),s(),this.dispose(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"text"],[e,"text"])),this.dispose(a.track([o,"color"],[e,"color"])),this.dispose(a.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.dispose(a.track([o,"width"],[e,"width"])),this.dispose(a.track([o,"opacity"],[e,"opacity"])),this.dispose(a.track([o,"padding"],[e,"padding"])),this.dispose(a.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([o,"borderColor"],[e,"borderColor"])),this.dispose(a.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([o,"textAlign"],[e,"textAlign"])),this.dispose(a.track([o,"fontSize"],[e,"fontSize"])),this.dispose(a.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(a.track([o,"pickOnClick"],[e,"allowPicking"]));{const l=()=>{o.scale=[e.scale[1],e.scale[2]]};l(),this.dispose(e.scaleChanged.don(l))}{const l=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};l(),this.dispose(e.sizeByContentChanged.don(l)),this.dispose(e.sizeChanged.don(l))}this.d(o.pickedEvent.don(l=>{var d;const c=(d=co(l,"pickResult"))==null?void 0:d.pointerEvent;if(!c)return;const u={type:c.buttons!=0&&c.button==0?"leftClick":c.button==2?"rightClick":void 0,add:{mousePos:[c.offsetX,c.offsetY]}};u.type==null&&(u.type=c.type),e.widgetEvent.emit(u)}));{let l;const c=u=>{u&&(l=u),l&&(l.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>c(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>c(u)))}}get czmTextLabel(){return this._czmTextLabel}}class Uy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"_czmImageModel");m(this,"_url",this.disposeVar(a.react("")));m(this,"_defaultSize",this.disposeVar(a.react([1,1])));m(this,"_size",this.disposeVar(a.react([1,1])));m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmImageModel.position)return qt(this._czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id)),this._czmImageModel=this.disposeVar(new qi(n,e.id));const o=this._czmViewer,s=this._czmTextLabel;s.originRatioAndOffset=[1e3,0,0,0],this.dispose(s.divCreatedEvent.disposableOn(c=>{const u=setTimeout(()=>{jh(c,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{if(clearTimeout(u),this.isDestroyed())return;const p=new Image;p.onload=()=>{e.sizeByContent?this._size.value=[p.width/100,p.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},p.src=d.toDataURL("image/png"),this._url.value=d.toDataURL("image/png")}).catch(d=>{clearTimeout(u),console.error(d)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"fontSize"],[e,"fontSize"]));const r=()=>{const c=e.anchor,u=e.offset;c?this.czmImageModel.originRatioAndOffset=[...c,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r();{const c=()=>{this._czmTextLabel.show=!1;const u=this._czmImageModel;u.uri=this._url.value,u.pixelSize=void 0,u.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{u.size=this._size.value})),this.dispose(a.track([u,"show"],[e,"show"])),this.dispose(a.bind([u,"position"],[e,"position"])),this.dispose(a.track([u,"allowPicking"],[e,"allowPicking"]));{const d=()=>{u.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(je([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}};this.dispose(this._url.changed.disposableOn(c))}this.ad(o.clickEvent.don(c=>{const u=c==null?void 0:c.pointerEvent;u&&(this._isPointEvent=!0,this._eventInfo={type:u.button==0?"leftClick":u.button==2?"rightClick":"leftClick",add:{mousePos:[u.offsetX,u.offsetY]}})})),this.d(e.pickedEvent.don(c=>{var u,d,p;c.screenPosition&&this._isPointEvent&&c.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(c.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(c.screenPosition[1]-((p=this._eventInfo.add)==null?void 0:p.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const c=o.getEngineObject(e);this.ad(c.lastHoverResultChanged.don((u,d)=>{(u==null?void 0:u.sceneObject)==(d==null?void 0:d.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const sl=class sl extends Hr{constructor(e,n){super(e,n);m(this,"_event",this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));m(this,"_resetting",this.disposeVar(new a.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new Vy(this.sceneObject,this.czmViewer):new Uy(this.sceneObject,this.czmViewer))));if(!n.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(sl,"type",sl.register("ESCesiumViewer",a.ESTextLabel.type,sl));let bp=sl;const rl=class rl extends me{constructor(e,n){super(e,n);m(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new uo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoDivSwitchPoi;s.showIcon=!1,this.d(a.track([s,"zOrder"],[e,"zOrder"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"text"],[e,"info"],c=>Object.values(c??{title:"请输入内容"}).join())),this.dispose(a.bind([s,"position"],[e,"position"]));const r=()=>{const c=e.anchor,u=e.offset;c?s.originRatioAndOffset=[...c,-u[0],-u[1]]:s.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoDivSwitchPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.position?(ne(this.czmViewer.viewer,r.position,1e3,ei,e),!0):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(rl,"type",rl.register("ESCesiumViewer",a.ESUEWidget.type,rl));let Sp=rl;const al=class al extends me{constructor(e,n){super(e,n);m(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(al,"type",al.register("ESCesiumViewer",a.ESUnrealActor.type,al));let xp=al;var lT=h.Primitive._modifyShaderPosition;h.Primitive._modifyShaderPosition=function(t,n,e){var n=lT(t,n,e);return t.isCameraVideo&&n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n=n.replace("void main()",`
|
|
1423
|
+
`;{const d=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),p=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??a.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??a.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},xc[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};p(),this.d(d.don(p))}{const d=f=>{if(f==0||!this.isTimestamp(f))return;const g=e.getAllMoments(),v=e.getSubmergingData;if(g.length==0||!v)return;const y=this.getClosestTimestampIndex(f,g);s.attributes={position:{typedArray:v[y].posBuffer,componentsPerAttribute:3}},s.indexTypedArray=v[y].indicesBuffer;const w=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!w)return;const{min:P,max:_}=w;s.setLocalAxisedBoundingBox(P,_)},p=this.dv(a.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(p.don(()=>{d(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:n,sceneObject:o,heightMapTexture:s,normalMapTexture:r,foamTexture:l,causticsTexture:c}=this,u=o.materialParams[Object.keys(o.materialParams).filter(d=>d.toUpperCase().includes("BASECOLOR"))[0]];n.uniformMap={u_image:{type:"texture",id:s.id},u_heightmap_image:{type:"texture",id:s.id},u_normalmap_image:{type:"texture",id:r.id},u_foam_image:{type:"texture",id:l.id},u_caustics_image:{type:"texture",id:c.id},u_color:e.waterColor??u??a.ESSubmergingAnalysis.defaults.waterColor}}};m(nl,"type",nl.register("ESCesiumViewer",a.ESSubmergingAnalysis.type,nl));let _p=nl;const{getStrFromEnv:By}=a.ESSceneObject.context;function sT(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=h.IonResource.fromAssetId(n))}else i=By(t);return i}async function rT(t,i){if(t.type==="EllipsoidTerrainProvider")return new h.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tilingScheme:t.tilingScheme&&di(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=sT(typeof t.url=="string"?t.url:t.url.url);return e?await h.CesiumTerrainProvider.fromUrl(typeof e=="string"?$t(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await h.GoogleEarthEnterpriseMetadata.fromUrl(By(t.url));return await h.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await h.ArcGISTiledElevationTerrainProvider.fromUrl($t(t.url),{token:t.token,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new h.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await h.VRTheWorldTerrainProvider.fromUrl($t(t.url),{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}}const ol=class ol extends jt{constructor(e,n){super(e,n);m(this,"_provider",this.disposeVar(a.react(void 0)));m(this,"_czmProvider",this.dv(a.react(void 0)));const o=n.viewer;if(!o)return;const s=Ke(o);if(!s)return;const{terrainManager:r}=s,l=()=>{r.delete(this),this.provider=void 0};this.dispose(l);let c=!1;const u=this.disposeVar(a.createProcessingFromAsyncFunc(async(p,f)=>{if(f){if(c=!0,l(),!this.czmProvider)return;this.provider=await p.promise(rT(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),r.add(this),c=!1}}));u.restart(void 0,!0);const d=this.disposeVar(new a.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{d.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{d.emit()})),this.dispose(d.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{c||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((p,f)=>this.flyTo(p,f)));{const p=this.ad(a.reactJson(""));{const g=()=>{if(typeof e.url=="string")p.value=a.ESSceneObject.context.getStrFromEnv(e.url??a.ESTerrainLayer.defaults.url);else{const v=e.url;v.url=a.ESSceneObject.context.getStrFromEnv(v.url??a.ESTerrainLayer.defaults.url),p.value=v}};g(),this.ad(e.urlChanged.don(g))}const f=()=>{if(!p.value)return;let g=p.value,v=typeof g=="string"?g:g.url;if(v.includes(a.ESTerrainLayer.defaults.url)){const y=aT(v);if(y&&y.h){const w=Number(y.h),P={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[P.x+w,P.y+w,P.z+w]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else v.includes("/layer.json")&&(typeof g=="string"?g=v.replace("/layer.json",""):g.url=v.replace("/layer.json","")),this._czmProvider.value={type:"CesiumTerrainProvider",url:g,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(p.changed.disposableOn(f))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,n){const{czmViewer:o,sceneObject:s}=this;if(!o.actived)return!1;const{viewer:r}=o;return r?(s.rectangle&&!_u(s.rectangle)?r.camera.flyTo({destination:Ve(s.rectangle),duration:e}):r.camera.flyHome(e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?super.flyIn(e,n):this.flyTo(e,n):!1}};m(ol,"type",ol.register("ESCesiumViewer",a.ESTerrainLayer.type,ol));let Pp=ol;function aT(t){const i=t.indexOf("?"),n=t.slice(i+1).split("&"),o={};for(var s=0;s<n.length;s++){var r=n[s].split("=");o[r[0]]=r[1]}return o}class Vy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"flyTo",(e,n)=>{if(this.czmTextLabel.position){ne(this.czmViewer.viewer,this.czmTextLabel.position,1e3,ei,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id));const o=this._czmTextLabel,s=()=>{const l=e.anchor,c=e.offset;l?o.originRatioAndOffset=[...l,-c[0],-c[1]]:o.originRatioAndOffset=[0,0,0,0]},r=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(r.disposableOn(()=>s())),s(),this.dispose(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"text"],[e,"text"])),this.dispose(a.track([o,"color"],[e,"color"])),this.dispose(a.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.dispose(a.track([o,"width"],[e,"width"])),this.dispose(a.track([o,"opacity"],[e,"opacity"])),this.dispose(a.track([o,"padding"],[e,"padding"])),this.dispose(a.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([o,"borderColor"],[e,"borderColor"])),this.dispose(a.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([o,"textAlign"],[e,"textAlign"])),this.dispose(a.track([o,"fontSize"],[e,"fontSize"])),this.dispose(a.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(a.track([o,"pickOnClick"],[e,"allowPicking"]));{const l=()=>{o.scale=[e.scale[1],e.scale[2]]};l(),this.dispose(e.scaleChanged.don(l))}{const l=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};l(),this.dispose(e.sizeByContentChanged.don(l)),this.dispose(e.sizeChanged.don(l))}this.d(o.pickedEvent.don(l=>{var d;const c=(d=co(l,"pickResult"))==null?void 0:d.pointerEvent;if(!c)return;const u={type:c.buttons!=0&&c.button==0?"leftClick":c.button==2?"rightClick":void 0,add:{mousePos:[c.offsetX,c.offsetY]}};u.type==null&&(u.type=c.type),e.widgetEvent.emit(u)}));{let l;const c=u=>{u&&(l=u),l&&(l.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>c(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>c(u)))}}get czmTextLabel(){return this._czmTextLabel}}class Uy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"_czmImageModel");m(this,"_url",this.disposeVar(a.react("")));m(this,"_defaultSize",this.disposeVar(a.react([1,1])));m(this,"_size",this.disposeVar(a.react([1,1])));m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmImageModel.position)return qt(this._czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id)),this._czmImageModel=this.disposeVar(new qi(n,e.id));const o=this._czmViewer,s=this._czmTextLabel;s.originRatioAndOffset=[1e3,0,0,0],this.dispose(s.divCreatedEvent.disposableOn(c=>{const u=setTimeout(()=>{jh(c,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{if(clearTimeout(u),this.isDestroyed())return;const p=new Image;p.onload=()=>{e.sizeByContent?this._size.value=[p.width/100,p.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},p.src=d.toDataURL("image/png"),this._url.value=d.toDataURL("image/png")}).catch(d=>{clearTimeout(u),console.error(d)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"fontSize"],[e,"fontSize"]));const r=()=>{const c=e.anchor,u=e.offset;c?this.czmImageModel.originRatioAndOffset=[...c,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r();{const c=()=>{this._czmTextLabel.show=!1;const u=this._czmImageModel;u.uri=this._url.value,u.pixelSize=void 0,u.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{u.size=this._size.value})),this.dispose(a.track([u,"show"],[e,"show"])),this.dispose(a.bind([u,"position"],[e,"position"])),this.dispose(a.track([u,"allowPicking"],[e,"allowPicking"]));{const d=()=>{u.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(je([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}};this.dispose(this._url.changed.disposableOn(c))}this.ad(o.clickEvent.don(c=>{const u=c==null?void 0:c.pointerEvent;u&&(this._isPointEvent=!0,this._eventInfo={type:u.button==0?"leftClick":u.button==2?"rightClick":"leftClick",add:{mousePos:[u.offsetX,u.offsetY]}})})),this.d(e.pickedEvent.don(c=>{var u,d,p;c.screenPosition&&this._isPointEvent&&c.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(c.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(c.screenPosition[1]-((p=this._eventInfo.add)==null?void 0:p.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const c=o.getEngineObject(e);this.ad(c.lastHoverResultChanged.don((u,d)=>{(u==null?void 0:u.sceneObject)==(d==null?void 0:d.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const sl=class sl extends Hr{constructor(e,n){super(e,n);m(this,"_event",this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));m(this,"_resetting",this.disposeVar(new a.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new Vy(this.sceneObject,this.czmViewer):new Uy(this.sceneObject,this.czmViewer))));if(!n.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(sl,"type",sl.register("ESCesiumViewer",a.ESTextLabel.type,sl));let bp=sl;const rl=class rl extends me{constructor(e,n){super(e,n);m(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new uo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoDivSwitchPoi;s.showIcon=!1,this.d(a.track([s,"zOrder"],[e,"zOrder"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"text"],[e,"info"],c=>Object.values(c??{title:"请输入内容"}).join())),this.dispose(a.bind([s,"position"],[e,"position"]));const r=()=>{const c=e.anchor,u=e.offset;c?s.originRatioAndOffset=[...c,-u[0],-u[1]]:s.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoDivSwitchPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.position?(ne(this.czmViewer.viewer,r.position,1e3,ei,e),!0):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(rl,"type",rl.register("ESCesiumViewer",a.ESUEWidget.type,rl));let Sp=rl;const al=class al extends me{constructor(e,n){super(e,n);m(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(al,"type",al.register("ESCesiumViewer",a.ESUnrealActor.type,al));let xp=al;var lT=h.Primitive._modifyShaderPosition;h.Primitive._modifyShaderPosition=function(t,n,e){var n=lT(t,n,e);return t.isCameraVideo&&n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n=n.replace("void main()",`
|
|
1424
1424
|
#ifdef XBSJ_CAMERA_VIDEO
|
|
1425
1425
|
uniform mat4 u_boxMV;
|
|
1426
1426
|
#endif
|
|
@@ -1992,8 +1992,8 @@ return material;
|
|
|
1992
1992
|
material.alpha = fragColor.a;
|
|
1993
1993
|
|
|
1994
1994
|
return material;
|
|
1995
|
-
}`},translucent:!0});function EL(){Object.defineProperties(h.Billboard.prototype,{_positionFromParent:{get(){return!1},set(t){}}})}RF(),FF(),zF(),BF(),VF(),UF(),WF(),DF(),JF(),jF(),tz(),bz(),EL(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function AL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class TL extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=Ke(l);if(c&&(c.destroy(),Ag(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=IF;await l.promise(AL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new XC(d,e);Ag(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const ML=new h.EllipsoidTerrainProvider;class BC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??ML}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class VC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof Ge?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof Ge?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof Ge?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof Ge&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class IL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class DL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class RL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new DL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class FL extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new RL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new IL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new FL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class WC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let A;if(p?A=await v.pickFromRayMostDetailed(P,this.objectsToExclude):A=v.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=se(A.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const O=se(R);return O?(this.pickHeightMustGreaterThanZero&&O[2]<0&&(O[2]=0),f(O)):g(new Error("positionFromCartesian failed"))}}const _=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),_);if(!S)return g(new Error("Pick failed"));const E=se(S);return E?f(E):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var A,R,O,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await zL(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(U=>{w&&(w[U]=y.getProperty(U))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:U}=e.container.getBoundingClientRect();y=(A=document.elementFromPoint(d[0]+V,d[1]+U))==null?void 0:A.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let _=P?a.ESSceneObject.getSceneObject(P):void 0;_&&_.parentID&&(_=a.ESSceneObject.getSceneObject(_.parentID));let S={};if(_&&Reflect.has(_,"allowPicking")&&Reflect.has(_,"pickedEvent")&&(_.allowPicking??!1)){if(_ instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:vr(y.id.position.getValue(V))}:(O=y.id)==null?void 0:O.map(U=>{var z;return{name:U.id,properties:(z=U.properties)==null?void 0:z.getValue(V),coordinates:vr(U.position.getValue(V))}})}else if(_ instanceof a.ESGeoJson){const V=new h.JulianDate;let U,z,N;y.id.entityCollection?(U=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",N=((B=y.id.properties)==null?void 0:B.getValue(V))??{},z=U=="Point"?se(y.id.position.getValue(V)):U=="LineString"?y.id.polyline.positions.getValue(V).map(C=>se(C)):mu(y.id.polygon.hierarchy.getValue(V))):(y.primitive instanceof h.Billboard||y.primitive instanceof h.Label)&&(U="Point",typeof y.id=="object"&&(N=y.id),z=se(y.primitive.position)),S=_.pickedInfoType=="FeatureCollection"||_.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:U,coordinates:z},properties:N}:{type:U,coordinates:z,properties:N}}else if(_ instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}_.pickedEvent.emit(new a.ESJPickedResult(y,_,w,S,f,d))}_&&Reflect.has(_,"allowPicking")&&!_.allowPicking&&g(new a.ESJPickedResult);const E=new a.ESJPickedResult(y,_,w,S,f,d);g(E)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function zL(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class LL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=Ke(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class OL extends a.Destroyable{constructor(){super();m(this,"cache",new Map);m(this,"maxSize",300);m(this,"_deleteTileEvent",this.disposeVar(new a.Event))}get deleteTileEvent(){return this._deleteTileEvent}deleteTile(e,n){this._deleteTileEvent.emit(e,n)}get(e,n){const o=this.cache.get(e);if(!o)return;if(!n)return o;const s=o.get(n);return s&&(o.delete(n),o.set(n,s)),s}set(e,n,o){let s=this.get(e);if(s||(s=new Map,this.cache.set(e,s)),s.set(n,o),s.size>=this.maxSize){const r=s.keys().next().value;r&&this.remove(e,r)}}remove(e,n){const o=e instanceof bh?e.sceneObject.id:e;let s=this.get(o);s&&(n?(s.delete(n),s.size===0&&this.cache.delete(o)):this.cache.delete(o),this.deleteTile(o,n))}}class NL extends a.Destroyable{constructor(){super();m(this,"pendingRequests",new Map);m(this,"sourcesMap",new Map);m(this,"tileSchemes",new Map)}add(e){const n=e.sceneObject.id,o=e.mvtLayerJson.mainJson,s=e.sceneObject.scheme??"xyz";let r=this.sourcesMap.get(n),l=this.tileSchemes.get(n);if(r||(r=new Map,this.sourcesMap.set(n,r)),(!l||s!=l)&&this.tileSchemes.set(n,s),typeof o=="string")r.set("customSource",{tiles:[o],type:"vector"});else if(typeof o=="object"){const c=o.sources;for(const u in c){const d=c[u];d.type==="vector"&&Reflect.has(d,"tiles")&&r.set(u,d)}}}remove(e){const n=e.sceneObject.id;this.sourcesMap.delete(n),this.tileSchemes.delete(n),this.pendingRequests.delete(n)}async fetchTile(e,n){var p,f,g,v,y;if((p=this.pendingRequests.get(e))!=null&&p.has(n))return;(f=this.pendingRequests.get(e))==null||f.add(n);const[o,s,r]=n.split("-").map(Number),c=this.tileSchemes.get(e)==="tms"?Math.pow(2,o)-r-1:r,u={tileKey:n,sources:new Map},d=this.sourcesMap.get(e);if(!d)return u;for(const[w,P]of d.entries()){if(u.sources.has(w)||u.sources.set(w,new Map),!P.tiles.length||!P.tiles[0].includes("{z}")||P.maxzoom&&o>P.maxzoom||P.minzoom&&o<P.minzoom)continue;const _=P.tiles[0].replace("{z}",o.toString()).replace("{x}",s.toString()).replace("{y}",c.toString());try{const S=await we.Resource.fetchArrayBuffer({url:_});if(!S)continue;const E=new m_(S),A=new v_.VectorTile(E);for(const R in A.layers)if(Object.prototype.hasOwnProperty.call(A.layers,R)){const O=A.layers[R],B=[];for(let V=0;V<O.length;V++){const U=O.feature(V);B.push(U.toGeoJSON(s,r,o))}(g=u.sources.get(w))==null||g.set(R,B)}}catch(S){console.error(`Failed to load tile ${n}:`,S)}}return(v=this.pendingRequests.get(e))==null||v.delete(n),((y=this.pendingRequests.get(e))==null?void 0:y.size)===0&&this.pendingRequests.delete(e),u}}class BL extends a.Destroyable{constructor(e,n){super();m(this,"renderedTiles",new Map);this.screenManager=e,this.styleManager=n}renderTile(e,n){var l;const o=[],s=this.styleManager.getStyle(e);if(!s)return;for(const c of s){if(c.maxzoom||c.minzoom){const u=Number.parseInt(n.tileKey.split("-")[0]);if(c.maxzoom&&u>c.maxzoom||c.minzoom&&u<c.minzoom)continue}for(const u of((l=n.sources.get(c.source))==null?void 0:l.get(c["source-layer"]??""))||[]){let d=u.geometry.coordinates;u.geometry.type.includes("Point")||(d=BM(u.geometry).geometry.coordinates);let p,f;c.labelStyle&&(p=this.screenManager.addLabel(e,"VectorTile",c.labelStyle,{position:d,name:u.properties[c.labelStyle.text[1]],index:c.id+u.properties.osm_id}).screenObjectId),c.billboardStyle&&(f=this.screenManager.addImage(e,"VectorTile",c.billboardStyle,{position:d,name:u.properties.NAME??u.properties.name,index:c.id+u.properties.osm_id}).screenObjectId),p&&o.push(p),f&&o.push(f)}}let r=this.renderedTiles.get(e);r||(r=new Map,this.renderedTiles.set(e,r)),r.set(n.tileKey,o)}update(e,n,o){var s;if(typeof n=="string"){const r=(s=this.renderedTiles.get(e))==null?void 0:s.get(n);r&&this.screenManager.update("VectorTile",e,r,{all:{show:o}})}else this.screenManager.update("VectorTile",e,n,{all:{show:o}})}remove(e,n){const o=this.renderedTiles.get(e);if(n){const s=o==null?void 0:o.get(n);s&&(this.screenManager.remove("VectorTile",e,s),o==null||o.delete(n),(o==null?void 0:o.size)===0&&this.renderedTiles.delete(e))}else{const s=o==null?void 0:o.values();s&&(this.screenManager.remove("VectorTile",e,Array.from(s).flat()),this.renderedTiles.delete(e))}}removeAll(){const e=this.renderedTiles.keys();for(const n of e)this.remove(n)}}class VL extends a.Destroyable{constructor(){super();m(this,"defaultStyle",new Map)}add(e){const n=e.mvtLayerJson.pointJson;for(const o of n)this.setDefaultStyle(e.sceneObject.id,UL(o))}remove(e){this.defaultStyle.delete(e.sceneObject.id)}setDefaultStyle(e,n){let o=this.defaultStyle.get(e);o||(o=new Set,this.defaultStyle.set(e,o)),o.add(n)}getStyle(e){return this.defaultStyle.get(e)??new Set}}function UL(t){const i={id:t.id,type:t.type,source:t.source,"source-layer":t["source-layer"],labelStyle:void 0,billboardStyle:void 0,polygonStyle:void 0,polylineStyle:void 0};if(Reflect.has(t,"minzoom")&&(i.minzoom=t.minzoom),Reflect.has(t,"maxzoom")&&(i.maxzoom=t.maxzoom),Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const e=t.layout;if(Reflect.has(e,"icon-image")){const n=i.billboardStyle={};n.image=e["icon-image"];const{horizontalOrigin:o,verticalOrigin:s}=GC(e["icon-anchor"]??"center");if(n.horizontalOrigin=o,n.verticalOrigin=s,Reflect.has(t,"paint")){const r=t.paint;n.color=h.Color.fromCssColorString(r["icon-color"]??"#FF0000").withAlpha(r["icon-opacity"]??1)}n.rotation=h.Math.toRadians(e["icon-rotate"]??0),n.scale=e["icon-size"]??1,n.show=(e.visibility??"visible")==="visible"}if(Reflect.has(e,"text-field")){const n=i.labelStyle={};n.text=e["text-field"];const{horizontalOrigin:o,verticalOrigin:s}=GC(e["text-anchor"]??"center");if(n.horizontalOrigin=o,n.verticalOrigin=s,Reflect.has(t,"paint")){const r=t.paint;n.fillColor=h.Color.fromCssColorString(r["text-color"]??"#FFFFFF").withAlpha(r["text-opacity"]??1)}n.font=`${e["text-size"]??16}px ${e["text-font"]??"sans-serif"}`,n.show=(e.visibility??"visible")==="visible"}}return i}function GC(t){let i=h.HorizontalOrigin.CENTER,e=h.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":i=h.HorizontalOrigin.LEFT;break;case"right":i=h.HorizontalOrigin.RIGHT;break;case"top":e=h.VerticalOrigin.BOTTOM;break;case"bottom":e=h.VerticalOrigin.TOP;break;case"top-left":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"top-right":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.BOTTOM;break;case"bottom-left":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"bottom-right":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.TOP;break}return{horizontalOrigin:i,verticalOrigin:e}}class WL extends a.Destroyable{constructor(){super();m(this,"callbacks",new Map)}registerEvent(e,n,o){var r;const s=`${e}-${n}`;this.callbacks.has(s)||this.callbacks.set(s,[]),(r=this.callbacks.get(s))==null||r.push(o)}dispatchEvent(e){var o;const n=`${e.tileKey}-${e.type}`;(o=this.callbacks.get(n))==null||o.forEach(s=>s(e.data))}}class GL extends a.Destroyable{constructor(e){super();m(this,"czmESMVTLayers",new Map);m(this,"tilesCache",new OL);m(this,"tileLoader",new NL);m(this,"tileRenderer");m(this,"styleManager",new VL);m(this,"eventManager",new WL);m(this,"lastImageryTileMap",new Map);this.viewer=e;const n=Ke(e);n&&(this.tileRenderer=new BL(n.screenManager,this.styleManager)),this.ad(this.tilesCache.deleteTileEvent.don((s,r)=>{this.tileRenderer.remove(s,r)}));const o=e.scene.preUpdate.addEventListener(()=>this.czmESMVTLayers.size>0&&this.refreshVisibleTiles());this.ad(()=>o&&o())}add(e){if(this.czmESMVTLayers.has(e.sceneObject.id)){console.log(`ESMVTLayer${e.sceneObject.id}已经添加过,跳过本次添加`);return}this.czmESMVTLayers.set(e.sceneObject.id,e),this.tileLoader.add(e),this.styleManager.add(e)}remove(e){this.czmESMVTLayers.delete(e.sceneObject.id),this.tileLoader.remove(e),this.styleManager.remove(e),this.tilesCache.remove(e)}refreshVisibleTiles(){const e=this.viewer;if(!e)return;const n=new Map;for(const[o,s]of this.czmESMVTLayers.entries()){if(!s)continue;const r={tilingScheme:{type:"WebMercatorTilingScheme"},rectangle:s.sceneObject.rectangle,tileHeight:s.sceneObject.tileSize,tileWidth:s.sceneObject.tileSize,maximumLevel:s.sceneObject.maximumLevel,minimumLevel:s.sceneObject.minimumLevel};!n.has(o)&&n.set(o,new Set(vm(e.scene.globe._surface._tilesToRender,e.scene.terrainProvider,r).map(l=>`${l.level}-${l.x}-${l.y}`)))}this.updateTiles(n)}updateTiles(e){var n,o;for(const s of this.czmESMVTLayers.keys()){const r=e.get(s)??new Set,l=this.lastImageryTileMap.get(s);if(l&&HL(r,l))continue;this.lastImageryTileMap.set(s,r);const c=new Set(((n=this.tilesCache.get(s))==null?void 0:n.keys())??[]),u=new Set,d=new Set;for(const p of c){const f=(o=this.tileRenderer.renderedTiles.get(s))==null?void 0:o.get(p);if(f)if(r.has(p))for(const g of f)u.add(g);else for(const g of f)d.add(g)}for(const p of u)d.delete(p);this.tileRenderer.update(s,Array.from(d),!1),this.tileRenderer.update(s,Array.from(u),!0);for(const p of r)c.has(p)||(this.tilesCache.set(s,p,void 0),this.tileLoader.fetchTile(s,p).then(f=>{f&&(this.tilesCache.set(s,p,f),this.tileRenderer.renderTile(s,f))}))}}}function HL(t,i){if(t.size!==i.size)return!1;for(const e of t)if(!i.has(e))return!1;return!0}const HC=["label","billboard","rectangle"];class $L extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"labelRefCount",1);m(this,"billboardRefCount",1);m(this,"rectangleRefCount",1);m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e)}}class qL extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(l.label)return l.labelRefCount++,this.update(e,{label:n}),s;const c=this.screenManager.labelCollection.add({...n,position:r,id:o.properties??s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(l.billboard)return l.billboardRefCount++,this.update(e,{billboard:n}),s;const c=this.screenManager.billboardCollection.add({...n,position:r,id:o.properties??s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Se(o.position),c=this.getOrCreateObject(r,l);if(c.rectangle)return c.rectangleRefCount++,this.update(e,{rectangle:n}),r;const u=this.screenManager.rectangleCollection.add({...a.getElementBounds(n.element),...n,id:o.properties??r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Array.isArray(e)?e:[e];for(const s of o){const r=this.objects.get(s);if(r)for(const l of HC){const c=Object.assign({},n[l],(n==null?void 0:n.all)??{});if(!c)continue;const u=r[l];if(u)for(const d in c)d!=="position"&&d!=="id"&&(u[d]=c[d])}}return!0}remove(e){const n=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(n)){for(const o of n){const s=this.objects.get(o);s&&(s.label&&(s.labelRefCount>1?s.labelRefCount--:(this.screenManager.labelCollection.remove(s.label),s.label=void 0)),s.billboard&&(s.billboardRefCount>1?s.billboardRefCount--:(this.screenManager.billboardCollection.remove(s.billboard),s.billboard=void 0)),s.rectangle&&(s.rectangleRefCount>1?s.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(s.rectangle),s.rectangle=void 0)),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(n)){const s=Array.isArray(n[o])?n[o]:[n[o]];for(const r of s){if(!r)continue;const l=this.objects.get(r);if(l){if(l[`${o}RefCount`]>1)l[`${o}RefCount`]--;else{const c=l[o];c&&(this.screenManager.collectionMap[o].remove(c),l[o]=void 0)}this.tryDeleteEmpty(r)}}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new $L(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function XL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&HC.includes(n)){const o=i[n];if(!o)continue;let s,r,l,c;if(o instanceof h.Label||o instanceof h.Billboard){const u=o.computeScreenSpacePosition(t.scene);({x:s,y:r,width:l,height:c}=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,u))}else({x:s,y:r,width:l,height:c}=o);if(isNaN(s)||isNaN(r)||isNaN(l)||isNaN(c))continue;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],r),e[2]=Math.max(e[2],s+l),e[3]=Math.max(e[3],r+c)}return new h.Rectangle(...e)}class YL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"enable",!1);m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,n){this.enable=(e==null?void 0:e.enabled)??!1,n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;if(o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6))r=o.rect,this.rectangleCollisionCheck.remove(n,r);else{if(r=XL(this.screenManager.viewer,e),isNaN(r.width)||isNaN(r.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class $C extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class qC extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new $C));m(this,"canvasCollection",this.ad(new $C));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new YL(this)),this.labelCollection=new h.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new h.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(n=>n.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new qL(this),this.layers.set(e,n),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return!o||o.length===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o){const s=this.getLayer(e);if(!s.remove(o)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!s.layerIsEffective()&&!s.isDestroyed()&&(s.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function Ke(t){return a.getExtProp(t,"_viewerExtensions")}function Ag(t,i){a.setExtProp(t,"_viewerExtensions",i)}class XC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");m(this,"_vectorTIlesManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new BC(this.viewer)),this._labelManager=this.dv(new VC(this.viewer)),this._poiContext=this.disposeVar(new Rm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new LL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new WC(n)),this._screenManager=this.ad(new qC(n)),this._vectorTIlesManager=this.ad(new GL(n.viewer)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}get vectorTIlesManager(){return this._vectorTIlesManager}}var YC=new h.Cartesian3,ZC=new h.Cartesian3;function QC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,YC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,ZC);else var c=h.Cartesian3.cross(t.up,r,ZC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,YC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function kC(t,i){QC(t,i,!1)}function KC(t,i){QC(t,-i,!0)}class ZL extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&kC(s,d*p),r.MoveBackword&&kC(s,-d*p),r.MoveLeft&&KC(s,-d*p),r.MoveRight&&KC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class $h extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
|
|
1996
|
-
`))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=$h.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=$h.getKeyId(s);this._currentKeyIds.has(r)&&(this._currentKeyIds.delete(r),this._currentKeyIdsChanged.emit())};this.d(n.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(n.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class QL extends a.Destroyable{constructor(e){super();m(this,"_keyStatus");m(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new $h(this)),this._cameraOp=this.dv(new ZL(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const Kh=class Kh extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"_keyStatusMap",this.dv(a.react(Kh.defaultKeyStatusMap)));m(this,"_speed",this.dv(a.react(1)));m(this,"_rotateSpeed",this.dv(a.react(.01)));m(this,"_alwaysWithCamera",this.dv(a.react(!1)));m(this,"_keyDownEvent",this.dv(new a.Event));m(this,"_keyUpEvent",this.dv(new a.Event));m(this,"_abortEvent",this.dv(new a.Event));this._firstPersonController=e,this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new QL(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};m(Kh,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let qh=Kh;function kL(t,i){t.lookRight(h.Math.toRadians(i.movementX)*.1),t.lookDown(h.Math.toRadians(i.movementY)*.1);const e=t.pitch,n=h.Math.clamp(e,-h.Math.PI_OVER_TWO,h.Math.PI_OVER_TWO);n!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:n,roll:t.roll}})}class KL extends a.Destroyable{constructor(i,e){super(),this._firstPersonController=i,this._mouseCameraController=e;const{canvas:n}=this._firstPersonController.viewer;{const o=s=>{const{camera:r}=this._firstPersonController.viewer.scene;kL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const Jh=class Jh extends a.Destroyable{constructor(e){super();m(this,"_mouseMoving",this.dv(new KL(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:n}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Jh.origin_setPointerCapture);const o=n.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const s=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",s,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",s,!1))}{const s=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",s)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};m(Jh,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Tg=Jh;class JL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});m(this,"_mouseResetting",this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Tg(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class jL extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"_mouseCameraController",this.dv(new JL(this)));m(this,"_keyboardCameraController",this.dv(new qh(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function JC(t){t.removeInputAction(h.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(h.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)}function Mg(t,i,e,n=void 0){const s=t.camera,r=new h.Cartesian2;r.x=i.startPosition.x,r.y=0;const l=new h.Cartesian2;l.x=i.endPosition.x,l.y=0;let c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,p,f;if(!c||!u)return;s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction);let g=h.Cartesian3.dot(p,f);g<1&&(d=Math.acos(g)),d=i.startPosition.x>i.endPosition.x?d:-d;const v=e._horizontalRotationAxis;if(h.defined(n)?s.look(n,-d):h.defined(v)?s.look(v,-d):s.lookLeft(d),r.x=0,r.y=i.startPosition.y,l.x=0,l.y=i.endPosition.y,c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,!(!c||!u))if(s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction),g=h.Cartesian3.dot(p,f),g<1&&(d=Math.acos(g)),d=i.startPosition.y>i.endPosition.y?d:-d,n=n??v,h.defined(n)){const y=s.direction,w=h.Cartesian3.negate(n,new h.Cartesian3),P=h.Cartesian3.equalsEpsilon(y,n,h.Math.EPSILON2),_=h.Cartesian3.equalsEpsilon(y,w,h.Math.EPSILON2);if(!P&&!_){g=h.Cartesian3.dot(y,n);let S=h.Math.acosClamped(g);d>0&&d>S&&(d=S-h.Math.EPSILON4),g=h.Cartesian3.dot(y,w),S=h.Math.acosClamped(g),d<0&&-d>S&&(d=-S+h.Math.EPSILON4);const E=h.Cartesian3.cross(n,y,new h.Cartesian3);s.look(E,d)}else(P&&d<0||_&&d>0)&&s.look(s.right,-d)}else s.lookUp(d)}class eO extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("viewer is undefined");let o=!0;this.d(i.positionChanged.don(()=>o=!0)),this.d(i.rotationChanged.don(()=>o=!0)),this.d(i.offsetHeightChanged.don(()=>o=!0)),this.d(i.viewDistanceChanged.don(()=>o=!0)),this.d(i.offsetRotationChanged.don(()=>o=!0)),this.d(i.relativeRotationChanged.don(()=>o=!0));const s=[0,0,0],r=[0,0,0];this.d(n.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!i.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(i.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const p=Se(i.position),f=n.camera.positionWC,g=h.Cartesian3.distance(p,f);i.viewDistance=g}a.Vector.clone(i.position,r),i.offsetHeight&&(r[2]+=i.offsetHeight);const{rotation:l,offsetRotation:c=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.defaults.relativeRotation)&&(a.Vector.add(l,s,s),u[0]+=90),a.Vector.add(u,s,s);const d={distance:i.viewDistance,heading:s[0],pitch:s[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(d,r)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;if(c&&i.enabledRotationInput&&(c.buttons===1||c.buttons===2)){const{movementX:u,movementY:d}=c;i.offsetRotation=a.Vector.add(i.offsetRotation??Bi.defaults.offsetRotation,[u*.2,d*-.2,0])}})),this.d(e.wheelEvent.don(l=>{if(!i.enabledScaleInput)return;const c=l.deltaY,d=Math.max(1,i.viewDistance)*(c*.001);i.viewDistance=i.viewDistance+d}))}}class Bi extends a.Destroyable{constructor(e){super();m(this,"_resetWithCameraEvent",this.dv(new a.Event));const n=e.viewer;if(!n)throw new Error("viewer is undefined");const o=this;let s;const r=()=>{s&&(s.destroy(),s=void 0)};this.d(r);const l=()=>{r(),o.enabled&&(s=new eO(o,e))};l(),this.d(o.enabledChanged.don(l)),this.d(o.resetWithCameraEvent.don(c=>{if(!e.actived)return;const u=Jo(n.camera);if(!u)return;const d=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?d[0]:90),u[1]-(o.relativeRotation?d[1]:0),u[2]-(o.relativeRotation?d[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}m(Bi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class pa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");m(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const n=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};n(),this.d(this._geoPolylinePath.currentPositionChanged.don(n)),this.d(this._geoPolylinePath.currentRotationChanged.don(n)),this.dispose(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(a.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(a.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(a.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(a.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(a.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new a.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new tO(this,e);if(this.lineMode==="manual")return new iO(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(pa||(pa={})),a.extendClassProps(pa.prototype,pa.createDefaultProps);class tO extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class iO extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=s=>{(s.key==="w"||s.key==="s")&&(i.polylinePath.playing=s.type==="keydown",i.polylinePath.speed=s.key==="w"||s.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class nO extends a.Destroyable{constructor(i,e){super();const n=e.positionPropertyName??"position",o=e.positionChangedPropertyName??n+"Changed",s=e.rotationPropertyName??"rotation",r=e.rotationChangedPropertyName??s+"Changed",l=(e.positionTracking??!0)&&Reflect.has(i,n)&&Reflect.has(i,o),c=(e.rotationTracking??!0)&&Reflect.has(i,s)&&Reflect.has(i,r);if(!(!l&&!c)){if(l){const u=()=>{e.geoCameraController.position=i[n]};u();const d=i[o];this.d(d.don(u))}if(c){const u=()=>{e.geoCameraController.rotation=i[s]};u();const d=i[o];this.d(d.don(u))}}}}class oO extends a.Destroyable{constructor(i,e){super();const n=this.dv(new a.ESSceneObjectWithId);n.id=i;const o=this.dv(a.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,n.sceneObjectChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{const{sceneObject:s}=n;if(!(!e.enabled||!s))return new nO(s,e)}))}}class fa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new oO(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(fa||(fa={})),a.extendClassProps(fa.prototype,fa.createDefaultProps);class sO extends a.Destroyable{constructor(e){super();m(this,"height",1e7);m(this,"cycle",60);m(this,"latitude",38*3.1415926/18);m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");m(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new h.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},h.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,n=e.positionCartographic;e.flyTo({destination:h.Cartesian3.fromRadians(n.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,r)=>{if(!o){o=new Date().getTime();return}const l=(new Date().getTime()-o)/1e3,c=e.positionCartographic.longitude+l*h.Math.PI*2/this.cycle;e.setView({destination:h.Cartesian3.fromRadians(c,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class rO extends a.Destroyable{constructor(e){super();m(this,"_height",this.dv(a.react(1e7)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_latitude",this.dv(a.react(38)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("未初始化viewer");this._inner=this.dv(new sO(n)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class aO extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_transform");m(this,"_headingRadius");m(this,"_pitchRadius");m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");this._viewer=e;const n=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new h.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const s=()=>{let r;if(this.position==null){var l=o.getPickRay(new h.Cartesian2(n.canvas.width*.5,n.canvas.height*.5));if(!l)return;r=n.globe.pick(l,n)}else r=h.Cartesian3.fromDegrees(...this.position);r&&(this._transform=h.Transforms.eastNorthUpToFixedFrame(r),this.start())};s(),this.d(this.positionChanged.don(s))}{const s=()=>{this._headingRadius=h.Math.toRadians(this.heading)};s(),this.d(this.headingChanged.don(s))}{const s=()=>{this._pitchRadius=h.Math.toRadians(this.pitch)};s(),this.d(this.pitchChanged.don(s))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var n=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),s=new h.Cartesian3(0,n,o);e.flyTo({destination:h.Matrix4.multiplyByPoint(this._transform,s,new h.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let r;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((l,c)=>{if(!r){r=new Date().getTime();return}const u=(new Date().getTime()-r)/1e3;this._headingRadius+=u*h.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new h.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),r=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(h.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class lO extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("viewer is undefined");this._inner=this.dv(new aO(n));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class cO extends a.Destroyable{constructor(e){super();m(this,"_firstPersonController");m(this,"_rotateGlobe");m(this,"_rotatePoint");m(this,"_followController");m(this,"_pathCameraController");m(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new jL(e)),this.d(this._viewer.keyDownEvent.don(n=>this._firstPersonController.keyboardCameraController.keyDown(n))),this.d(this._viewer.keyUpEvent.don(n=>this._firstPersonController.keyboardCameraController.keyUp(n)));{const{subContainer:n}=this._viewer;if(!n)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();n.addEventListener("blur",o,!1),this.d(()=>n.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=qh.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new rO(e)),this._rotatePoint=this.dv(new lO(e)),this._followController=this.dv(new fa(e)),this._pathCameraController=this.dv(new pa(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,n=4.2,o=1.6){this.resetNavigation();const s=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),l=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(c=>{s?this._viewer.flyIn([e[0],e[1],(c??0)+o],l):this._viewer.viewer&&(this._viewer.viewer.camera.position=h.Cartesian3.fromDegrees(e[0],e[1],(c??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,n=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=n,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,n=5e4,o=60,s=0,r=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=n,this._rotatePoint.cycle=o,this._rotatePoint.heading=s,this._rotatePoint.pitch=r,this._rotatePoint.start()}changeToFollow(e,n=0,o=0,s=-30,r=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,s,0],this._followController.geoCameraController.relativeRotation=r,n!==0?this._followController.geoCameraController.viewDistance=n:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,n=10,o=10,s=!0,r=10,l="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const c=l==="auto",u=a.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:d}=u;if(!d)return;const p=a.getDistancesFromPositions(d,"NONE"),f=p[p.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...d],this._pathCameraController.polylinePath.duration=f/n*1e3,this._pathCameraController.polylinePath.loop=s,this._pathCameraController.offsetHeight=o;const g=um(d);this._pathCameraController.polylinePath.rotationRadius=!c||g==!1?[0]:g.map(v=>v/r*n),this._pathCameraController.enabledRotationInput=!c,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=c,this._pathCameraController.lineMode=l,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const n=this._viewer.viewer;if(!n)return;this._handler||(this._handler=new h.ScreenSpaceEventHandler(n.scene.canvas));const o=this._handler,s=n.scene.screenSpaceCameraController;this.d(()=>{o&&JC(o)}),e=="Walk"||e=="RotateGlobe"?(s.lookEventTypes=void 0,s.rotateEventTypes=void 0,s.tiltEventTypes=void 0,s.zoomEventTypes=void 0,s.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&JC(o),s.lookEventTypes=h.CameraEventType.RIGHT_DRAG,s.rotateEventTypes=h.CameraEventType.LEFT_DRAG,s.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],s.translateEventTypes=h.CameraEventType.LEFT_DRAG,s.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}])}}const hO=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class uO extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"cloudsPostProcess");const n=e.viewer;if(!n)throw new Error("Cesium Viewer is not initialized");const o=new h.CloudCollection;n.scene.primitives.add(o),this.dispose(()=>n.scene.primitives.remove(o));{const s=()=>{o.show=this.show};s(),this.dispose(this.showChanged.disposableOn(s))}{const s=l=>({slice:l.slice,brightness:l.brightness,scale:Pe(l.scale),maximumSize:hi(l.maximumSize),color:te(l.color),position:Se(l.position)});(()=>{o.removeAll();for(let l of hO)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ga extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.postProcessStages.add(h.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(n));{const o=()=>{n.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{n.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{n.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{n.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{n.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const dO=`
|
|
1995
|
+
}`},translucent:!0});function EL(){Object.defineProperties(h.Billboard.prototype,{_positionFromParent:{get(){return!1},set(t){}}})}RF(),FF(),zF(),BF(),VF(),UF(),WF(),DF(),JF(),jF(),tz(),bz(),EL(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function AL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class TL extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=Ke(l);if(c&&(c.destroy(),Ag(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=IF;await l.promise(AL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new XC(d,e);Ag(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const ML=new h.EllipsoidTerrainProvider;class BC extends a.Destroyable{constructor(e){super();m(this,"_terrainMap",new Map);m(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));m(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??ML}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class VC extends a.Destroyable{constructor(e){super();m(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof Ge?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof Ge?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof Ge?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof Ge&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class IL extends a.Destroyable{constructor(e){super();m(this,"_czmImageryLayerWrappers",new Set);m(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class DL extends a.Destroyable{constructor(e){super();m(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class RL extends a.Destroyable{constructor(e){super();m(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new DL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class FL extends a.Destroyable{constructor(e,n){super();m(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new RL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class UC extends a.Destroyable{constructor(e){super();m(this,"_czmImageryWrappers",new Set);m(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new IL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new FL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class WC extends a.Destroyable{constructor(e){super();m(this,"_pause",this.disposeVar(a.react(!1)));m(this,"_pickPositionTasks",[]);m(this,"_pickTasks",[]);m(this,"pickHeightMustGreaterThanZero",!0);m(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:v,camera:y}=n,w=Pe(d),P=y.getPickRay(w);if(P){let A;if(p?A=await v.pickFromRayMostDetailed(P,this.objectsToExclude):A=v.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=se(A.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(v.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=v.globe.pick(P,v);if(!R)return g(new Error("scene.globe.pick failed"));const O=se(R);return O?(this.pickHeightMustGreaterThanZero&&O[2]<0&&(O[2]=0),f(O)):g(new Error("positionFromCartesian failed"))}}const _=v.terrainProvider instanceof h.EllipsoidTerrainProvider?v.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(Pe(d),_);if(!S)return g(new Error("Pick failed"));const E=se(S);return E?f(E):g(new Error("positionFromCartesian failed"))})()}catch(v){g(v)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,v]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var A,R,O,B;let y=n.scene.pick(Pe(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await zL(n,Pe(d)));let w;if(y&&y instanceof h.Cesium3DTileFeature){w={};try{y&&y.getPropertyIds().forEach(U=>{w&&(w[U]=y.getProperty(U))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:U}=e.container.getBoundingClientRect();y=(A=document.elementFromPoint(d[0]+V,d[1]+U))==null?void 0:A.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let _=P?a.ESSceneObject.getSceneObject(P):void 0;_&&_.parentID&&(_=a.ESSceneObject.getSceneObject(_.parentID));let S={};if(_&&Reflect.has(_,"allowPicking")&&Reflect.has(_,"pickedEvent")&&(_.allowPicking??!1)){if(_ instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:vr(y.id.position.getValue(V))}:(O=y.id)==null?void 0:O.map(U=>{var z;return{name:U.id,properties:(z=U.properties)==null?void 0:z.getValue(V),coordinates:vr(U.position.getValue(V))}})}else if(_ instanceof a.ESGeoJson){const V=new h.JulianDate;let U,z,N;y.id.entityCollection?(U=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",N=((B=y.id.properties)==null?void 0:B.getValue(V))??{},z=U=="Point"?se(y.id.position.getValue(V)):U=="LineString"?y.id.polyline.positions.getValue(V).map(C=>se(C)):mu(y.id.polygon.hierarchy.getValue(V))):(y.primitive instanceof h.Billboard||y.primitive instanceof h.Label)&&(U="Point",typeof y.id=="object"&&(N=y.id),z=se(y.primitive.position)),S=_.pickedInfoType=="FeatureCollection"||_.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:U,coordinates:z},properties:N}:{type:U,coordinates:z,properties:N}}else if(_ instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}_.pickedEvent.emit(new a.ESJPickedResult(y,_,w,S,f,d))}_&&Reflect.has(_,"allowPicking")&&!_.allowPicking&&g(new a.ESJPickedResult);const E=new a.ESJPickedResult(y,_,w,S,f,d);g(E)})()}catch(y){v(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function zL(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class LL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.disposeVar(a.react(!1)));m(this,"_cursorPosition",a.react(void 0));m(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=Ke(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class OL extends a.Destroyable{constructor(){super();m(this,"cache",new Map);m(this,"maxSize",300);m(this,"_deleteTileEvent",this.disposeVar(new a.Event))}get deleteTileEvent(){return this._deleteTileEvent}deleteTile(e,n){this._deleteTileEvent.emit(e,n)}get(e,n){const o=this.cache.get(e);if(!o)return;if(!n)return o;const s=o.get(n);return s&&(o.delete(n),o.set(n,s)),s}set(e,n,o){let s=this.get(e);if(s||(s=new Map,this.cache.set(e,s)),s.set(n,o),s.size>=this.maxSize){const r=s.keys().next().value;r&&this.remove(e,r)}}remove(e,n){const o=e instanceof bh?e.sceneObject.id:e;let s=this.get(o);s&&(n?(s.delete(n),s.size===0&&this.cache.delete(o)):this.cache.delete(o),this.deleteTile(o,n))}}class NL extends a.Destroyable{constructor(){super();m(this,"pendingRequests",new Map);m(this,"sourcesMap",new Map);m(this,"tileSchemes",new Map)}add(e){const n=e.sceneObject.id,o=e.mvtLayerJson.mainJson,s=e.sceneObject.scheme??"xyz";let r=this.sourcesMap.get(n),l=this.tileSchemes.get(n);if(r||(r=new Map,this.sourcesMap.set(n,r)),(!l||s!=l)&&this.tileSchemes.set(n,s),typeof o=="string")r.set("customSource",{tiles:[o],type:"vector"});else if(typeof o=="object"){const c=o.sources;for(const u in c){const d=c[u];d.type==="vector"&&Reflect.has(d,"tiles")&&r.set(u,d)}}}remove(e){const n=e.sceneObject.id;this.sourcesMap.delete(n),this.tileSchemes.delete(n),this.pendingRequests.delete(n)}async fetchTile(e,n){var p,f,g,v,y;if((p=this.pendingRequests.get(e))!=null&&p.has(n))return;(f=this.pendingRequests.get(e))==null||f.add(n);const[o,s,r]=n.split("-").map(Number),c=this.tileSchemes.get(e)==="tms"?Math.pow(2,o)-r-1:r,u={tileKey:n,sources:new Map},d=this.sourcesMap.get(e);if(!d)return u;for(const[w,P]of d.entries()){if(u.sources.has(w)||u.sources.set(w,new Map),!P.tiles.length||!P.tiles[0].includes("{z}")||P.maxzoom&&o>P.maxzoom||P.minzoom&&o<P.minzoom)continue;const _=P.tiles[0].replace("{z}",o.toString()).replace("{x}",s.toString()).replace("{y}",c.toString());try{const S=await we.Resource.fetchArrayBuffer({url:_});if(!S)continue;const E=new m_(S),A=new v_.VectorTile(E);for(const R in A.layers)if(Object.prototype.hasOwnProperty.call(A.layers,R)){const O=A.layers[R],B=[];for(let V=0;V<O.length;V++){const U=O.feature(V);B.push(U.toGeoJSON(s,r,o))}(g=u.sources.get(w))==null||g.set(R,B)}}catch(S){console.error(`Failed to load tile ${n}:`,S)}}return(v=this.pendingRequests.get(e))==null||v.delete(n),((y=this.pendingRequests.get(e))==null?void 0:y.size)===0&&this.pendingRequests.delete(e),u}}class BL extends a.Destroyable{constructor(e,n){super();m(this,"renderedTiles",new Map);this.screenManager=e,this.styleManager=n}renderTile(e,n){var l;const o=[],s=this.styleManager.getStyle(e);if(!s)return;for(const c of s){if(c.maxzoom||c.minzoom){const u=Number.parseInt(n.tileKey.split("-")[0]);if(c.maxzoom&&u>c.maxzoom||c.minzoom&&u<c.minzoom)continue}for(const u of((l=n.sources.get(c.source))==null?void 0:l.get(c["source-layer"]??""))||[]){let d=u.geometry.coordinates;u.geometry.type.includes("Point")||(d=BM(u.geometry).geometry.coordinates);let p,f;c.labelStyle&&(p=this.screenManager.addLabel(e,"VectorTile",c.labelStyle,{position:d,name:u.properties[c.labelStyle.text[1]],index:c.id+u.properties.osm_id}).screenObjectId),c.billboardStyle&&(f=this.screenManager.addImage(e,"VectorTile",c.billboardStyle,{position:d,name:u.properties.NAME??u.properties.name,index:c.id+u.properties.osm_id}).screenObjectId),p&&o.push(p),f&&o.push(f)}}let r=this.renderedTiles.get(e);r||(r=new Map,this.renderedTiles.set(e,r)),r.set(n.tileKey,o)}update(e,n,o){var s;if(typeof n=="string"){const r=(s=this.renderedTiles.get(e))==null?void 0:s.get(n);r&&this.screenManager.update("VectorTile",e,r,{all:{show:o}})}else this.screenManager.update("VectorTile",e,n,{all:{show:o}})}remove(e,n){const o=this.renderedTiles.get(e);if(n){const s=o==null?void 0:o.get(n);s&&(this.screenManager.remove("VectorTile",e,s),o==null||o.delete(n),(o==null?void 0:o.size)===0&&this.renderedTiles.delete(e))}else{const s=o==null?void 0:o.values();s&&(this.screenManager.remove("VectorTile",e,Array.from(s).flat()),this.renderedTiles.delete(e))}}removeAll(){const e=this.renderedTiles.keys();for(const n of e)this.remove(n)}}class VL extends a.Destroyable{constructor(){super();m(this,"defaultStyle",new Map);m(this,"defaultSprite",new Map)}async add(e){var o;if(typeof e.mvtLayerJson.mainJson!="string"&&((o=e.mvtLayerJson.mainJson)!=null&&o.sprite)){const s=e.mvtLayerJson.mainJson.sprite,r=await h.Resource.fetchJson({url:s+".json"});r&&this.defaultSprite.set(e.sceneObject.id,[s+".png",r])}const n=e.mvtLayerJson.pointJson;for(const s of n)this.setDefaultStyle(e.sceneObject.id,this.getStyleFromMVTLayers(e.sceneObject.id,s))}remove(e){this.defaultStyle.delete(e.sceneObject.id)}setDefaultStyle(e,n){let o=this.defaultStyle.get(e);o||(o=new Set,this.defaultStyle.set(e,o)),o.add(n)}getStyle(e){return this.defaultStyle.get(e)??new Set}getStyleFromMVTLayers(e,n){const o={id:n.id,type:n.type,source:n.source,"source-layer":n["source-layer"],labelStyle:void 0,billboardStyle:void 0,polygonStyle:void 0,polylineStyle:void 0};if(Reflect.has(n,"minzoom")&&(o.minzoom=n.minzoom),Reflect.has(n,"maxzoom")&&(o.maxzoom=n.maxzoom),Reflect.has(n,"type")&&n.type==="symbol"&&Reflect.has(n,"layout")){const s=n.layout;if(Reflect.has(s,"icon-image")){const r=o.billboardStyle={},l=this.defaultSprite.get(e);l&&l[1][s["icon-image"]]?(r.image=l[0],r.imageSubRegion=new h.BoundingRectangle(l[1][s["icon-image"]].x,l[1][s["icon-image"]].y,l[1][s["icon-image"]].width,l[1][s["icon-image"]].height)):r.image=s["icon-image"];const{horizontalOrigin:c,verticalOrigin:u}=GC(s["icon-anchor"]??"center");if(r.horizontalOrigin=c,r.verticalOrigin=u,Reflect.has(n,"paint")){const d=n.paint;r.color=h.Color.fromCssColorString(d["icon-color"]??"#FFFFFF").withAlpha(d["icon-opacity"]??1)}r.rotation=h.Math.toRadians(s["icon-rotate"]??0),r.scale=s["icon-size"]??1,r.show=(s.visibility??"visible")==="visible"}if(Reflect.has(s,"text-field")){const r=o.labelStyle={};r.text=s["text-field"];const{horizontalOrigin:l,verticalOrigin:c}=GC(s["text-anchor"]??"center");if(r.horizontalOrigin=l,r.verticalOrigin=c,Reflect.has(n,"paint")){const u=n.paint;r.fillColor=h.Color.fromCssColorString(u["text-color"]??"#FFFFFF").withAlpha(u["text-opacity"]??1)}r.font=`${s["text-size"]??16}px ${s["text-font"]??"sans-serif"}`,r.show=(s.visibility??"visible")==="visible"}}return o}}function GC(t){let i=h.HorizontalOrigin.CENTER,e=h.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":i=h.HorizontalOrigin.LEFT;break;case"right":i=h.HorizontalOrigin.RIGHT;break;case"top":e=h.VerticalOrigin.BOTTOM;break;case"bottom":e=h.VerticalOrigin.TOP;break;case"top-left":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"top-right":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.BOTTOM;break;case"bottom-left":i=h.HorizontalOrigin.RIGHT,e=h.VerticalOrigin.TOP;break;case"bottom-right":i=h.HorizontalOrigin.LEFT,e=h.VerticalOrigin.TOP;break}return{horizontalOrigin:i,verticalOrigin:e}}class UL extends a.Destroyable{constructor(){super();m(this,"callbacks",new Map)}registerEvent(e,n,o){var r;const s=`${e}-${n}`;this.callbacks.has(s)||this.callbacks.set(s,[]),(r=this.callbacks.get(s))==null||r.push(o)}dispatchEvent(e){var o;const n=`${e.tileKey}-${e.type}`;(o=this.callbacks.get(n))==null||o.forEach(s=>s(e.data))}}class WL extends a.Destroyable{constructor(e){super();m(this,"czmESMVTLayers",new Map);m(this,"tilesCache",new OL);m(this,"tileLoader",new NL);m(this,"tileRenderer");m(this,"styleManager",new VL);m(this,"eventManager",new UL);m(this,"lastImageryTileMap",new Map);this.viewer=e;const n=Ke(e);n&&(this.tileRenderer=new BL(n.screenManager,this.styleManager)),this.ad(this.tilesCache.deleteTileEvent.don((s,r)=>{this.tileRenderer.remove(s,r)}));const o=e.scene.preUpdate.addEventListener(()=>this.czmESMVTLayers.size>0&&this.refreshVisibleTiles());this.ad(()=>o&&o())}add(e){if(this.czmESMVTLayers.has(e.sceneObject.id)){console.log(`ESMVTLayer${e.sceneObject.id}已经添加过,跳过本次添加`);return}this.czmESMVTLayers.set(e.sceneObject.id,e),this.tileLoader.add(e),this.styleManager.add(e)}remove(e){this.czmESMVTLayers.delete(e.sceneObject.id),this.tileLoader.remove(e),this.styleManager.remove(e),this.tilesCache.remove(e)}refreshVisibleTiles(){const e=this.viewer;if(!e)return;const n=new Map;for(const[o,s]of this.czmESMVTLayers.entries()){if(!s)continue;const r={tilingScheme:{type:"WebMercatorTilingScheme"},rectangle:s.sceneObject.rectangle,tileHeight:s.sceneObject.tileSize,tileWidth:s.sceneObject.tileSize,maximumLevel:s.sceneObject.maximumLevel,minimumLevel:s.sceneObject.minimumLevel};!n.has(o)&&n.set(o,new Set(vm(e.scene.globe._surface._tilesToRender,e.scene.terrainProvider,r).map(l=>`${l.level}-${l.x}-${l.y}`)))}this.updateTiles(n)}updateTiles(e){var n,o;for(const s of this.czmESMVTLayers.keys()){const r=e.get(s)??new Set,l=this.lastImageryTileMap.get(s);if(l&&GL(r,l))continue;this.lastImageryTileMap.set(s,r);const c=new Set(((n=this.tilesCache.get(s))==null?void 0:n.keys())??[]),u=new Set,d=new Set;for(const p of c){const f=(o=this.tileRenderer.renderedTiles.get(s))==null?void 0:o.get(p);if(f)if(r.has(p))for(const g of f)u.add(g);else for(const g of f)d.add(g)}for(const p of u)d.delete(p);this.tileRenderer.update(s,Array.from(d),!1),this.tileRenderer.update(s,Array.from(u),!0);for(const p of r)c.has(p)||(this.tilesCache.set(s,p,void 0),this.tileLoader.fetchTile(s,p).then(f=>{f&&(this.tilesCache.set(s,p,f),this.tileRenderer.renderTile(s,f))}))}}}function GL(t,i){if(t.size!==i.size)return!1;for(const e of t)if(!i.has(e))return!1;return!0}const HC=["label","billboard","rectangle"];class HL extends a.Destroyable{constructor(e,n){super();m(this,"id",a.createGuid());m(this,"position",h.Cartesian3.ZERO);m(this,"label");m(this,"billboard");m(this,"rectangle");m(this,"zOrder");m(this,"labelRefCount",1);m(this,"billboardRefCount",1);m(this,"rectangleRefCount",1);m(this,"_showEvent",this.disposeVar(new a.Event));this.id=e,this.position=n,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e)}}class $L extends a.Destroyable{constructor(e){super();m(this,"objects",new Map);m(this,"screenManager");m(this,"czmViewer");m(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(l.label)return l.labelRefCount++,this.update(e,{label:n}),s;const c=this.screenManager.labelCollection.add({...n,position:r,id:o.properties??s,text:o.name});return c.ESSceneObjectID=e,l.label=c,l.zOrder=o.zOrder,s}addImage(e,n,o){const s=this.makeScreenObjectId(e,o.index??a.createGuid()),r=Se(o.position),l=this.getOrCreateObject(s,r);if(l.billboard)return l.billboardRefCount++,this.update(e,{billboard:n}),s;const c=this.screenManager.billboardCollection.add({...n,position:r,id:o.properties??s});return c.ESSceneObjectID=e,l.billboard=c,l.zOrder=o.zOrder,s}addRectangle(e,n,o,s){const r=this.makeScreenObjectId(e,o.index??a.createGuid()),l=Se(o.position),c=this.getOrCreateObject(r,l);if(c.rectangle)return c.rectangleRefCount++,this.update(e,{rectangle:n}),r;const u=this.screenManager.rectangleCollection.add({...a.getElementBounds(n.element),...n,id:o.properties??r,position:l,callback:s});return s(!0),c.rectangle=u,c.zOrder=o.zOrder,r}update(e,n){const o=Array.isArray(e)?e:[e];for(const s of o){const r=this.objects.get(s);if(r)for(const l of HC){const c=Object.assign({},n[l],(n==null?void 0:n.all)??{});if(!c)continue;const u=r[l];if(u)for(const d in c)d!=="position"&&d!=="id"&&(u[d]=c[d])}}return!0}remove(e){const n=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(n)){for(const o of n){const s=this.objects.get(o);s&&(s.label&&(s.labelRefCount>1?s.labelRefCount--:(this.screenManager.labelCollection.remove(s.label),s.label=void 0)),s.billboard&&(s.billboardRefCount>1?s.billboardRefCount--:(this.screenManager.billboardCollection.remove(s.billboard),s.billboard=void 0)),s.rectangle&&(s.rectangleRefCount>1?s.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(s.rectangle),s.rectangle=void 0)),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(n)){const s=Array.isArray(n[o])?n[o]:[n[o]];for(const r of s){if(!r)continue;const l=this.objects.get(r);if(l){if(l[`${o}RefCount`]>1)l[`${o}RefCount`]--;else{const c=l[o];c&&(this.screenManager.collectionMap[o].remove(c),l[o]=void 0)}this.tryDeleteEmpty(r)}}}return!0}}makeScreenObjectId(e,n){return`${e}_${n}`}getOrCreateObject(e,n){let o=this.objects.get(e);return o||(o=new HL(e,n),this.objects.set(e,o)),o}tryDeleteEmpty(e){const n=this.objects.get(e);n&&!n.label&&!n.billboard&&!n.rectangle&&this.objects.delete(e)}}function qL(t,i){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&HC.includes(n)){const o=i[n];if(!o)continue;let s,r,l,c;if(o instanceof h.Label||o instanceof h.Billboard){const u=o.computeScreenSpacePosition(t.scene);({x:s,y:r,width:l,height:c}=h[o instanceof h.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,u))}else({x:s,y:r,width:l,height:c}=o);if(isNaN(s)||isNaN(r)||isNaN(l)||isNaN(c))continue;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],r),e[2]=Math.max(e[2],s+l),e[3]=Math.max(e[3],r+c)}return new h.Rectangle(...e)}class XL extends a.Destroyable{constructor(e){super();m(this,"rectangleCollisionCheck",new h.RectangleCollisionChecker);m(this,"screenManager");m(this,"enable",!1);m(this,"forceRebuildNext",!1);m(this,"avoidanceLayers",[]);m(this,"_processingQueue",[]);m(this,"_isProcessing",!1);m(this,"BATCH_SIZE",1e3);m(this,"_cache",new Map);m(this,"_lastCameraState",{});m(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const n=this.screenManager.getLayer(this.avoidanceLayers[e]);n.layerIsEffective()&&n.objects.forEach((o,s)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,n){this.enable=(e==null?void 0:e.enabled)??!1,n?e!=null&&e.enabled?this.avoidanceLayers.includes(n)||this.avoidanceLayers.push(n):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=n):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,n=e.positionWC,o=e.directionWC,s=this._lastCameraState.position,r=this._lastCameraState.direction;if(!s||!r)return this._updateLastCameraState(),!0;const l=h.Cartesian3.distanceSquared(n,s),c=h.Cartesian3.distanceSquared(o,r);return l>this.CAMERA_MOVE_THRESHOLD||c>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=h.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=h.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let n=0;n<this.avoidanceLayers.length;n++){const o=this.screenManager.getLayer(this.avoidanceLayers[n]);o.layerIsEffective()&&o.objects.forEach((s,r)=>{this._processingQueue.push(s)})}this._processingQueue.sort((n,o)=>(o.zOrder||0)-(n.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,n=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<n;){const s=e.shift();this._updateSingleObject(s),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const n=e.id.toString(),o=this._cache.get(n),s=h.Cartesian3.clone(e.position);let r;if(o&&h.Cartesian3.equalsEpsilon(o.worldPos,s,1e-6))r=o.rect,this.rectangleCollisionCheck.remove(n,r);else{if(r=qL(this.screenManager.viewer,e),isNaN(r.width)||isNaN(r.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(n,{rect:r,worldPos:s,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(r)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),r))}catch(n){console.error("ScreenManager update object error",n)}}}class $C extends a.Destroyable{constructor(){super();m(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class qC extends a.Destroyable{constructor(e){super();m(this,"layers",new Map);m(this,"czmViewer");m(this,"viewer");m(this,"avoidanceManager");m(this,"labelCollection");m(this,"billboardCollection");m(this,"rectangleCollection",this.ad(new $C));m(this,"canvasCollection",this.ad(new $C));m(this,"collectionMap");m(this,"_refreshEvent",this.ad(new a.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new XL(this)),this.labelCollection=new h.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new h.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(a.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(n=>n.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let n=this.layers.get(e);return n||(n=new $L(this),this.layers.set(e,n),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),n}addLabel(e,n,o,s){const l=this.getLayer(n).addLabel(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addImage(e,n,o,s){const l=this.getLayer(n).addImage(e,o,s);return this.refresh(),{layer:n,id:e,screenObjectId:l}}addRectangle(e,n,o,s,r){const c=this.getLayer(n).addRectangle(e,o,s,r);return this.refresh(),{layer:n,id:e,screenObjectId:c}}update(e,n,o,s){const r=this.getLayer(e);return!o||o.length===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o){const s=this.getLayer(e);if(!s.remove(o)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!s.layerIsEffective()&&!s.isDestroyed()&&(s.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,n){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,n),this.refresh()}}function Ke(t){return a.getExtProp(t,"_viewerExtensions")}function Ag(t,i){a.setExtProp(t,"_viewerExtensions",i)}class XC extends a.Destroyable{constructor(e,n){super();m(this,"_imageriesManager");m(this,"_terrainManager");m(this,"_labelManager");m(this,"_pickingManager");m(this,"_poiContext");m(this,"_cursorPositionInfo");m(this,"_screenManager");m(this,"_vectorTIlesManager");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new UC(this.viewer)),this._terrainManager=this.dv(new BC(this.viewer)),this._labelManager=this.dv(new VC(this.viewer)),this._poiContext=this.disposeVar(new Rm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new LL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new WC(n)),this._screenManager=this.ad(new qC(n)),this._vectorTIlesManager=this.ad(new WL(n.viewer)),this.ad(a.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}get vectorTIlesManager(){return this._vectorTIlesManager}}var YC=new h.Cartesian3,ZC=new h.Cartesian3;function QC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,YC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,ZC);else var c=h.Cartesian3.cross(t.up,r,ZC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,YC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,v=f.latitude;h.Cartesian3.fromRadians(g,v,o,void 0,t.position),t.lookAtTransform(n)}function kC(t,i){QC(t,i,!1)}function KC(t,i){QC(t,-i,!0)}class YL extends a.Destroyable{constructor(e){super();m(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&kC(s,d*p),r.MoveBackword&&kC(s,-d*p),r.MoveLeft&&KC(s,-d*p),r.MoveRight&&KC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class $h extends a.Destroyable{constructor(e){super();m(this,"_currentKeyIds",new Set);m(this,"_currentKeyIdsChanged",this.dv(new a.Event));m(this,"_debug",this.dv(a.react(!1)));m(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
|
|
1996
|
+
`))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=$h.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=$h.getKeyId(s);this._currentKeyIds.has(r)&&(this._currentKeyIds.delete(r),this._currentKeyIdsChanged.emit())};this.d(n.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(n.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class ZL extends a.Destroyable{constructor(e){super();m(this,"_keyStatus");m(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new $h(this)),this._cameraOp=this.dv(new YL(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const Kh=class Kh extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"_keyStatusMap",this.dv(a.react(Kh.defaultKeyStatusMap)));m(this,"_speed",this.dv(a.react(1)));m(this,"_rotateSpeed",this.dv(a.react(.01)));m(this,"_alwaysWithCamera",this.dv(a.react(!1)));m(this,"_keyDownEvent",this.dv(new a.Event));m(this,"_keyUpEvent",this.dv(new a.Event));m(this,"_abortEvent",this.dv(new a.Event));this._firstPersonController=e,this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new ZL(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};m(Kh,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let qh=Kh;function QL(t,i){t.lookRight(h.Math.toRadians(i.movementX)*.1),t.lookDown(h.Math.toRadians(i.movementY)*.1);const e=t.pitch,n=h.Math.clamp(e,-h.Math.PI_OVER_TWO,h.Math.PI_OVER_TWO);n!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:n,roll:t.roll}})}class kL extends a.Destroyable{constructor(i,e){super(),this._firstPersonController=i,this._mouseCameraController=e;const{canvas:n}=this._firstPersonController.viewer;{const o=s=>{const{camera:r}=this._firstPersonController.viewer.scene;QL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const Jh=class Jh extends a.Destroyable{constructor(e){super();m(this,"_mouseMoving",this.dv(new kL(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:n}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=Jh.origin_setPointerCapture);const o=n.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const s=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",s,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",s,!1))}{const s=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",s)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};m(Jh,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Tg=Jh;class KL extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!1)));m(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});m(this,"_mouseResetting",this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Tg(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class JL extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"_mouseCameraController",this.dv(new KL(this)));m(this,"_keyboardCameraController",this.dv(new qh(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function JC(t){t.removeInputAction(h.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(h.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)}function Mg(t,i,e,n=void 0){const s=t.camera,r=new h.Cartesian2;r.x=i.startPosition.x,r.y=0;const l=new h.Cartesian2;l.x=i.endPosition.x,l.y=0;let c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,p,f;if(!c||!u)return;s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction);let g=h.Cartesian3.dot(p,f);g<1&&(d=Math.acos(g)),d=i.startPosition.x>i.endPosition.x?d:-d;const v=e._horizontalRotationAxis;if(h.defined(n)?s.look(n,-d):h.defined(v)?s.look(v,-d):s.lookLeft(d),r.x=0,r.y=i.startPosition.y,l.x=0,l.y=i.endPosition.y,c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,!(!c||!u))if(s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction),g=h.Cartesian3.dot(p,f),g<1&&(d=Math.acos(g)),d=i.startPosition.y>i.endPosition.y?d:-d,n=n??v,h.defined(n)){const y=s.direction,w=h.Cartesian3.negate(n,new h.Cartesian3),P=h.Cartesian3.equalsEpsilon(y,n,h.Math.EPSILON2),_=h.Cartesian3.equalsEpsilon(y,w,h.Math.EPSILON2);if(!P&&!_){g=h.Cartesian3.dot(y,n);let S=h.Math.acosClamped(g);d>0&&d>S&&(d=S-h.Math.EPSILON4),g=h.Cartesian3.dot(y,w),S=h.Math.acosClamped(g),d<0&&-d>S&&(d=-S+h.Math.EPSILON4);const E=h.Cartesian3.cross(n,y,new h.Cartesian3);s.look(E,d)}else(P&&d<0||_&&d>0)&&s.look(s.right,-d)}else s.lookUp(d)}class jL extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("viewer is undefined");let o=!0;this.d(i.positionChanged.don(()=>o=!0)),this.d(i.rotationChanged.don(()=>o=!0)),this.d(i.offsetHeightChanged.don(()=>o=!0)),this.d(i.viewDistanceChanged.don(()=>o=!0)),this.d(i.offsetRotationChanged.don(()=>o=!0)),this.d(i.relativeRotationChanged.don(()=>o=!0));const s=[0,0,0],r=[0,0,0];this.d(n.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!i.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(i.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const p=Se(i.position),f=n.camera.positionWC,g=h.Cartesian3.distance(p,f);i.viewDistance=g}a.Vector.clone(i.position,r),i.offsetHeight&&(r[2]+=i.offsetHeight);const{rotation:l,offsetRotation:c=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.defaults.relativeRotation)&&(a.Vector.add(l,s,s),u[0]+=90),a.Vector.add(u,s,s);const d={distance:i.viewDistance,heading:s[0],pitch:s[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(d,r)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;if(c&&i.enabledRotationInput&&(c.buttons===1||c.buttons===2)){const{movementX:u,movementY:d}=c;i.offsetRotation=a.Vector.add(i.offsetRotation??Bi.defaults.offsetRotation,[u*.2,d*-.2,0])}})),this.d(e.wheelEvent.don(l=>{if(!i.enabledScaleInput)return;const c=l.deltaY,d=Math.max(1,i.viewDistance)*(c*.001);i.viewDistance=i.viewDistance+d}))}}class Bi extends a.Destroyable{constructor(e){super();m(this,"_resetWithCameraEvent",this.dv(new a.Event));const n=e.viewer;if(!n)throw new Error("viewer is undefined");const o=this;let s;const r=()=>{s&&(s.destroy(),s=void 0)};this.d(r);const l=()=>{r(),o.enabled&&(s=new jL(o,e))};l(),this.d(o.enabledChanged.don(l)),this.d(o.resetWithCameraEvent.don(c=>{if(!e.actived)return;const u=Jo(n.camera);if(!u)return;const d=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?d[0]:90),u[1]-(o.relativeRotation?d[1]:0),u[2]-(o.relativeRotation?d[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}m(Bi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class pa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");m(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const n=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};n(),this.d(this._geoPolylinePath.currentPositionChanged.don(n)),this.d(this._geoPolylinePath.currentRotationChanged.don(n)),this.dispose(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(a.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(a.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(a.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(a.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(a.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new a.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new eO(this,e);if(this.lineMode==="manual")return new tO(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(pa||(pa={})),a.extendClassProps(pa.prototype,pa.createDefaultProps);class eO extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class tO extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=s=>{(s.key==="w"||s.key==="s")&&(i.polylinePath.playing=s.type==="keydown",i.polylinePath.speed=s.key==="w"||s.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class iO extends a.Destroyable{constructor(i,e){super();const n=e.positionPropertyName??"position",o=e.positionChangedPropertyName??n+"Changed",s=e.rotationPropertyName??"rotation",r=e.rotationChangedPropertyName??s+"Changed",l=(e.positionTracking??!0)&&Reflect.has(i,n)&&Reflect.has(i,o),c=(e.rotationTracking??!0)&&Reflect.has(i,s)&&Reflect.has(i,r);if(!(!l&&!c)){if(l){const u=()=>{e.geoCameraController.position=i[n]};u();const d=i[o];this.d(d.don(u))}if(c){const u=()=>{e.geoCameraController.rotation=i[s]};u();const d=i[o];this.d(d.don(u))}}}}class nO extends a.Destroyable{constructor(i,e){super();const n=this.dv(new a.ESSceneObjectWithId);n.id=i;const o=this.dv(a.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,n.sceneObjectChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{const{sceneObject:s}=n;if(!(!e.enabled||!s))return new iO(s,e)}))}}class fa extends a.Destroyable{constructor(e){super();m(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new nO(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(fa||(fa={})),a.extendClassProps(fa.prototype,fa.createDefaultProps);class oO extends a.Destroyable{constructor(e){super();m(this,"height",1e7);m(this,"cycle",60);m(this,"latitude",38*3.1415926/18);m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");m(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new h.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},h.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,n=e.positionCartographic;e.flyTo({destination:h.Cartesian3.fromRadians(n.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,r)=>{if(!o){o=new Date().getTime();return}const l=(new Date().getTime()-o)/1e3,c=e.positionCartographic.longitude+l*h.Math.PI*2/this.cycle;e.setView({destination:h.Cartesian3.fromRadians(c,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class sO extends a.Destroyable{constructor(e){super();m(this,"_height",this.dv(a.react(1e7)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_latitude",this.dv(a.react(38)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("未初始化viewer");this._inner=this.dv(new oO(n)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class rO extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_transform");m(this,"_headingRadius");m(this,"_pitchRadius");m(this,"_running",!1);m(this,"_sseh");m(this,"_eventDisposer");this._viewer=e;const n=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new h.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const s=()=>{let r;if(this.position==null){var l=o.getPickRay(new h.Cartesian2(n.canvas.width*.5,n.canvas.height*.5));if(!l)return;r=n.globe.pick(l,n)}else r=h.Cartesian3.fromDegrees(...this.position);r&&(this._transform=h.Transforms.eastNorthUpToFixedFrame(r),this.start())};s(),this.d(this.positionChanged.don(s))}{const s=()=>{this._headingRadius=h.Math.toRadians(this.heading)};s(),this.d(this.headingChanged.don(s))}{const s=()=>{this._pitchRadius=h.Math.toRadians(this.pitch)};s(),this.d(this.pitchChanged.don(s))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var n=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),s=new h.Cartesian3(0,n,o);e.flyTo({destination:h.Matrix4.multiplyByPoint(this._transform,s,new h.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let r;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((l,c)=>{if(!r){r=new Date().getTime();return}const u=(new Date().getTime()-r)/1e3;this._headingRadius+=u*h.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new h.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),r=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(h.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class aO extends a.Destroyable{constructor(e){super();m(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));m(this,"_distance",this.dv(a.react(5e4)));m(this,"_cycle",this.dv(a.react(60)));m(this,"_heading",this.dv(a.react(0)));m(this,"_pitch",this.dv(a.react(-30)));m(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("viewer is undefined");this._inner=this.dv(new rO(n));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class lO extends a.Destroyable{constructor(e){super();m(this,"_firstPersonController");m(this,"_rotateGlobe");m(this,"_rotatePoint");m(this,"_followController");m(this,"_pathCameraController");m(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new JL(e)),this.d(this._viewer.keyDownEvent.don(n=>this._firstPersonController.keyboardCameraController.keyDown(n))),this.d(this._viewer.keyUpEvent.don(n=>this._firstPersonController.keyboardCameraController.keyUp(n)));{const{subContainer:n}=this._viewer;if(!n)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();n.addEventListener("blur",o,!1),this.d(()=>n.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=qh.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new sO(e)),this._rotatePoint=this.dv(new aO(e)),this._followController=this.dv(new fa(e)),this._pathCameraController=this.dv(new pa(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,n=4.2,o=1.6){this.resetNavigation();const s=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),l=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(c=>{s?this._viewer.flyIn([e[0],e[1],(c??0)+o],l):this._viewer.viewer&&(this._viewer.viewer.camera.position=h.Cartesian3.fromDegrees(e[0],e[1],(c??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,n=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=n,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,n=5e4,o=60,s=0,r=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=n,this._rotatePoint.cycle=o,this._rotatePoint.heading=s,this._rotatePoint.pitch=r,this._rotatePoint.start()}changeToFollow(e,n=0,o=0,s=-30,r=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,s,0],this._followController.geoCameraController.relativeRotation=r,n!==0?this._followController.geoCameraController.viewDistance=n:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,n=10,o=10,s=!0,r=10,l="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const c=l==="auto",u=a.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:d}=u;if(!d)return;const p=a.getDistancesFromPositions(d,"NONE"),f=p[p.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...d],this._pathCameraController.polylinePath.duration=f/n*1e3,this._pathCameraController.polylinePath.loop=s,this._pathCameraController.offsetHeight=o;const g=um(d);this._pathCameraController.polylinePath.rotationRadius=!c||g==!1?[0]:g.map(v=>v/r*n),this._pathCameraController.enabledRotationInput=!c,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=c,this._pathCameraController.lineMode=l,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const n=this._viewer.viewer;if(!n)return;this._handler||(this._handler=new h.ScreenSpaceEventHandler(n.scene.canvas));const o=this._handler,s=n.scene.screenSpaceCameraController;this.d(()=>{o&&JC(o)}),e=="Walk"||e=="RotateGlobe"?(s.lookEventTypes=void 0,s.rotateEventTypes=void 0,s.tiltEventTypes=void 0,s.zoomEventTypes=void 0,s.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Mg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&JC(o),s.lookEventTypes=h.CameraEventType.RIGHT_DRAG,s.rotateEventTypes=h.CameraEventType.LEFT_DRAG,s.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],s.translateEventTypes=h.CameraEventType.LEFT_DRAG,s.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}])}}const cO=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class hO extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"cloudsPostProcess");const n=e.viewer;if(!n)throw new Error("Cesium Viewer is not initialized");const o=new h.CloudCollection;n.scene.primitives.add(o),this.dispose(()=>n.scene.primitives.remove(o));{const s=()=>{o.show=this.show};s(),this.dispose(this.showChanged.disposableOn(s))}{const s=l=>({slice:l.slice,brightness:l.brightness,scale:Pe(l.scale),maximumSize:hi(l.maximumSize),color:te(l.color),position:Se(l.position)});(()=>{o.removeAll();for(let l of cO)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ga extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.postProcessStages.add(h.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(n));{const o=()=>{n.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{n.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{n.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{n.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{n.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const uO=`
|
|
1997
1997
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
1998
1998
|
{
|
|
1999
1999
|
float depth = czm_unpackDepth(texture(depthTexture, texCoords));
|
|
@@ -2029,7 +2029,7 @@ return material;
|
|
|
2029
2029
|
vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
|
|
2030
2030
|
out_FragColor = alphaBlend(finalFogColor, sceneColor);
|
|
2031
2031
|
}
|
|
2032
|
-
`;class
|
|
2032
|
+
`;class dO extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"postProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(n.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new h.PostProcessStage({name:"earthsdk3_fog",fragmentShader:uO,uniforms:{fogByDistance:new h.Cartesian4(10,0,1e3,.9),fogColor:h.Color.WHITE}}),n.scene.postProcessStages.add(this.postProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const pO=`
|
|
2033
2033
|
uniform sampler2D colorTexture;
|
|
2034
2034
|
in vec2 v_textureCoordinates;
|
|
2035
2035
|
|
|
@@ -2056,7 +2056,7 @@ void main(void){
|
|
|
2056
2056
|
|
|
2057
2057
|
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);
|
|
2058
2058
|
}
|
|
2059
|
-
`;class
|
|
2059
|
+
`;class fO extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"rainPostProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(n.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new h.PostProcessStage({name:"earthsdk3_rain",fragmentShader:pO}),n.scene.postProcessStages.add(this.rainPostProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const gO=`
|
|
2060
2060
|
uniform sampler2D colorTexture; //输入的场景渲染照片
|
|
2061
2061
|
in vec2 v_textureCoordinates;
|
|
2062
2062
|
|
|
@@ -2087,7 +2087,7 @@ void main(void){
|
|
|
2087
2087
|
finalColor=(vec3(c)); //屏幕上雪的颜色
|
|
2088
2088
|
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); //将雪和三维场景融合
|
|
2089
2089
|
}
|
|
2090
|
-
`,
|
|
2090
|
+
`,mO=`
|
|
2091
2091
|
#extension GL_OES_standard_derivatives : enable
|
|
2092
2092
|
uniform sampler2D colorTexture;
|
|
2093
2093
|
uniform sampler2D depthTexture;
|
|
@@ -2127,7 +2127,7 @@ void main() {
|
|
|
2127
2127
|
}
|
|
2128
2128
|
out_FragColor = mix(color, vec4(1.0), dotNumWC*alpha);
|
|
2129
2129
|
}
|
|
2130
|
-
`;class
|
|
2130
|
+
`;class vO extends a.Destroyable{constructor(e){super();m(this,"_show",this.dv(a.react(!1)));m(this,"_alpha",this.dv(a.react(0)));m(this,"snow");m(this,"snowCover");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}let{snow:o,snowCover:s}=this;const r=()=>{o&&(n.scene.postProcessStages.remove(o),o=void 0)};this.d(r);const l=()=>{s&&(n.scene.postProcessStages.remove(s),s=void 0)};this.d(l);const c=()=>{if(!s)return;const d=h.Math.clamp(this.alpha,0,1);s.uniforms.alpha=d};c(),this.d(this.alphaChanged.don(c));const u=()=>{r(),l(),(this.show??!0)&&(o=new h.PostProcessStage({name:"earthsdk3_snow",fragmentShader:gO}),n.scene.postProcessStages.add(o),s=new h.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:mO,uniforms:{alpha:this.alpha}}),n.scene.postProcessStages.add(s),c())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class yO extends a.Destroyable{constructor(e){super();m(this,"rain");m(this,"cloud");m(this,"snow");m(this,"fog");m(this,"depthOfField");const n=e.viewer;if(!n)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new fO(e)),s=this.dv(new hO(e)),r=this.dv(new vO(e)),l=this.dv(new dO(e)),c=this.dv(new ga(e));this.rain=o,this.cloud=s,this.snow=r,this.fog=l,this.depthOfField=c;{const{scene:u}=n,d=()=>{u.sun&&(u.sun.show=e.sun??Ie.defaults.sun),u.globe.enableLighting=e.sun??Ie.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?s.show=!0:s.show=!1,e.snow>0&&e.snow<=1?(r.show=!0,r.alpha=e.snow):r.show=!1,e.fog>0&&e.fog<=1?l.show=!0:l.show=!1,e.depthOfField>0&&e.depthOfField<=1?c.show=!0:c.show=!1};d();const p=this.dv(a.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(p.don(d))}}}const Ig=h.BoundingRectangle,wO=h.Color,Xn=h.defined,CO=h.destroyObject,jC=h.DeveloperError,_O=h.RenderState,PO=h.ShaderSource,bO=h._shadersViewportQuadFS,SO=h.BlendingState,e_=h.Material;function Xh(t){this.show=!0;let i;Xn(i)||(i=new Ig),this.rectangle=Ig.clone(i),Xn(t)||(t=e_.fromType(e_.ColorType,{color:new wO(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}Xh.prototype.update=function(t){if(this.show){if(!Xn(this.material))throw new jC("this.material must be defined.");if(!Xn(this.rectangle))throw new jC("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var i=this._rs;(!Xn(i)||!Ig.equals(i.viewport,this.rectangle))&&(this._rs=_O.fromCache({blending:SO.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var n=t.context;if(this._material!==this.material||!Xn(this._overlayCommand)){this._material=this.material,Xn(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new PO({sources:[this._material.shaderSource,bO]});this._overlayCommand=n.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(n),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},Xh.prototype.isDestroyed=function(){return!1},Xh.prototype.destroy=function(){return Xn(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),CO(this)};function t_(t){const{positiveX:i,negativeX:e,positiveY:n,negativeY:o,positiveZ:s,negativeZ:r}=t;if(!i||!e||!n||!o||!s||!r){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:a.ESSceneObject.context.getStrFromEnv(i),negativeX:a.ESSceneObject.context.getStrFromEnv(e),positiveY:a.ESSceneObject.context.getStrFromEnv(n),negativeY:a.ESSceneObject.context.getStrFromEnv(o),positiveZ:a.ESSceneObject.context.getStrFromEnv(s),negativeZ:a.ESSceneObject.context.getStrFromEnv(r)}}const xO=`in vec3 v_outerPositionWC;
|
|
2131
2131
|
|
|
2132
2132
|
uniform vec3 u_hsbShift;
|
|
2133
2133
|
|
|
@@ -2206,7 +2206,7 @@ void main (void)
|
|
|
2206
2206
|
out_FragColor = color;
|
|
2207
2207
|
// ------------------ skybox vtxf end -------------------
|
|
2208
2208
|
}
|
|
2209
|
-
`,Yn=h.Cartesian3,an=h.defined,AO=h.destroyObject,TO=h.Ellipsoid,i_=h.EllipsoidGeometry,MO=h.GeometryPipeline,rr=h.Math,ln=h.Matrix4,IO=h.VertexFormat,DO=h.BufferUsage,RO=h.DrawCommand,FO=h.RenderState,zO=h.ShaderProgram,n_=h.ShaderSource,LO=h.VertexArray,o_=h._shadersAtmosphereCommon,s_=h._shadersSkyAtmosphereCommon,OO=h._shadersSkyAtmosphereVS,NO=h.Axis,BO=h.BlendingState,VO=h.CullFace,r_=h.SceneMode,Yh=h.Transforms,UO=h.Matrix3,a_=h.DeveloperError,WO=h.loadCubeMap,GO=h.CubeMap;function ar(t,i){t=t??TO.WGS84,this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Yn.multiplyByScalar(t.radii,e,new Yn);this._scaleMatrix=ln.fromScale(n),this._modelMatrix=new ln,this._command=new RO({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Yn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Yn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Yn;const o=new Yn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new UO,ln.getMatrix3(s._eunMatrix||ln.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(ar.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ar.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Dg=new ln;ar.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==r_.SCENE3D&&e!==r_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const v=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!an(o.positiveX)||!an(o.negativeX)||!an(o.positiveY)||!an(o.negativeY)||!an(o.positiveZ)||!an(o.negativeZ))throw new a_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new a_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?WO(v,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new GO({context:v,source:o}))}const s=ln.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Yn.ZERO,Dg),r=ln.multiplyTransformation(s,NO.Y_UP_TO_Z_UP,Dg),l=ln.multiply(this._scaleMatrix,r,Dg);ln.clone(l,this._modelMatrix);const c=t.context,u=HO(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!an(i)||!i.show,f=this._command;if(Yh.eastUpNorthToFixedFrame=Yh.eastUpNorthToFixedFrame||Yh.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Yh.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!an(f.vertexArray)){const v=i_.createGeometry(new i_({radii:new Yn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:IO.POSITION_ONLY}));f.vertexArray=LO.fromGeometry({context:c,geometry:v,attributeLocations:MO.createAttributeLocations(v),bufferUsage:DO.STATIC_DRAW}),f.renderState=FO.fromCache({cull:{enabled:!0,face:VO.FRONT},blending:BO.ALPHA_BLEND,depthMask:!1})}const g=u|p<<2|d<<3;if(g!==this._flags){this._flags=g;const v=[];u&&v.push("COLOR_CORRECT"),p&&v.push("PER_FRAGMENT_ATMOSPHERE"),d&&v.push("GLOBE_TRANSLUCENT");const y=new n_({defines:v,sources:[o_,s_,OO]}),w=new n_({defines:v,sources:[o_,s_,EO]});this._spSkyAtmosphere=zO.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:w}),f.shaderProgram=this._spSkyAtmosphere}if(an(this._cubeMap))return f};function HO(t){return!(rr.equalsEpsilon(t.hueShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.saturationShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.brightnessShift,0,rr.EPSILON7))}ar.prototype.isDestroyed=function(){return!1},ar.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),AO(this)};const mr=class mr extends a.Destroyable{constructor(e,n){super();m(this,"_navigationManager");m(this,"_envManager");m(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new cO(s)),this._envManager=this.dv(new wO(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new mr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=t_(this._czmViewer.xbsjLocalBoxSources);if(l)return new mr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=Ie.latestDefaultAccessToken??Ie.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(Ci(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,g){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(v,y)=>a.registerEventUpdate(this,v,y),p=Ie.defaults,f=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);if(!Reflect.has(p,v))throw new Error(`!Reflect.has(CzmViewer.defaults, ${v})`);y(s[v]??p[v])}),g=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);y(s[v])});f("splitPosition",v=>o.scene.splitPosition=v),f("resolutionScale",v=>o.resolutionScale=v),f("msaaSamples",v=>o.scene.msaaSamples=v),g("shadows",v=>o.shadows=v),f("scenePpsfxaaEnabled",v=>l.postProcessStages.fxaa.enabled=v),g("scenePpsAmbientOcclusionEnabled",v=>l.postProcessStages.ambientOcclusion.enabled=v),g("scenePpsAmbientOcclusionAmbientOcclusionOnly",v=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=v),g("scenePpsAmbientOcclusionIntensity",v=>l.postProcessStages.ambientOcclusion.uniforms.intensity=v),g("scenePpsAmbientOcclusionBias",v=>l.postProcessStages.ambientOcclusion.uniforms.bias=v),g("scenePpsAmbientOcclusionLengthCap",v=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=v),g("scenePpsAmbientOcclusionStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=v),g("scenePpsAmbientOcclusionBlurStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=v),g("scenePpsBloomEnabled",v=>l.postProcessStages.bloom.enabled=v),g("scenePpsBloomGlowOnly",v=>l.postProcessStages.bloom.uniforms.glowOnly=v),g("scenePpsBloomContrast",v=>l.postProcessStages.bloom.uniforms.contrast=v),g("scenePpsBloomBrightness",v=>l.postProcessStages.bloom.uniforms.brightness=v),g("scenePpsBloomDelta",v=>l.postProcessStages.bloom.uniforms.delta=v),g("scenePpsBloomSigma",v=>l.postProcessStages.bloom.uniforms.sigma=v),g("scenePpsBloomStepSize",v=>l.postProcessStages.bloom.uniforms.stepSize=v),f("globeShow",v=>l.globe.show=v),f("depthTestAgainstTerrain",v=>{l.globe.depthTestAgainstTerrain=v}),l.globe.translucency.enabled=!0,f("terrainOpacity",v=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(v,0,1)}),f("sceneGlobeShadows",v=>l.globe.shadows=h.ShadowMode[v]),g("sceneGlobeTerrainExaggeration",v=>l.globe.terrainExaggeration=v),g("sceneGlobeTerrainExaggerationRelativeHeight",v=>l.globe.terrainExaggerationRelativeHeight=v),g("sceneGlobeVerticalExaggeration",v=>l.globe.verticalExaggeration=v),g("sceneGlobeVerticalExaggerationRelativeHeight",v=>l.globe.verticalExaggerationRelativeHeight=v),g("sceneGlobeBackFaceCulling",v=>l.globe.backFaceCulling=v),g("sceneGlobeShowSkirts",v=>l.globe.showSkirts=v),g("sceneGlobeShowWaterEffect",v=>l.globe.showWaterEffect=v),g("sceneGlobeBaseColor",v=>l.globe.baseColor=te(v)),g("sceneGlobeCartographicLimitRectangle",v=>l.globe.cartographicLimitRectangle=Ve(v)),g("sceneGlobeClippingPlanes",v=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=wr(v??{enabled:!1});return}dc(l.globe.clippingPlanes,v)}),g("sceneGlobeClippingPolygons",v=>{l.globe.clippingPolygons=v?pc(v):void 0}),f("sceneSunGlowFactor",v=>l.sun&&(l.sun.glowFactor=v)),f("moon",v=>l.moon&&(l.moon.show=v)),f("sceneMoonOnlySunLighting",v=>l.moon&&(l.moon.onlySunLighting=v)),f("sceneMoonTextureUrl",v=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(v))),g("sceneSkyBoxShow",v=>l._xbsjOriginSkyBox.show=v),f("sceneSkyBoxSources",v=>l._xbsjOriginSkyBox.sources=v&&t_(v)),g("atmosphere",v=>o.scene._xbsjOriginSkyAtmosphere.show=v),g("sceneBackgroundColor",v=>o.scene.backgroundColor=te(v)),f("sceneFogEnabled",v=>l.fog.enabled=v),f("sceneFogDensity",v=>l.fog.density=v),f("sceneFogScreenSpaceErrorFactor",v=>l.fog.screenSpaceErrorFactor=v),f("sceneFogMinimumBrightness",v=>l.fog.minimumBrightness=v),f("sceneDebugShowFramesPerSecond",v=>l.debugShowFramesPerSecond=v),f("sceneDebugShowCommands",v=>l.debugShowCommands=v),f("sceneDebugShowFrustums",v=>l.debugShowFrustums=v),f("sceneDebugShowFrustumPlanes",v=>l.debugShowFrustumPlanes=v),f("sceneDebugShowDepthFrustum",v=>l.debugShowDepthFrustum=v),f("sceneGlobeUndergroundColor",v=>u.undergroundColor=te(v)),f("sceneGlobeUndergroundColorAlphaByDistance",v=>u.undergroundColorAlphaByDistance=dn(v)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",v=>u.translucency.backFaceAlphaByDistance=v&&dn(v)),g("sceneGlobeTranslucencyFrontFaceAlphaByDistance",v=>u.translucency.frontFaceAlphaByDistance=v&&dn(v)),f("sceneGlobeTranslucencyRectangle",v=>u.translucency.rectangle=Ve(v)),f("sceneSplitPosition",v=>l.splitPosition=a.clamp(v,0,1)),f("sceneSsccEnableCollisionDetection",v=>l.screenSpaceCameraController.enableCollisionDetection=v),f("sceneSsccZoomFactor",v=>l.screenSpaceCameraController._zoomFactor=v);{const v=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};v(),this.d(s.showCesiumInspectorChanged.don(v))}f("cesiumInspectorWireframe",v=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=v)});{const v=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};v(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(v))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new Pg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};m(mr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new Xh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),m(mr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();m(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new ar(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let Rg=mr;function $O(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function qO(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[$O(r,c,l,u,d),s]}const XO=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function YO(t){return-Math.log2(t/XO)}var Fg=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function ZO(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=Fg[++e];);const n=i/Fg[e-1]|0;return[n*Fg[e-1],n,e]}class QO extends a.Destroyable{constructor(){super();m(this,"_lengthInPixels",this.disposeVar(a.react(100)));m(this,"_resolution",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=ZO(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class kO extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!0)));m(this,"_resolution",this.dv(a.react(void 0)));m(this,"_center",this.dv(a.react(void 0)));m(this,"_zoom",this.dv(a.react(void 0)));m(this,"_legend",this.dv(new QO));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise(qO(this._czmViewer));if(c){const[u,d]=c;s=u,r=YO(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function KO(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:JO}=h,{ShaderDestination:Uo}=h,l_={name:"FlattenedPipelineStage"};l_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Uo.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Uo.BOTH),n.addUniform("vec4","u_flattenedBound",Uo.BOTH),n.addUniform("bool","u_flattened",Uo.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Uo.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Uo.BOTH),n.addUniform("bool","u_flattenDiscard",Uo.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=JO(o,t.uniformMap)}};function c_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function h_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function u_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function d_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(l_),n}}c_(),h_(),u_(),d_();const jO=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(Ie.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),eN=`
|
|
2209
|
+
`,Yn=h.Cartesian3,an=h.defined,EO=h.destroyObject,AO=h.Ellipsoid,i_=h.EllipsoidGeometry,TO=h.GeometryPipeline,rr=h.Math,ln=h.Matrix4,MO=h.VertexFormat,IO=h.BufferUsage,DO=h.DrawCommand,RO=h.RenderState,FO=h.ShaderProgram,n_=h.ShaderSource,zO=h.VertexArray,o_=h._shadersAtmosphereCommon,s_=h._shadersSkyAtmosphereCommon,LO=h._shadersSkyAtmosphereVS,OO=h.Axis,NO=h.BlendingState,BO=h.CullFace,r_=h.SceneMode,Yh=h.Transforms,VO=h.Matrix3,a_=h.DeveloperError,UO=h.loadCubeMap,WO=h.CubeMap;function ar(t,i){t=t??AO.WGS84,this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Yn.multiplyByScalar(t.radii,e,new Yn);this._scaleMatrix=ln.fromScale(n),this._modelMatrix=new ln,this._command=new DO({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Yn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Yn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Yn;const o=new Yn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new VO,ln.getMatrix3(s._eunMatrix||ln.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(ar.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ar.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Dg=new ln;ar.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==r_.SCENE3D&&e!==r_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const v=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!an(o.positiveX)||!an(o.negativeX)||!an(o.positiveY)||!an(o.negativeY)||!an(o.positiveZ)||!an(o.negativeZ))throw new a_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new a_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?UO(v,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new WO({context:v,source:o}))}const s=ln.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Yn.ZERO,Dg),r=ln.multiplyTransformation(s,OO.Y_UP_TO_Z_UP,Dg),l=ln.multiply(this._scaleMatrix,r,Dg);ln.clone(l,this._modelMatrix);const c=t.context,u=GO(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!an(i)||!i.show,f=this._command;if(Yh.eastUpNorthToFixedFrame=Yh.eastUpNorthToFixedFrame||Yh.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Yh.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!an(f.vertexArray)){const v=i_.createGeometry(new i_({radii:new Yn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:MO.POSITION_ONLY}));f.vertexArray=zO.fromGeometry({context:c,geometry:v,attributeLocations:TO.createAttributeLocations(v),bufferUsage:IO.STATIC_DRAW}),f.renderState=RO.fromCache({cull:{enabled:!0,face:BO.FRONT},blending:NO.ALPHA_BLEND,depthMask:!1})}const g=u|p<<2|d<<3;if(g!==this._flags){this._flags=g;const v=[];u&&v.push("COLOR_CORRECT"),p&&v.push("PER_FRAGMENT_ATMOSPHERE"),d&&v.push("GLOBE_TRANSLUCENT");const y=new n_({defines:v,sources:[o_,s_,LO]}),w=new n_({defines:v,sources:[o_,s_,xO]});this._spSkyAtmosphere=FO.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:w}),f.shaderProgram=this._spSkyAtmosphere}if(an(this._cubeMap))return f};function GO(t){return!(rr.equalsEpsilon(t.hueShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.saturationShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.brightnessShift,0,rr.EPSILON7))}ar.prototype.isDestroyed=function(){return!1},ar.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),EO(this)};const mr=class mr extends a.Destroyable{constructor(e,n){super();m(this,"_navigationManager");m(this,"_envManager");m(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new lO(s)),this._envManager=this.dv(new yO(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new mr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=t_(this._czmViewer.xbsjLocalBoxSources);if(l)return new mr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=Ie.latestDefaultAccessToken??Ie.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(Ci(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,g){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(v,y)=>a.registerEventUpdate(this,v,y),p=Ie.defaults,f=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);if(!Reflect.has(p,v))throw new Error(`!Reflect.has(CzmViewer.defaults, ${v})`);y(s[v]??p[v])}),g=(v,y)=>d(s[v+"Changed"],()=>{if(!Reflect.has(s,v))throw new Error(`!Reflect.has(czmViewer, ${v})`);y(s[v])});f("splitPosition",v=>o.scene.splitPosition=v),f("resolutionScale",v=>o.resolutionScale=v),f("msaaSamples",v=>o.scene.msaaSamples=v),g("shadows",v=>o.shadows=v),f("scenePpsfxaaEnabled",v=>l.postProcessStages.fxaa.enabled=v),g("scenePpsAmbientOcclusionEnabled",v=>l.postProcessStages.ambientOcclusion.enabled=v),g("scenePpsAmbientOcclusionAmbientOcclusionOnly",v=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=v),g("scenePpsAmbientOcclusionIntensity",v=>l.postProcessStages.ambientOcclusion.uniforms.intensity=v),g("scenePpsAmbientOcclusionBias",v=>l.postProcessStages.ambientOcclusion.uniforms.bias=v),g("scenePpsAmbientOcclusionLengthCap",v=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=v),g("scenePpsAmbientOcclusionStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=v),g("scenePpsAmbientOcclusionBlurStepSize",v=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=v),g("scenePpsBloomEnabled",v=>l.postProcessStages.bloom.enabled=v),g("scenePpsBloomGlowOnly",v=>l.postProcessStages.bloom.uniforms.glowOnly=v),g("scenePpsBloomContrast",v=>l.postProcessStages.bloom.uniforms.contrast=v),g("scenePpsBloomBrightness",v=>l.postProcessStages.bloom.uniforms.brightness=v),g("scenePpsBloomDelta",v=>l.postProcessStages.bloom.uniforms.delta=v),g("scenePpsBloomSigma",v=>l.postProcessStages.bloom.uniforms.sigma=v),g("scenePpsBloomStepSize",v=>l.postProcessStages.bloom.uniforms.stepSize=v),f("globeShow",v=>l.globe.show=v),f("depthTestAgainstTerrain",v=>{l.globe.depthTestAgainstTerrain=v}),l.globe.translucency.enabled=!0,f("terrainOpacity",v=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(v,0,1)}),f("sceneGlobeShadows",v=>l.globe.shadows=h.ShadowMode[v]),g("sceneGlobeTerrainExaggeration",v=>l.globe.terrainExaggeration=v),g("sceneGlobeTerrainExaggerationRelativeHeight",v=>l.globe.terrainExaggerationRelativeHeight=v),g("sceneGlobeVerticalExaggeration",v=>l.globe.verticalExaggeration=v),g("sceneGlobeVerticalExaggerationRelativeHeight",v=>l.globe.verticalExaggerationRelativeHeight=v),g("sceneGlobeBackFaceCulling",v=>l.globe.backFaceCulling=v),g("sceneGlobeShowSkirts",v=>l.globe.showSkirts=v),g("sceneGlobeShowWaterEffect",v=>l.globe.showWaterEffect=v),g("sceneGlobeBaseColor",v=>l.globe.baseColor=te(v)),g("sceneGlobeCartographicLimitRectangle",v=>l.globe.cartographicLimitRectangle=Ve(v)),g("sceneGlobeClippingPlanes",v=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=wr(v??{enabled:!1});return}dc(l.globe.clippingPlanes,v)}),g("sceneGlobeClippingPolygons",v=>{l.globe.clippingPolygons=v?pc(v):void 0}),f("sceneSunGlowFactor",v=>l.sun&&(l.sun.glowFactor=v)),f("moon",v=>l.moon&&(l.moon.show=v)),f("sceneMoonOnlySunLighting",v=>l.moon&&(l.moon.onlySunLighting=v)),f("sceneMoonTextureUrl",v=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(v))),g("sceneSkyBoxShow",v=>l._xbsjOriginSkyBox.show=v),f("sceneSkyBoxSources",v=>l._xbsjOriginSkyBox.sources=v&&t_(v)),g("atmosphere",v=>o.scene._xbsjOriginSkyAtmosphere.show=v),g("sceneBackgroundColor",v=>o.scene.backgroundColor=te(v)),f("sceneFogEnabled",v=>l.fog.enabled=v),f("sceneFogDensity",v=>l.fog.density=v),f("sceneFogScreenSpaceErrorFactor",v=>l.fog.screenSpaceErrorFactor=v),f("sceneFogMinimumBrightness",v=>l.fog.minimumBrightness=v),f("sceneDebugShowFramesPerSecond",v=>l.debugShowFramesPerSecond=v),f("sceneDebugShowCommands",v=>l.debugShowCommands=v),f("sceneDebugShowFrustums",v=>l.debugShowFrustums=v),f("sceneDebugShowFrustumPlanes",v=>l.debugShowFrustumPlanes=v),f("sceneDebugShowDepthFrustum",v=>l.debugShowDepthFrustum=v),f("sceneGlobeUndergroundColor",v=>u.undergroundColor=te(v)),f("sceneGlobeUndergroundColorAlphaByDistance",v=>u.undergroundColorAlphaByDistance=dn(v)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",v=>u.translucency.backFaceAlphaByDistance=v&&dn(v)),g("sceneGlobeTranslucencyFrontFaceAlphaByDistance",v=>u.translucency.frontFaceAlphaByDistance=v&&dn(v)),f("sceneGlobeTranslucencyRectangle",v=>u.translucency.rectangle=Ve(v)),f("sceneSplitPosition",v=>l.splitPosition=a.clamp(v,0,1)),f("sceneSsccEnableCollisionDetection",v=>l.screenSpaceCameraController.enableCollisionDetection=v),f("sceneSsccZoomFactor",v=>l.screenSpaceCameraController._zoomFactor=v);{const v=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};v(),this.d(s.showCesiumInspectorChanged.don(v))}f("cesiumInspectorWireframe",v=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=v)});{const v=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};v(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(v))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new Pg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};m(mr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new Xh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),m(mr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();m(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new ar(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let Rg=mr;function HO(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function $O(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[HO(r,c,l,u,d),s]}const qO=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function XO(t){return-Math.log2(t/qO)}var Fg=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function YO(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=Fg[++e];);const n=i/Fg[e-1]|0;return[n*Fg[e-1],n,e]}class ZO extends a.Destroyable{constructor(){super();m(this,"_lengthInPixels",this.disposeVar(a.react(100)));m(this,"_resolution",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));m(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=YO(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class QO extends a.Destroyable{constructor(e){super();m(this,"_enabled",this.dv(a.react(!0)));m(this,"_resolution",this.dv(a.react(void 0)));m(this,"_center",this.dv(a.react(void 0)));m(this,"_zoom",this.dv(a.react(void 0)));m(this,"_legend",this.dv(new ZO));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise($O(this._czmViewer));if(c){const[u,d]=c;s=u,r=XO(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function kO(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:KO}=h,{ShaderDestination:Uo}=h,l_={name:"FlattenedPipelineStage"};l_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Uo.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Uo.BOTH),n.addUniform("vec4","u_flattenedBound",Uo.BOTH),n.addUniform("bool","u_flattened",Uo.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Uo.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Uo.BOTH),n.addUniform("bool","u_flattenDiscard",Uo.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=KO(o,t.uniformMap)}};function c_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function h_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function u_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function d_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(l_),n}}c_(),h_(),u_(),d_();const JO=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(Ie.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),jO=`
|
|
2210
2210
|
#### 示例代码1
|
|
2211
2211
|
\`\`\`
|
|
2212
2212
|
async function initCesiumViewer(container, czmViewer) {
|
|
@@ -2281,7 +2281,7 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2281
2281
|
return viewer;
|
|
2282
2282
|
}
|
|
2283
2283
|
\`\`\`
|
|
2284
|
-
`,
|
|
2284
|
+
`,eN=`async function initCesiumViewer(container, czmViewer) {
|
|
2285
2285
|
const viewer = await XE2.g.defaultCreateCesiumViewerFunc(container, czmViewer);
|
|
2286
2286
|
|
|
2287
2287
|
// 若原Czm版权信息展示位置遮挡重要信息,可将以下语句解注释,在别的位置展示
|
|
@@ -2289,13 +2289,13 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2289
2289
|
|
|
2290
2290
|
return viewer;
|
|
2291
2291
|
}
|
|
2292
|
-
`;function
|
|
2292
|
+
`;function tN(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
2293
2293
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
2294
2294
|
gitee地址:${t}
|
|
2295
|
-
`;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const lt=class lt extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",Gh);m(this,"_moveObjectsProcess",this.ad(bC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new SF(this)),this.ad(new xF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new MF(this)})),this._viewerLegend=this.dv(new kO(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Rg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new TL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ke(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],lt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&xr(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&xr(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&xr(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Jo(e)}}transformFlyParam(e,n){if("position"in n){const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,Se(n.position),new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=n.rotation[0]-d,f=n.rotation[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const o=Se(e);let s={heading:h.Math.toRadians(n.heading),pitch:h.Math.toRadians(n.pitch),roll:0};const r=new h.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=h.Math.PI_OVER_TWO;const c=h.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=h.Matrix4.multiplyByPointAsVector(c,h.Cartesian3.UNIT_X,new h.Cartesian3);h.Cartesian3.multiplyByScalar(u,n.distance,u),h.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=h.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=h.Math.toRadians(n.pDelta));const l=se(o);return l?{position:l,rotation:[h.Math.toDegrees(s.heading),h.Math.toDegrees(s.pitch),h.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,lt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=lt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!lt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=lt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Se(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=lt.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",tN,eN,!0),new a.FunctionProperty([],()=>lt.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(lt,"type",lt.register("ESCesiumViewer",lt)),m(lt,"getCesiumIonToken",iN),m(lt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(lt,"latestDefaultAccessToken"),m(lt,"ObjectsToExcludeWrapper",TF),m(lt,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(lt,"getHeightsScartchCarto",new h.Cartographic);let Ie=lt;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...jO()})})(Ie||(Ie={})),a.extendClassProps(Ie.prototype,Ie.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.0-beta.5",e="2025-11-20T06:27:34.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="00281e4709820d0afa9e74bfc1a9ec2635763d41",l=((Date.now()-1763620054e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2295
|
+
`;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const lt=class lt extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",Gh);m(this,"_moveObjectsProcess",this.ad(bC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new SF(this)),this.ad(new xF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new MF(this)})),this._viewerLegend=this.dv(new QO(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Rg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new TL(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ke(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],lt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=Jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&xr(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&xr(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&xr(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:Jo(e)}}transformFlyParam(e,n){if("position"in n){const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,Se(n.position),new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=n.rotation[0]-d,f=n.rotation[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const o=Se(e);let s={heading:h.Math.toRadians(n.heading),pitch:h.Math.toRadians(n.pitch),roll:0};const r=new h.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=h.Math.PI_OVER_TWO;const c=h.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=h.Matrix4.multiplyByPointAsVector(c,h.Cartesian3.UNIT_X,new h.Cartesian3);h.Cartesian3.multiplyByScalar(u,n.distance,u),h.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=h.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=h.Math.toRadians(n.pDelta));const l=se(o);return l?{position:l,rotation:[h.Math.toDegrees(s.heading),h.Math.toDegrees(s.pitch),h.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,lt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await bm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=lt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!lt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=lt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return yn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Se(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=lt.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",eN,jO,!0),new a.FunctionProperty([],()=>lt.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};m(lt,"type",lt.register("ESCesiumViewer",lt)),m(lt,"getCesiumIonToken",tN),m(lt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(lt,"latestDefaultAccessToken"),m(lt,"ObjectsToExcludeWrapper",TF),m(lt,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(lt,"getHeightsScartchCarto",new h.Cartographic);let Ie=lt;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...JO()})})(Ie||(Ie={})),a.extendClassProps(Ie.prototype,Ie.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.0-beta.6",e="2025-11-20T08:56:17.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="6c9e1359553c51eb55de57f108e863f1e889cc10",l=((Date.now()-1763628977e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2296
2296
|
%c${o?o+`
|
|
2297
2297
|
`:""}当前网站正在使用${t},此软件版权归${n}所有
|
|
2298
|
-
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
2298
|
+
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","6c9e1359553c51eb55de57f108e863f1e889cc10")},get info(){return c},get date(){return"2025-11-20T08:56:17.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.6"},get name(){return"earthsdk3-cesium"},get commitId(){return"6c9e1359553c51eb55de57f108e863f1e889cc10"},print(){console.info(this.info,`
|
|
2299
2299
|
font-size: 18px;
|
|
2300
2300
|
font-weight: 1000;
|
|
2301
2301
|
line-height: 1;
|
|
@@ -2312,4 +2312,4 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2312
2312
|
color: rgb(0, 120, 215);
|
|
2313
2313
|
padding-bottom: 2px;
|
|
2314
2314
|
padding-left: 35px;
|
|
2315
|
-
`)}}),globalThis.g_XE3CopyRights=globalThis.g_XE3CopyRights||{},globalThis.g_XE3CopyRights[t]=M.copyright,globalThis.g_earthsdk_copyright_print=globalThis.g_earthsdk_copyright_print??!0,globalThis.g_earthsdk_copyright_print&&M.copyright.print()}catch{}w_(),M.BaseEditingWrapper=Pt,M.CircularAppendEditing=vC,M.CircularAppendEditingWrapper=dg,M.CircularInsertEditing=wC,M.CircularInsertEditingWrapper=pg,M.CurrentPositionsCenter=yu,M.CurrentScale=vu,M.CurrentSceneScalePoi=wm,M.CursorFloatDiv=zP,M.CursorInfo=LP,M.Czm3DTiles=be,M.CzmCameraChanged=gc,M.CzmCanvasAndDivSwitchPoi=NP,M.CzmCanvasPoi=Fu,M.CzmCircle=go,M.CzmCircleGroundPrimitive=En,M.CzmCircleOutlinePrimitive=An,M.CzmCirclePrimitive=xn,M.CzmClippingPlanes=Is,M.CzmClock=ae,M.CzmCustomPrimitive=Fe,M.CzmDivPoi=zu,M.CzmES3DTileset=Ds,M.CzmESAlarm=Ud,M.CzmESApertureEffect=Wd,M.CzmESAreaMeasurement=Gd,M.CzmESBlastParticleSystem=Hd,M.CzmESBoxClipping=$d,M.CzmESCameraView=qd,M.CzmESCameraVisibleRange=Xd,M.CzmESCar=Yd,M.CzmESCityBasePoint=Qd,M.CzmESClassification=kd,M.CzmESClippingPlane=Nd,M.CzmESCustomPrimitive=Gp,M.CzmESCzml=Kd,M.CzmESDataMesh=Jd,M.CzmESDirectionMeasurement=jd,M.CzmESDistanceMeasurement=ep,M.CzmESDynamicWater=Hp,M.CzmESEntityCluster=$p,M.CzmESExcavate=tp,M.CzmESFireParticleSystem=ip,M.CzmESGeHistoryImagery=qp,M.CzmESGeoBezierPath=op,M.CzmESGeoDiv=sp,M.CzmESGeoDivTextPoi=rp,M.CzmESGeoExtrudedPolygon=Qf,M.CzmESGeoJson=ap,M.CzmESGeoLineString=Os,M.CzmESGeoPoints=ng,M.CzmESGeoPolygon=Yt,M.CzmESGeoPolygonImpl=Mi,M.CzmESGeoRectangle=lp,M.CzmESGeoSmoothPolygon=cp,M.CzmESGeoVector=yt,M.CzmESGeoWater=Xp,M.CzmESGltfModel=hp,M.CzmESHeatMap=ig,M.CzmESHeightMeasurement=up,M.CzmESHuman=pp,M.CzmESHumanPoi=kf,M.CzmESImageLabel=fp,M.CzmESImageryLayer=gp,M.CzmESKml=Mp,M.CzmESLabel=Hr,M.CzmESLocalCircle=Ip,M.CzmESLocalLineString=Dp,M.CzmESLocalLineStringZ=Rp,M.CzmESLocalPolygon=Fp,M.CzmESLocalPolygonZ=zp,M.CzmESLocalRectangle=Lp,M.CzmESLocalSkyBox=mp,M.CzmESLocalVector=dh,M.CzmESLocationMeasurement=vp,M.CzmESMVTLayer=bh,M.CzmESMsTileset=jf,M.CzmESNavigator=Op,M.CzmESObjectWithLocation=me,M.CzmESParticleSystemPrimitive=yp,M.CzmESPath=Np,M.CzmESPipeFence=Yp,M.CzmESPipeline=Zp,M.CzmESPipeserTileset=kp,M.CzmESPit=Kp,M.CzmESPoi2D=wp,M.CzmESPoi3D=Cp,M.CzmESPolygonFence=Bp,M.CzmESPolygonFlattenedPlane=Vd,M.CzmESPolygonWithHole=Jp,M.CzmESRectangle=Vp,M.CzmESRoad=Up,M.CzmESRtsFeatureEditing=Jf,M.CzmESRtsTileset=Kf,M.CzmESScale=Wp,M.CzmESSignalTransmission=cf,M.CzmESSkylineAnalysis=tg,M.CzmESStaticMesh=eg,M.CzmESSubmergingAnalysis=_p,M.CzmESSunshineAnalysis=Gf,M.CzmESSurfaceAreaMeasurement=$f,M.CzmESTerrainLayer=Pp,M.CzmESTextLabel=bp,M.CzmESUEWidget=Sp,M.CzmESUnrealActor=xp,M.CzmESVideoFusion=Ep,M.CzmESViewShed=Ap,M.CzmESViewerStatusBar=qf,M.CzmESViewerStatusBarScale=Xf,M.CzmESVisibilityAnalysis=Yf,M.CzmESVisualObject=jt,M.CzmESVolumeMeasurement=Zf,M.CzmESWidget=Tp,M.CzmFlattenedPlane=Nn,M.CzmGlobeMaterial=bo,M.CzmImageModel=qi,M.CzmImagery=Ln,M.CzmModelPrimitive=ct,M.CzmParticleSystemPrimitive=bi,M.CzmPicking=mm,M.CzmPoint=ti,M.CzmPointPrimitiveCollection=vo,M.CzmPoisContext=Rm,M.CzmPolygon=rs,M.CzmPolygonClipping=Ns,M.CzmPolygonGroundPrimitive=ss,M.CzmPolygonGroundPrimitiveWithHeight=po,M.CzmPolygonPrimitive=Cn,M.CzmPolygonPrimitiveWithHeight=bn,M.CzmPolygonWithHeight=Sn,M.CzmPolyline=xe,M.CzmPolylineGroundPrimitive=cs,M.CzmPolylinePrimitive=hs,M.CzmPolylines=fi,M.CzmPolylinesGroundPrimitive=os,M.CzmPolylinesPrimitive=Xt,M.CzmRectangle=Si,M.CzmSignalTransmission=Bn,M.CzmTexture=Oe,M.CzmView=Ft,M.CzmViewDistanceRangeControl=eo,M.CzmWater=mo,M.CzmWaterPrimitive=Mr,M.DoublePointsAppendEditing=ir,M.DoublePointsAppendEditingWrapper=hg,M.DoublePointsModifyEditing=Vo,M.DoublePointsModifyEditingWrapper=ug,M.ESCesiumViewer=Ie,M.ESCustomPrimitive=yh,M.ESGeHistoryImagery=gh,M.ESGeoBezierPath=_h,M.ESGeoSmoothPolygon=Yr,M.ESKml=mh,M.ESLocalLineString=vh,M.ESLocalLineStringZ=Xr,M.ESMVTLayer=fh,M.ESRoad=Ch,M.ESSignalTransmission=wh,M.GeoCanvasImagePoi=_i,M.GeoCanvasMenuPoi=as,M.GeoCanvasPoi=$i,M.GeoCanvasPointPoi=_n,M.GeoCustomDivPoi=Ge,M.GeoDivSwitchPoi=uo,M.GeoDivTextPoi=Pi,M.GeoPolylinePath=Bs,M.HeightModifyEditing=PC,M.HeightModifyEditingWrapper=Cg,M.ImageLabel2D=Oy,M.ImageLabel3D=Ny,M.ImageriesManager=UC,M.LabelManager=VC,M.LineStringAppendEditing=mC,M.LineStringAppendEditingWrapper=fg,M.LineStringInsertEditing=yC,M.LineStringInsertEditingWrapper=gg,M.PickingManager=WC,M.PlaceEditing=Ni,M.PlaceEditingWrapper=ag,M.PolylinePath=Ms,M.ResourceHandler=ns,M.RotationEditing=wi,M.RotationEditingWrapper=lg,M.ScaleEditing=sn,M.ScaleEditingWrapper=cg,M.ScatterAppendEditing=CC,M.ScatterAppendEditingWrapper=mg,M.ScatterModifyEditing=_C,M.ScatterModifyEditingWrapper=vg,M.ScreenManager=qC,M.SharedTexturePool=Im,M.SmoothMoving=ym,M.TerrainManager=BC,M.TextLabel2D=Vy,M.TextLabel3D=Uy,M.ToGCJ02WebMercatorTilingScheme=ty,M.ToWGS84WebMercatorTilingScheme=iy,M.TranslationEditing=on,M.TranslationEditingWrapper=Wh,M.ViewerExtensions=XC,M.VisibilityAppendEditing=nr,M.VisibilityAppendEditingWrapper=yg,M.VisibilityModifyEditing=or,M.VisibilityModifyEditingWrapper=wg,M.Widget2D=Pn,M.Widget3D=Mc,M.WinPosFromCartesian=vc,M.XbsjGroundPolylinePrimitive=Ti,M._ESEditModeInstance=Gh,M.angleToHumanStr=br,M.areaToHumanStr=N1,M.bindNorthRotation=je,M.calculateImageTiles=vm,M.capture=bm,M.checkAndConvertImage=O1,M.computeCutPoint=uC,M.computeCzmModelMatrix=Re,M.computePickingInfoWithCoordinates=su,M.createClippingPlaneCollection=wr,M.createClippingPolygonCollection=pc,M.createGeoBoudingSphereReactFromPositions=Pm,M.createHelperLine=H_,M.createInfoPoi=Eu,M.createInnerClassFromJson=Pu,M.createInnerHtmlWithWhiteTextBlackBackground=lo,M.createMaterialFromJson=Zg,M.createMaterialRef=pi,M.createMoveObjectsProcessing=bC,M.createPolygonHierarchy=Gi,M.createTexture=ro,M.createTextureFromImage=Du,M.createTilingSchema=di,M.czmEllipsoidWGS84=Am,M.czmFlyTo=xr,M.czmModelActiveAnimationsWithVisible=_c,M.czmSubscribeAndEvaluate=Ci,M.defaultFlyToRotation=ei,M.distanceToHumanStr=bc,M.extendComponentProps=B1,M.flyTo=ne,M.flyWithPosition=qt,M.flyWithPositions=oe,M.flyWithPrimitive=Rt,M.fromCartesian=__,M.fromCartesian2=Og,M.fromCartesian3=vr,M.fromCartesian4=Ng,M.fromCartographic=jn,M.fromColor=b_,M.fromDistanceDisplayCondition=E_,M.fromEllipsoid=z_,M.fromHeadingPitchRoll=x_,M.fromNearFarScalar=S_,M.fromQuaternion=T_,M.fromRectangle=R_,M.generateCartesianArc=am,M.geoNeareastPointOnRhumbLine=to,M.geoNeareastPointOnRhumbLine2=$_,M.geoPolylineToBezierSpline=Au,M.getCameraPosition=Ht,M.getCameraRotation=Jo,M.getCameraTargetPos=Wg,M.getCenterAndViewDistance=Tu,M.getCzmCode=I1,M.getDefaultComponentProps=V1,M.getDefaultWinPosAndDepth=J_,M.getDetailedTerrainDistance=Em,M.getDirectionVectorFromRotation=Jg,M.getDistancesAndTimePosRotsFromPositions=fu,M.getElevationMatrix=
|
|
2315
|
+
`)}}),globalThis.g_XE3CopyRights=globalThis.g_XE3CopyRights||{},globalThis.g_XE3CopyRights[t]=M.copyright,globalThis.g_earthsdk_copyright_print=globalThis.g_earthsdk_copyright_print??!0,globalThis.g_earthsdk_copyright_print&&M.copyright.print()}catch{}w_(),M.BaseEditingWrapper=Pt,M.CircularAppendEditing=vC,M.CircularAppendEditingWrapper=dg,M.CircularInsertEditing=wC,M.CircularInsertEditingWrapper=pg,M.CurrentPositionsCenter=yu,M.CurrentScale=vu,M.CurrentSceneScalePoi=wm,M.CursorFloatDiv=zP,M.CursorInfo=LP,M.Czm3DTiles=be,M.CzmCameraChanged=gc,M.CzmCanvasAndDivSwitchPoi=NP,M.CzmCanvasPoi=Fu,M.CzmCircle=go,M.CzmCircleGroundPrimitive=En,M.CzmCircleOutlinePrimitive=An,M.CzmCirclePrimitive=xn,M.CzmClippingPlanes=Is,M.CzmClock=ae,M.CzmCustomPrimitive=Fe,M.CzmDivPoi=zu,M.CzmES3DTileset=Ds,M.CzmESAlarm=Ud,M.CzmESApertureEffect=Wd,M.CzmESAreaMeasurement=Gd,M.CzmESBlastParticleSystem=Hd,M.CzmESBoxClipping=$d,M.CzmESCameraView=qd,M.CzmESCameraVisibleRange=Xd,M.CzmESCar=Yd,M.CzmESCityBasePoint=Qd,M.CzmESClassification=kd,M.CzmESClippingPlane=Nd,M.CzmESCustomPrimitive=Gp,M.CzmESCzml=Kd,M.CzmESDataMesh=Jd,M.CzmESDirectionMeasurement=jd,M.CzmESDistanceMeasurement=ep,M.CzmESDynamicWater=Hp,M.CzmESEntityCluster=$p,M.CzmESExcavate=tp,M.CzmESFireParticleSystem=ip,M.CzmESGeHistoryImagery=qp,M.CzmESGeoBezierPath=op,M.CzmESGeoDiv=sp,M.CzmESGeoDivTextPoi=rp,M.CzmESGeoExtrudedPolygon=Qf,M.CzmESGeoJson=ap,M.CzmESGeoLineString=Os,M.CzmESGeoPoints=ng,M.CzmESGeoPolygon=Yt,M.CzmESGeoPolygonImpl=Mi,M.CzmESGeoRectangle=lp,M.CzmESGeoSmoothPolygon=cp,M.CzmESGeoVector=yt,M.CzmESGeoWater=Xp,M.CzmESGltfModel=hp,M.CzmESHeatMap=ig,M.CzmESHeightMeasurement=up,M.CzmESHuman=pp,M.CzmESHumanPoi=kf,M.CzmESImageLabel=fp,M.CzmESImageryLayer=gp,M.CzmESKml=Mp,M.CzmESLabel=Hr,M.CzmESLocalCircle=Ip,M.CzmESLocalLineString=Dp,M.CzmESLocalLineStringZ=Rp,M.CzmESLocalPolygon=Fp,M.CzmESLocalPolygonZ=zp,M.CzmESLocalRectangle=Lp,M.CzmESLocalSkyBox=mp,M.CzmESLocalVector=dh,M.CzmESLocationMeasurement=vp,M.CzmESMVTLayer=bh,M.CzmESMsTileset=jf,M.CzmESNavigator=Op,M.CzmESObjectWithLocation=me,M.CzmESParticleSystemPrimitive=yp,M.CzmESPath=Np,M.CzmESPipeFence=Yp,M.CzmESPipeline=Zp,M.CzmESPipeserTileset=kp,M.CzmESPit=Kp,M.CzmESPoi2D=wp,M.CzmESPoi3D=Cp,M.CzmESPolygonFence=Bp,M.CzmESPolygonFlattenedPlane=Vd,M.CzmESPolygonWithHole=Jp,M.CzmESRectangle=Vp,M.CzmESRoad=Up,M.CzmESRtsFeatureEditing=Jf,M.CzmESRtsTileset=Kf,M.CzmESScale=Wp,M.CzmESSignalTransmission=cf,M.CzmESSkylineAnalysis=tg,M.CzmESStaticMesh=eg,M.CzmESSubmergingAnalysis=_p,M.CzmESSunshineAnalysis=Gf,M.CzmESSurfaceAreaMeasurement=$f,M.CzmESTerrainLayer=Pp,M.CzmESTextLabel=bp,M.CzmESUEWidget=Sp,M.CzmESUnrealActor=xp,M.CzmESVideoFusion=Ep,M.CzmESViewShed=Ap,M.CzmESViewerStatusBar=qf,M.CzmESViewerStatusBarScale=Xf,M.CzmESVisibilityAnalysis=Yf,M.CzmESVisualObject=jt,M.CzmESVolumeMeasurement=Zf,M.CzmESWidget=Tp,M.CzmFlattenedPlane=Nn,M.CzmGlobeMaterial=bo,M.CzmImageModel=qi,M.CzmImagery=Ln,M.CzmModelPrimitive=ct,M.CzmParticleSystemPrimitive=bi,M.CzmPicking=mm,M.CzmPoint=ti,M.CzmPointPrimitiveCollection=vo,M.CzmPoisContext=Rm,M.CzmPolygon=rs,M.CzmPolygonClipping=Ns,M.CzmPolygonGroundPrimitive=ss,M.CzmPolygonGroundPrimitiveWithHeight=po,M.CzmPolygonPrimitive=Cn,M.CzmPolygonPrimitiveWithHeight=bn,M.CzmPolygonWithHeight=Sn,M.CzmPolyline=xe,M.CzmPolylineGroundPrimitive=cs,M.CzmPolylinePrimitive=hs,M.CzmPolylines=fi,M.CzmPolylinesGroundPrimitive=os,M.CzmPolylinesPrimitive=Xt,M.CzmRectangle=Si,M.CzmSignalTransmission=Bn,M.CzmTexture=Oe,M.CzmView=Ft,M.CzmViewDistanceRangeControl=eo,M.CzmWater=mo,M.CzmWaterPrimitive=Mr,M.DoublePointsAppendEditing=ir,M.DoublePointsAppendEditingWrapper=hg,M.DoublePointsModifyEditing=Vo,M.DoublePointsModifyEditingWrapper=ug,M.ESCesiumViewer=Ie,M.ESCustomPrimitive=yh,M.ESGeHistoryImagery=gh,M.ESGeoBezierPath=_h,M.ESGeoSmoothPolygon=Yr,M.ESKml=mh,M.ESLocalLineString=vh,M.ESLocalLineStringZ=Xr,M.ESMVTLayer=fh,M.ESRoad=Ch,M.ESSignalTransmission=wh,M.GeoCanvasImagePoi=_i,M.GeoCanvasMenuPoi=as,M.GeoCanvasPoi=$i,M.GeoCanvasPointPoi=_n,M.GeoCustomDivPoi=Ge,M.GeoDivSwitchPoi=uo,M.GeoDivTextPoi=Pi,M.GeoPolylinePath=Bs,M.HeightModifyEditing=PC,M.HeightModifyEditingWrapper=Cg,M.ImageLabel2D=Oy,M.ImageLabel3D=Ny,M.ImageriesManager=UC,M.LabelManager=VC,M.LineStringAppendEditing=mC,M.LineStringAppendEditingWrapper=fg,M.LineStringInsertEditing=yC,M.LineStringInsertEditingWrapper=gg,M.PickingManager=WC,M.PlaceEditing=Ni,M.PlaceEditingWrapper=ag,M.PolylinePath=Ms,M.ResourceHandler=ns,M.RotationEditing=wi,M.RotationEditingWrapper=lg,M.ScaleEditing=sn,M.ScaleEditingWrapper=cg,M.ScatterAppendEditing=CC,M.ScatterAppendEditingWrapper=mg,M.ScatterModifyEditing=_C,M.ScatterModifyEditingWrapper=vg,M.ScreenManager=qC,M.SharedTexturePool=Im,M.SmoothMoving=ym,M.TerrainManager=BC,M.TextLabel2D=Vy,M.TextLabel3D=Uy,M.ToGCJ02WebMercatorTilingScheme=ty,M.ToWGS84WebMercatorTilingScheme=iy,M.TranslationEditing=on,M.TranslationEditingWrapper=Wh,M.ViewerExtensions=XC,M.VisibilityAppendEditing=nr,M.VisibilityAppendEditingWrapper=yg,M.VisibilityModifyEditing=or,M.VisibilityModifyEditingWrapper=wg,M.Widget2D=Pn,M.Widget3D=Mc,M.WinPosFromCartesian=vc,M.XbsjGroundPolylinePrimitive=Ti,M._ESEditModeInstance=Gh,M.angleToHumanStr=br,M.areaToHumanStr=N1,M.bindNorthRotation=je,M.calculateImageTiles=vm,M.capture=bm,M.checkAndConvertImage=O1,M.computeCutPoint=uC,M.computeCzmModelMatrix=Re,M.computePickingInfoWithCoordinates=su,M.createClippingPlaneCollection=wr,M.createClippingPolygonCollection=pc,M.createGeoBoudingSphereReactFromPositions=Pm,M.createHelperLine=H_,M.createInfoPoi=Eu,M.createInnerClassFromJson=Pu,M.createInnerHtmlWithWhiteTextBlackBackground=lo,M.createMaterialFromJson=Zg,M.createMaterialRef=pi,M.createMoveObjectsProcessing=bC,M.createPolygonHierarchy=Gi,M.createTexture=ro,M.createTextureFromImage=Du,M.createTilingSchema=di,M.czmEllipsoidWGS84=Am,M.czmFlyTo=xr,M.czmModelActiveAnimationsWithVisible=_c,M.czmSubscribeAndEvaluate=Ci,M.defaultFlyToRotation=ei,M.distanceToHumanStr=bc,M.extendComponentProps=B1,M.flyTo=ne,M.flyWithPosition=qt,M.flyWithPositions=oe,M.flyWithPrimitive=Rt,M.fromCartesian=__,M.fromCartesian2=Og,M.fromCartesian3=vr,M.fromCartesian4=Ng,M.fromCartographic=jn,M.fromColor=b_,M.fromDistanceDisplayCondition=E_,M.fromEllipsoid=z_,M.fromHeadingPitchRoll=x_,M.fromNearFarScalar=S_,M.fromQuaternion=T_,M.fromRectangle=R_,M.generateCartesianArc=am,M.geoNeareastPointOnRhumbLine=to,M.geoNeareastPointOnRhumbLine2=$_,M.geoPolylineToBezierSpline=Au,M.getCameraPosition=Ht,M.getCameraRotation=Jo,M.getCameraTargetPos=Wg,M.getCenterAndViewDistance=Tu,M.getCzmCode=I1,M.getDefaultComponentProps=V1,M.getDefaultWinPosAndDepth=J_,M.getDetailedTerrainDistance=Em,M.getDirectionVectorFromRotation=Jg,M.getDistancesAndTimePosRotsFromPositions=fu,M.getElevationMatrix=kO,M.getEllipsoidGeodesicCenter=cu,M.getFlyToCenterAndRotation=Sc,M.getFoveatedInterpolationCallback=py,M.getFuncFromStr=bu,M.getGroundTerrainDistance=xm,M.getGroundTerrainDistances=Sm,M.getIncludedAngleFromPositions=um,M.getInverseModelMatrix=cm,M.getMinMaxPosition=_m,M.getModelMatrixFromPosition=gu,M.getObjectProperties=co,M.getPointerEventButton=Hi,M.getPolygonPointsFromHierarchy=mu,M.getQuaternion=tu,M.getQuaternionWithXForwardZUp=Vg,M.getQuaternionWithYForwardZUp=fc,M.getResource=$t,M.getSceneScaleForScreenPixelSize=Wi,M.getSharedTexturePool=Dm,M.getTilingSchemeStr=Zx,M.getViewerExtensions=Ke,M.getWinPos=Kg,M.getXbsjWaterMaterial=pm,M.hackCesium3DTileset=h_,M.hackCzmModel3DTileContent=u_,M.hackModel=c_,M.hackModelSceneGraph=d_,M.imgUrlToBase64=ho,M.localPositionToPosition=vn,M.localPositionsToPositions=yn,M.merge3dTilesServer=b1,M.pickHeightPosition=mc,M.pickPosition=Xg,M.pickVirtualEarth=jo,M.pickVirtualPlane=Yg,M.positionAndRotationToQuaternion=D_,M.positionFromCartesian=se,M.positionToCartesian=Se,M.positionToHumanStr=Su,M.positionToLocalPosition=hm,M.positionsToLocalPositions=Dt,M.positionsToUniqueCartesians=pt,M.rectangleIsGlobal=_u,M.rpToap=Pc,M.setClippingPlaneCollection=dc,M.setCylinderGeometry=xu,M.setModelMaterial=Pr,M.setRectangleGeometry=Cm,M.setViewerExtensions=Ag,M.toCartesian=ui,M.toCartesian2=Pe,M.toCartesian3=hi,M.toCartesian4=eu,M.toCartographic=P_,M.toCoefficients=Cu,M.toColor=te,M.toDistanceDisplayCondition=yr,M.toEllipsoid=Ce,M.toHeadingPitchRoll=Bg,M.toNearFarScalar=dn,M.toQuaternion=A_,M.toRectangle=Ve,M.toRgbaString=wn,M.updateEnvironmentMapManager=wu,M.updateMaterialFromJson=lu,M.waterType=xc,M.winPosAndDepthEqual=kg,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|