earthsdk3-cesium 3.6.0-beta.5 → 3.6.0-beta.7
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 +133 -133
- package/dist/earthsdk3-cesium.js +344 -318
- package/dist/earthsdk3-cesium.umd.cjs +23 -23
- package/dist/types/CzmObjects/general/CzmES3DTileset/Czm3DTiles/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.d.ts +2 -2
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/index.d.ts +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/EventManager.d.ts +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/EventManager.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/ESCesiumViewer/ViewerExtensions/VectorTilesManager/TileLoader.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/TileRenderer.d.ts +2 -2
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/TileRenderer.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/index.d.ts +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/VectorTilesManager/index.d.ts.map +1 -1
- package/dist/types/utils/czmUtils/calculateImageTiles.d.ts +2 -2
- package/dist/types/utils/czmUtils/calculateImageTiles.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 +2 -2
|
@@ -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()})})}fetch("https://cdn.jsdelivr.net/gh/CesiumGS/cesium/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))}).catch(t=>{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},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
viewer.scene.primitives.add(tileset);
|
|
89
89
|
viewer.flyTo(tileset);
|
|
90
90
|
return tileset;
|
|
91
|
-
})();`}function M1(t){let i,e=typeof t=="string"?t:t.url;if(e.startsWith("Ion(")){let n=/Ion\((\d+)/.exec(e);if(n){let o=n[1]&&+n[1];o&&(i=`"await Cesium.IonResource.fromAssetId(${o})"`)}}return i=i||`"${a.ESSceneObject.context.getStrFromEnv(e)}"`,i}function I1(t){return t instanceof a.ESImageryLayer?A1(t):t instanceof a.ESTerrainLayer?x1(t):t instanceof a.ES3DTileset?T1(t):"getCzmCode目前只支持影像地形或瓦片"}function wu(t,i){var e,n,o,s,r,l,c,u,d;t.atmosphereScatteringIntensity=((e=i.environmentMapManager)==null?void 0:e.atmosphereScatteringIntensity)??be.defaults.environmentMapManager.atmosphereScatteringIntensity,t.brightness=((n=i.environmentMapManager)==null?void 0:n.brightness)??be.defaults.environmentMapManager.brightness,t.enabled=((o=i.environmentMapManager)==null?void 0:o.enabled)??be.defaults.environmentMapManager.enabled,t.gamma=((s=i.environmentMapManager)==null?void 0:s.gamma)??be.defaults.environmentMapManager.gamma,t.groundAlbedo=((r=i.environmentMapManager)==null?void 0:r.groundAlbedo)??be.defaults.environmentMapManager.groundAlbedo,t.groundColor=te(((l=i.environmentMapManager)==null?void 0:l.groundColor)??be.defaults.environmentMapManager.groundColor),t.maximumPositionEpsilon=((c=i.environmentMapManager)==null?void 0:c.maximumPositionEpsilon)??be.defaults.environmentMapManager.maximumPositionEpsilon,t.maximumSecondsDifference=((u=i.environmentMapManager)==null?void 0:u.maximumSecondsDifference)??be.defaults.environmentMapManager.maximumSecondsDifference,t.saturation=((d=i.environmentMapManager)==null?void 0:d.saturation)??be.defaults.environmentMapManager.saturation,t.reset()}function Cu(t){if(!Array.isArray(t)||t.length!==9){console.warn("toCoefficients error.");return}const i=new h.Cartesian3(...t[0]),e=new h.Cartesian3(...t[1]),n=new h.Cartesian3(...t[2]),o=new h.Cartesian3(...t[3]),s=new h.Cartesian3(...t[4]),r=new h.Cartesian3(...t[5]),l=new h.Cartesian3(...t[6]),c=new h.Cartesian3(...t[7]),u=new h.Cartesian3(...t[8]);return[i,e,n,o,s,r,l,c,u]}class _c extends a.Destroyable{constructor(i,e){super(),this.dispose(i.scene.preUpdate.addEventListener(()=>{const n=e.primitive,{scene:o,camera:s}=i;if(n&&n.ready){const r=n.boundingSphere.radius*2/s.getPixelSize(n.boundingSphere,o.drawingBufferWidth,o.drawingBufferHeight),c=i.camera.frustum.computeCullingVolume(s.position,s.direction,s.up).computeVisibility(n.boundingSphere);e.activeAnimationsAnimateWhilePaused=!(c===h.Intersect.OUTSIDE||r<5||!e.show||!e.activeAnimationsJson)}}))}}const fm=new h.BoundingRectangle(0,0,1,1),D1=new h.Color(0,0,0,0),ao=new h.Cartesian3,R1=new h.Cartesian2,F1=new h.Cesium3DTilePassState({pass:h.Cesium3DTilePass.PICK}),gm=new h.Cartesian4(1,1/255,1/65025,1/16581375);class mm extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"frustumPrimitives");m(this,"pointPrimitives");m(this,"flipY",function(e,n,o){if(o===1)return e;const s=new Array(e.length);for(let r=0;r<o;++r){const l=r*n,c=(o-r-1)*n;for(let u=0;u<n;++u)s[c+u]=e[l+u]}return s});this.viewer=e,this.ad(()=>{this.clearFrustumPrimitives(),this.clearPointPrimitives()})}clearFrustumPrimitives(){this.frustumPrimitives&&(this.frustumPrimitives.removeAll(),this.viewer.scene.primitives.remove(this.frustumPrimitives))}clearPointPrimitives(){this.pointPrimitives&&(this.pointPrimitives.removeAll(),this.viewer.scene.primitives.remove(this.pointPrimitives))}getRayIntersection(e,n,o,s,r=!1,l=!1){var R;r?this.frustumPrimitives?this.frustumPrimitives.removeAll():this.frustumPrimitives=this.viewer.scene.primitives.add(new h.PrimitiveCollection):this.clearFrustumPrimitives(),l?this.pointPrimitives?this.pointPrimitives.removeAll():this.pointPrimitives=this.viewer.scene.primitives.add(new h.PointPrimitiveCollection):this.clearPointPrimitives();const{viewer:c}=this,{scene:u,camera:d}=c,p=new h.Ray(d.position,d.direction),f=d.up,g=new h.Picking(u),{context:v,frameState:y}=u,w=v.uniformState,P=g._pickOffscreenView,_=new h.BoundingRectangle(0,0,o,s);P.viewport=_,P.passState.viewport=_,u.view=P,this.updateOffscreenCameraFromRay(p,f,P.camera,e,n),h.BoundingRectangle.clone(P.viewport,fm);const S=P.pickFramebuffer.begin(fm,P.viewport);u.jobScheduler.disableThisFrame(),u.updateFrameState(),y.invertClassification=!1,y.passes.pick=!0,y.passes.offscreen=!0,y.tilesetPassState=F1,w.update(y),u.updateEnvironment(),u.updateAndExecuteCommands(S,D1),u.resolveFramebuffers(S);let{depths:E,positions:A}=this.pickPositions(p,g,u,e,n);return r&&((R=this.frustumPrimitives)==null||R.add(this.getFrustumOutline(P.camera))),l&&A&&A.forEach(O=>{var B;(B=this.pointPrimitives)==null||B.add({pixelSize:5,color:h.Color.GREEN,position:O})}),u.view=u.defaultView,v.endFrame(),{depths:E,positions:A}}pickPositions(e,n,o,s,r){let l=[],c=[];const{context:u}=o;if(!u.depthTexture)return{tempDepths:l,tempPositions:c};const d=n._pickOffscreenView,{camera:p}=d,f=d.frustumCommandsList.length,g=new h.Cartesian3;for(let v=0;v<f;++v){const y=n.getPickDepth(o,v),w=this.getDepths(u,0,0,d.viewport.width,d.viewport.height,y.framebuffer);for(let P=0,_=w.length;P<_;P++){const S=w[P];if(h.defined(S)&&S>0&&S<1){const E=d.frustumCommandsList[v],A=E.near*(P!==0?o.opaqueFrustumNearOffset:1),R=E.far,O=A+S*(R-A),B=Math.floor(P/d.viewport.width),V=P%d.viewport.width,U=(B-d.viewport.height/2)*(r/d.viewport.height),z=(V-d.viewport.width/2)*(s/d.viewport.width),N=new h.Cartesian3;h.Cartesian3.multiplyByScalar(p.up,U,g),h.Cartesian3.add(g,p.position,N),h.Cartesian3.multiplyByScalar(p.right,z,g),h.Cartesian3.add(g,N,N);const C=h.Ray.clone(e);C.origin=N;const x=h.Ray.getPoint(C,O);!l[P]&&(l[P]=S),!c[P]&&(c[P]=x)}}}return{depths:l,positions:c}}getDepths(e,n,o,s,r,l){const c=e.readPixels({x:n,y:o,width:s,height:r,framebuffer:l});return h.Cartesian4.unpackArray(c).map(d=>(h.Cartesian4.divideByScalar(d,255,d),h.Cartesian4.dot(d,gm)))}updateOffscreenCameraFromRay(e,n,o,s,r){const l=e.direction,c=h.Cartesian3.cross(l,n,ao);return o.position=e.origin,o.direction=l,o.up=n,o.right=c,o.frustum.width=s,o.frustum.aspectRatio=s/r,o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}getFrustumOutline(e){const n=new h.Matrix3,o=h.Cartesian3.negate(e.rightWC,new h.Cartesian3);h.Matrix3.setColumn(n,0,o,n),h.Matrix3.setColumn(n,1,e.upWC,n),h.Matrix3.setColumn(n,2,e.directionWC,n);const s=new h.GeometryInstance({geometry:new h.FrustumOutlineGeometry({frustum:e.frustum,origin:e.positionWC,orientation:h.Quaternion.fromRotationMatrix(n,new h.Quaternion)}),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(h.Color.WHITE)}});return new h.Primitive({geometryInstances:s,appearance:new h.PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1})}async getDepthsFromScreen(){let e;return await new Promise((o,s)=>{const r=this.viewer.scene.postRender.addEventListener(()=>{var l;if(!e&&(e=(l=this.viewer.scene.view.pickDepths[0])==null?void 0:l.framebuffer,e)){const c=this.viewer.scene.context.readPixels({framebuffer:e}),u=h.Cartesian4.unpackArray(c);r(),o(u.map(d=>(h.Cartesian4.divideByScalar(d,255,d),h.Cartesian4.dot(d,gm))))}})})}getSkylineDepthsAndPositions(e,n,o,s){const r=this.viewer.scene;e=this.flipY(e,n,o);const l=[],c=[],u=[];for(let d=0;d<n;++d)for(let p=0;p<o;++p){const f=p*n+d;if(e[f]!==0||p==o-1){if(l.push([d,p]),c.push(e[f]),e[f]!==0){const g=h.SceneTransforms.transformWindowToDrawingBuffer(r,h.Cartesian3.fromArray([d,p]),R1);g.y=r.drawingBufferHeight-g.y;let v=h.SceneTransforms.drawingBufferToWorldCoordinates(r,g,e[f],ao);if(h.Cartesian3.distance(r.camera.position,v)>s){const w=h.Cartesian3.normalize(h.Cartesian3.subtract(v,r.camera.position,ao),ao);h.Cartesian3.multiplyByScalar(w,s,ao),v=h.Cartesian3.add(r.camera.position,ao,ao)}const y=se(v);y&&u.push(y)}break}}return{windowPositions:l,depths:c,positions:u}}}const z1=new h.Rectangle;function vm(t,i,e){let n=new Set;if(!i)return[];if(Array.isArray(t)||(t=[t]),t.length==0)return[];const o=di(e.tilingScheme??{type:"WebMercatorTilingScheme"})??new h.WebMercatorTilingScheme,s={tilingScheme:o,rectangle:h.Rectangle.intersection(e.rectangle?h.Rectangle.fromDegrees(...e.rectangle):h.Rectangle.MAX_VALUE,o.rectangle),maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel??0,tileWidth:e.tileWidth??256,tileHeight:e.tileHeight??256},r=s.tilingScheme;for(let l=0;l<t.length;l++){const c=t[l],u=h.Rectangle.intersection(c.rectangle,s.rectangle,z1);if(!u)continue;u.south>0?u.south:u.north<0&&u.north;const d=i.getLevelMaximumGeometricError(c.level);let p=L1(s,d,Math.abs(u.south)<Math.abs(u.north)?u.south:u.north);p=Math.max(0,p);const f=e.maximumLevel;f!==void 0&&(p=Math.min(p,f));const g=e.minimumLevel;g!==void 0&&(p=Math.max(p,g));const v=r.positionToTileXY(h.Rectangle.northwest(u),p),y=r.positionToTileXY(h.Rectangle.southeast(u),p),w=c.rectangle.width/512,P=c.rectangle.height/512,_=r.tileXYToRectangle(v.x,v.y,p);Math.abs(_.south-c.rectangle.north)<P&&v.y<y.y&&++v.y,Math.abs(_.east-c.rectangle.west)<w&&v.x<y.x&&++v.x;const S=r.tileXYToRectangle(y.x,y.y,p);Math.abs(S.north-c.rectangle.south)<P&&y.y>v.y&&--y.y,Math.abs(S.west-c.rectangle.east)<w&&y.x>v.x&&--y.x;for(let E=v.x;E<=y.x;E++)for(let A=v.y;A<=y.y;A++)n.add({x:E,y:A,level:p})}return Array.from(n)}function L1(t,i,e){const n=t.tilingScheme,o=n.ellipsoid,s=n.projection instanceof h.GeographicProjection?1:Math.cos(e),r=n.rectangle,c=o.maximumRadius*r.width*s/(t.tileWidth*n.getNumberOfXTilesAtLevel(0))/i,u=Math.log(c)/Math.log(2);return Math.round(u)|0}function wn(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function _u(t){return Math.abs(t[0])==180&&Math.abs(t[1])==90&&Math.abs(t[2])==180&&Math.abs(t[3])==90}function je(t,i){const[e]=a.getReactFuncs(i);return a.bind(t,i,n=>{const[o,s,r]=n??[0,0,0];return[o+90,s,r]},n=>{const[o,s,r]=n??[0,0,0];if(!(!e()&&o===-90&&s===0&&r===0))return[Math.abs(o-90)<1e-9?0:o-90,s,r]})}function Pu(t,i,e){const n=new i(e),o=["id","type"];for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const r=t[s];Reflect.has(n,s)&&!o.includes(s)&&(n[s]=r)}return n}class ym extends a.Destroyable{constructor(){super(...arguments);m(this,"_currentPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_currentHeading",this.disposeVar(a.react(void 0)));m(this,"_startPosition",[0,0,0]);m(this,"_processing",this.disposeVar(a.createProcessingFromAsyncFunc(async(e,n,o)=>{const{currentPosition:s}=this;if(!s||o<=0){this._currentPosition.value=n;return}const r=this._startPosition;let l=Date.now();r.splice(0,3,...s);const c=a.geoHeading(r,n);this._currentHeading.value=c;const d=a.geoDistance(r,n)/o;await e.promise(new Promise(p=>{e.disposer.dispose(a.animateFrame(()=>{let f=Date.now()-l;f=f<0?0:f,f=f>o?o:f;const g=f*d,v=a.geoDestination(r,g,c);this._currentPosition.value=v,f===o&&(this._currentPosition.value=n,p())}))}))})))}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get processing(){return this._processing}restart(e,n){this._processing.restart(void 0,e,n)}cancel(){this._processing.cancel()}}function bu(t,i){const e=t.trim();if(e){try{const n=Function('"use strict";return ('+e+")")();if(typeof n=="function")return n}catch(n){console.info(`firstTryFunc get error! ${n}`)}try{const n=`function (${(i??[]).join(", ")}) {
|
|
91
|
+
})();`}function M1(t){let i,e=typeof t=="string"?t:t.url;if(e.startsWith("Ion(")){let n=/Ion\((\d+)/.exec(e);if(n){let o=n[1]&&+n[1];o&&(i=`"await Cesium.IonResource.fromAssetId(${o})"`)}}return i=i||`"${a.ESSceneObject.context.getStrFromEnv(e)}"`,i}function I1(t){return t instanceof a.ESImageryLayer?A1(t):t instanceof a.ESTerrainLayer?x1(t):t instanceof a.ES3DTileset?T1(t):"getCzmCode目前只支持影像地形或瓦片"}function wu(t,i){var e,n,o,s,r,l,c,u,d;t.atmosphereScatteringIntensity=((e=i.environmentMapManager)==null?void 0:e.atmosphereScatteringIntensity)??be.defaults.environmentMapManager.atmosphereScatteringIntensity,t.brightness=((n=i.environmentMapManager)==null?void 0:n.brightness)??be.defaults.environmentMapManager.brightness,t.enabled=((o=i.environmentMapManager)==null?void 0:o.enabled)??be.defaults.environmentMapManager.enabled,t.gamma=((s=i.environmentMapManager)==null?void 0:s.gamma)??be.defaults.environmentMapManager.gamma,t.groundAlbedo=((r=i.environmentMapManager)==null?void 0:r.groundAlbedo)??be.defaults.environmentMapManager.groundAlbedo,t.groundColor=te(((l=i.environmentMapManager)==null?void 0:l.groundColor)??be.defaults.environmentMapManager.groundColor),t.maximumPositionEpsilon=((c=i.environmentMapManager)==null?void 0:c.maximumPositionEpsilon)??be.defaults.environmentMapManager.maximumPositionEpsilon,t.maximumSecondsDifference=((u=i.environmentMapManager)==null?void 0:u.maximumSecondsDifference)??be.defaults.environmentMapManager.maximumSecondsDifference,t.saturation=((d=i.environmentMapManager)==null?void 0:d.saturation)??be.defaults.environmentMapManager.saturation,t.reset()}function Cu(t){if(!Array.isArray(t)||t.length!==9){console.warn("toCoefficients error.");return}const i=new h.Cartesian3(...t[0]),e=new h.Cartesian3(...t[1]),n=new h.Cartesian3(...t[2]),o=new h.Cartesian3(...t[3]),s=new h.Cartesian3(...t[4]),r=new h.Cartesian3(...t[5]),l=new h.Cartesian3(...t[6]),c=new h.Cartesian3(...t[7]),u=new h.Cartesian3(...t[8]);return[i,e,n,o,s,r,l,c,u]}class _c extends a.Destroyable{constructor(i,e){super(),this.dispose(i.scene.preUpdate.addEventListener(()=>{const n=e.primitive,{scene:o,camera:s}=i;if(n&&n.ready){const r=n.boundingSphere.radius*2/s.getPixelSize(n.boundingSphere,o.drawingBufferWidth,o.drawingBufferHeight),c=i.camera.frustum.computeCullingVolume(s.position,s.direction,s.up).computeVisibility(n.boundingSphere);e.activeAnimationsAnimateWhilePaused=!(c===h.Intersect.OUTSIDE||r<5||!e.show||!e.activeAnimationsJson)}}))}}const fm=new h.BoundingRectangle(0,0,1,1),D1=new h.Color(0,0,0,0),ao=new h.Cartesian3,R1=new h.Cartesian2,F1=new h.Cesium3DTilePassState({pass:h.Cesium3DTilePass.PICK}),gm=new h.Cartesian4(1,1/255,1/65025,1/16581375);class mm extends a.Destroyable{constructor(e){super();m(this,"viewer");m(this,"frustumPrimitives");m(this,"pointPrimitives");m(this,"flipY",function(e,n,o){if(o===1)return e;const s=new Array(e.length);for(let r=0;r<o;++r){const l=r*n,c=(o-r-1)*n;for(let u=0;u<n;++u)s[c+u]=e[l+u]}return s});this.viewer=e,this.ad(()=>{this.clearFrustumPrimitives(),this.clearPointPrimitives()})}clearFrustumPrimitives(){this.frustumPrimitives&&(this.frustumPrimitives.removeAll(),this.viewer.scene.primitives.remove(this.frustumPrimitives))}clearPointPrimitives(){this.pointPrimitives&&(this.pointPrimitives.removeAll(),this.viewer.scene.primitives.remove(this.pointPrimitives))}getRayIntersection(e,n,o,s,r=!1,l=!1){var R;r?this.frustumPrimitives?this.frustumPrimitives.removeAll():this.frustumPrimitives=this.viewer.scene.primitives.add(new h.PrimitiveCollection):this.clearFrustumPrimitives(),l?this.pointPrimitives?this.pointPrimitives.removeAll():this.pointPrimitives=this.viewer.scene.primitives.add(new h.PointPrimitiveCollection):this.clearPointPrimitives();const{viewer:c}=this,{scene:u,camera:d}=c,p=new h.Ray(d.position,d.direction),f=d.up,g=new h.Picking(u),{context:v,frameState:y}=u,w=v.uniformState,P=g._pickOffscreenView,_=new h.BoundingRectangle(0,0,o,s);P.viewport=_,P.passState.viewport=_,u.view=P,this.updateOffscreenCameraFromRay(p,f,P.camera,e,n),h.BoundingRectangle.clone(P.viewport,fm);const S=P.pickFramebuffer.begin(fm,P.viewport);u.jobScheduler.disableThisFrame(),u.updateFrameState(),y.invertClassification=!1,y.passes.pick=!0,y.passes.offscreen=!0,y.tilesetPassState=F1,w.update(y),u.updateEnvironment(),u.updateAndExecuteCommands(S,D1),u.resolveFramebuffers(S);let{depths:E,positions:A}=this.pickPositions(p,g,u,e,n);return r&&((R=this.frustumPrimitives)==null||R.add(this.getFrustumOutline(P.camera))),l&&A&&A.forEach(O=>{var B;(B=this.pointPrimitives)==null||B.add({pixelSize:5,color:h.Color.GREEN,position:O})}),u.view=u.defaultView,v.endFrame(),{depths:E,positions:A}}pickPositions(e,n,o,s,r){let l=[],c=[];const{context:u}=o;if(!u.depthTexture)return{tempDepths:l,tempPositions:c};const d=n._pickOffscreenView,{camera:p}=d,f=d.frustumCommandsList.length,g=new h.Cartesian3;for(let v=0;v<f;++v){const y=n.getPickDepth(o,v),w=this.getDepths(u,0,0,d.viewport.width,d.viewport.height,y.framebuffer);for(let P=0,_=w.length;P<_;P++){const S=w[P];if(h.defined(S)&&S>0&&S<1){const E=d.frustumCommandsList[v],A=E.near*(P!==0?o.opaqueFrustumNearOffset:1),R=E.far,O=A+S*(R-A),B=Math.floor(P/d.viewport.width),V=P%d.viewport.width,U=(B-d.viewport.height/2)*(r/d.viewport.height),z=(V-d.viewport.width/2)*(s/d.viewport.width),N=new h.Cartesian3;h.Cartesian3.multiplyByScalar(p.up,U,g),h.Cartesian3.add(g,p.position,N),h.Cartesian3.multiplyByScalar(p.right,z,g),h.Cartesian3.add(g,N,N);const C=h.Ray.clone(e);C.origin=N;const x=h.Ray.getPoint(C,O);!l[P]&&(l[P]=S),!c[P]&&(c[P]=x)}}}return{depths:l,positions:c}}getDepths(e,n,o,s,r,l){const c=e.readPixels({x:n,y:o,width:s,height:r,framebuffer:l});return h.Cartesian4.unpackArray(c).map(d=>(h.Cartesian4.divideByScalar(d,255,d),h.Cartesian4.dot(d,gm)))}updateOffscreenCameraFromRay(e,n,o,s,r){const l=e.direction,c=h.Cartesian3.cross(l,n,ao);return o.position=e.origin,o.direction=l,o.up=n,o.right=c,o.frustum.width=s,o.frustum.aspectRatio=s/r,o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}getFrustumOutline(e){const n=new h.Matrix3,o=h.Cartesian3.negate(e.rightWC,new h.Cartesian3);h.Matrix3.setColumn(n,0,o,n),h.Matrix3.setColumn(n,1,e.upWC,n),h.Matrix3.setColumn(n,2,e.directionWC,n);const s=new h.GeometryInstance({geometry:new h.FrustumOutlineGeometry({frustum:e.frustum,origin:e.positionWC,orientation:h.Quaternion.fromRotationMatrix(n,new h.Quaternion)}),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(h.Color.WHITE)}});return new h.Primitive({geometryInstances:s,appearance:new h.PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1})}async getDepthsFromScreen(){let e;return await new Promise((o,s)=>{const r=this.viewer.scene.postRender.addEventListener(()=>{var l;if(!e&&(e=(l=this.viewer.scene.view.pickDepths[0])==null?void 0:l.framebuffer,e)){const c=this.viewer.scene.context.readPixels({framebuffer:e}),u=h.Cartesian4.unpackArray(c);r(),o(u.map(d=>(h.Cartesian4.divideByScalar(d,255,d),h.Cartesian4.dot(d,gm))))}})})}getSkylineDepthsAndPositions(e,n,o,s){const r=this.viewer.scene;e=this.flipY(e,n,o);const l=[],c=[],u=[];for(let d=0;d<n;++d)for(let p=0;p<o;++p){const f=p*n+d;if(e[f]!==0||p==o-1){if(l.push([d,p]),c.push(e[f]),e[f]!==0){const g=h.SceneTransforms.transformWindowToDrawingBuffer(r,h.Cartesian3.fromArray([d,p]),R1);g.y=r.drawingBufferHeight-g.y;let v=h.SceneTransforms.drawingBufferToWorldCoordinates(r,g,e[f],ao);if(h.Cartesian3.distance(r.camera.position,v)>s){const w=h.Cartesian3.normalize(h.Cartesian3.subtract(v,r.camera.position,ao),ao);h.Cartesian3.multiplyByScalar(w,s,ao),v=h.Cartesian3.add(r.camera.position,ao,ao)}const y=se(v);y&&u.push(y)}break}}return{windowPositions:l,depths:c,positions:u}}}const z1=new h.Rectangle;function vm(t,i,e){let n=new Set;if(!i||(t instanceof Array||(t=[t]),t.length==0))return n;const o=di(e.tilingScheme??{type:"WebMercatorTilingScheme"})??new h.WebMercatorTilingScheme,s={tilingScheme:o,rectangle:h.Rectangle.intersection(e.rectangle?h.Rectangle.fromDegrees(...e.rectangle):h.Rectangle.MAX_VALUE,o.rectangle),maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel??0,tileWidth:e.tileWidth??256,tileHeight:e.tileHeight??256},r=s.tilingScheme;for(const l of t){const c=h.Rectangle.intersection(l.rectangle,s.rectangle,z1);if(!c)continue;c.south>0?c.south:c.north<0&&c.north;const u=i.getLevelMaximumGeometricError(l.level);let d=L1(s,u,Math.abs(c.south)<Math.abs(c.north)?c.south:c.north);d=Math.max(0,d);const p=e.maximumLevel;p!==void 0&&(d=Math.min(d,p));const f=e.minimumLevel;f!==void 0&&(d=Math.max(d,f));const g=r.positionToTileXY(h.Rectangle.northwest(c),d),v=r.positionToTileXY(h.Rectangle.southeast(c),d),y=l.rectangle.width/512,w=l.rectangle.height/512,P=r.tileXYToRectangle(g.x,g.y,d);Math.abs(P.south-l.rectangle.north)<w&&g.y<v.y&&++g.y,Math.abs(P.east-l.rectangle.west)<y&&g.x<v.x&&++g.x;const _=r.tileXYToRectangle(v.x,v.y,d);Math.abs(_.north-l.rectangle.south)<w&&v.y>g.y&&--v.y,Math.abs(_.west-l.rectangle.east)<y&&v.x>g.x&&--v.x;for(let S=g.x;S<=v.x;S++)for(let E=g.y;E<=v.y;E++)n.add({x:S,y:E,level:d})}return n}function L1(t,i,e){const n=t.tilingScheme,o=n.ellipsoid,s=n.projection instanceof h.GeographicProjection?1:Math.cos(e),r=n.rectangle,c=o.maximumRadius*r.width*s/(t.tileWidth*n.getNumberOfXTilesAtLevel(0))/i,u=Math.log(c)/Math.log(2);return Math.round(u)|0}function wn(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function _u(t){return Math.abs(t[0])==180&&Math.abs(t[1])==90&&Math.abs(t[2])==180&&Math.abs(t[3])==90}function je(t,i){const[e]=a.getReactFuncs(i);return a.bind(t,i,n=>{const[o,s,r]=n??[0,0,0];return[o+90,s,r]},n=>{const[o,s,r]=n??[0,0,0];if(!(!e()&&o===-90&&s===0&&r===0))return[Math.abs(o-90)<1e-9?0:o-90,s,r]})}function Pu(t,i,e){const n=new i(e),o=["id","type"];for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const r=t[s];Reflect.has(n,s)&&!o.includes(s)&&(n[s]=r)}return n}class ym extends a.Destroyable{constructor(){super(...arguments);m(this,"_currentPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_currentHeading",this.disposeVar(a.react(void 0)));m(this,"_startPosition",[0,0,0]);m(this,"_processing",this.disposeVar(a.createProcessingFromAsyncFunc(async(e,n,o)=>{const{currentPosition:s}=this;if(!s||o<=0){this._currentPosition.value=n;return}const r=this._startPosition;let l=Date.now();r.splice(0,3,...s);const c=a.geoHeading(r,n);this._currentHeading.value=c;const d=a.geoDistance(r,n)/o;await e.promise(new Promise(p=>{e.disposer.dispose(a.animateFrame(()=>{let f=Date.now()-l;f=f<0?0:f,f=f>o?o:f;const g=f*d,v=a.geoDestination(r,g,c);this._currentPosition.value=v,f===o&&(this._currentPosition.value=n,p())}))}))})))}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get processing(){return this._processing}restart(e,n){this._processing.restart(void 0,e,n)}cancel(){this._processing.cancel()}}function bu(t,i){const e=t.trim();if(e){try{const n=Function('"use strict";return ('+e+")")();if(typeof n=="function")return n}catch(n){console.info(`firstTryFunc get error! ${n}`)}try{const n=`function (${(i??[]).join(", ")}) {
|
|
92
92
|
${e};
|
|
93
93
|
}`,o=Function('"use strict";return ('+n+")")();return typeof o=="function"?o:void 0}catch(n){console.error(`optionStr get error! ${n}`);return}}}class wm extends a.Destroyable{constructor(i,e,n,o){super();const[s,r,l]=a.getReactFuncs(e),[c,u,d]=a.getReactFuncs(n),[p,f,g]=a.getReactFuncs(o)}}function O1(t,i){const e=document.createElement("a");e.href=t;const n=e.href,o=new Image;o.onload=()=>{i(n,!0),e.remove(),o.onload=o.onerror=null},o.onerror=()=>{i(n,!1),e.remove(),o.onload=o.onerror=null},o.src=n}function Pc(t){if(!(t.startsWith("./")||t.startsWith("../")||t.startsWith("/")))return t;const i=document.createElement("a");i.href=t;const e=i.href;return i.remove(),e}function br(t,i=!1){const e=t<0?"-":"",n=Math.abs(t),o=n|0,s=(n-o)*60;if(i)return`${e}${o}°${s.toFixed(3)}′`;const r=s|0,c=((s-r)*60).toFixed(3);return`${e}${o}°${r}′${c}″`}function bc(t){return Math.abs(t)<1e3?`${t.toFixed(2)} m`:`${(t/1e3).toFixed(2)} km`}function Su(t,i=!1){const e=br(t[0],i),n=br(t[1],i),o=bc(t[2]);return[e,n,o]}function N1(t){return Math.abs(t)<1e6?`${t.toFixed(2)} m²`:`${(t/1e6).toFixed(2)} km²`}function lo(t,i=48){return`
|
|
94
94
|
<div style="
|
|
@@ -1251,7 +1251,7 @@ export type IndexJsonType = {
|
|
|
1251
1251
|
\`\`\`
|
|
1252
1252
|
${Fy}
|
|
1253
1253
|
\`\`\`
|
|
1254
|
-
`,$e=class $e extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_data");m(this,"_defaultHeight",{});m(this,"defaultBoundingSphere");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(d=>d.json()).then(d=>{this._data=d}).catch(d=>{console.warn("ESGeoJson数据加载失败",d)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(d=>{var f,g;const p=[];for(const v of d.entities.values){h.Entity.prototype&&(v.ESSceneObjectID=n),this._isEntityShow(v,e);do{if(v.polygon){p.push(...(f=v.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions);break}if(v.polyline){p.push(...(g=v.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now()));break}if(v.position){const y=v.position.getValue(h.JulianDate.now());y&&p.push(y);break}}while(!1)}p.length>0&&(this.defaultBoundingSphere=h.BoundingSphere.fromPoints(p))}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const c=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(l))}{const r=()=>{var c,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(d){console.error(d)}else{const d=this.dataSource.entities.values;for(let p=0;p<d.length;p++){const f=d[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??$e.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??$e.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polygon.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g,f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new h.ConstantProperty(this.stroked??$e.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??$e.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??$e.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??$e.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:$e.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:$e.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:$e.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const v=this.imageAnchor??$e.defaults.imageAnchor,y=this.imageOffset??$e.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-v[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-v[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??$e.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??$e.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??$e.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const w=this.textFontSize&&this.textFontSize!=0?this.textFontSize:$e.defaults.textFontSize,P=this.textOffset??$e.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??$e.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${w}px ${this.textFontFamily??$e.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const _=this.textAnchor??$e.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-_[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+P[0],-_[1]*((this.textBackgroundColor?10:0)+w)+P[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let u=0;u<c.length;u++){const d=c[u];this._isEntityShow(d,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:r?r/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((o=n.viewer)!=null&&o.camera){if(!this.show){e.show=this.show;return}const s=h.JulianDate.now();let r;if(e.polygon&&e.polygon.hierarchy)r=a.getMinMaxCorner(e.polygon.hierarchy.getValue(s).positions.map(u=>se(u))).center;else if(e.polyline&&e.polyline.positions)r=a.getMinMaxCorner(e.polyline.positions.getValue(s).map(u=>se(u))).center;else if(e.position){const u=e.position.getValue(s);u&&(r=se(u))}if(!r||isNaN(r[0]))return;const l=a.getDistancesFromPositions([r,Ht(n.viewer.camera)],"NONE")[0];let c=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?c=this.minFeatureVisibleDistance<l&&l<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?c=l>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(c=l<this.maxFeatureVisibleDistance),e.show=this.show&&c}}};m($e,"defaults",{show:!0,allowPicking:!0,url:zy,defaultLoadFuncStr:Fy,defaultLoadFuncDocStr:HA,data:WA,dataMd:GA,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Io=$e;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Io||(Io={})),a.extendClassProps(Io.prototype,Io.createDefaultProps);const Ya=class Ya extends jt{constructor(e,n){super(e,n);m(this,"_pointFeatures",this.disposeVar(a.react(void 0)));m(this,"_defaultPointsBoundingSphere");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Ke(o);if(!s)return;const{screenManager:r}=s,l=this.disposeVar(new Io(n,e.id));{const c=()=>{if(!e.features)return;const u=a.toGeoJson(e.features),d={type:u.type,features:[]};l.url={type:u.type,features:u.features.filter(p=>p.geometry.type.toLowerCase().includes("point")?(d.features.push(p),!1):!0)},this.pointFeatures=d};c(),this.ad(e.featuresChanged.don(c))}this.ad(a.track([l,"show"],[e,"show"])),this.ad(a.track([l,"allowPicking"],[e,"allowPicking"])),this.ad(a.track([l,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(a.track([l,"stroked"],[e,"stroked"])),this.ad(a.track([l,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.track([l,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(a.track([l,"strokeColor"],[e,"strokeColor"])),this.ad(a.track([l,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(a.track([l,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(a.track([l,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([l,"filled"],[e,"filled"])),this.ad(a.track([l,"fillColor"],[e,"fillColor"])),this.ad(a.track([l,"fillMaterial"],[e,"fillMaterial"])),this.ad(a.track([l,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(a.track([l,"fillGround"],[e,"fillGround"])),this.ad(a.track([l,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(a.track([l,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(a.track([l,"heightReference"],[e,"heightReference"])),this.ad(a.track([l,"classificationType"],[e,"classificationType"]));{const c=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=h.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(p=>Se(p))).flat(1/0)))};c(),this.ad(this.pointFeaturesChanged.don(c))}{let c={id:"",layer:"",screenObjectIds:[]};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{label:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:[]})};this.ad(()=>{u()});const d=()=>{if(u(),!((e.textShow??a.ESGeoJson.defaults.textShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:a.ESGeoJson.defaults.textFontSize,g=e.textOffset??a.ESGeoJson.defaults.textOffset,v=e.textAnchor??a.ESGeoJson.defaults.textAnchor,y={heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],fillColor:new h.Color(...e.textColor??a.ESGeoJson.defaults.textColor),showBackground:e.textBackgroundColor!=null,backgroundColor:new h.Color(...e.textBackgroundColor??a.ESGeoJson.defaults.textBackgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??a.ESGeoJson.defaults.textFontFamily}`,horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,eyeOffset:h.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((w,P)=>{const _=e.textProperty&&e.textProperty!==""&&(w!=null&&w.properties)&&w.properties[e.textProperty]?w.properties[e.textProperty]:e.textDefaultText??a.ESGeoJson.defaults.textDefaultText;y.pixelOffset=h.Cartesian2.fromArray([-v[0]*((e.textBackgroundColor?-14:0)+this._getTextPixelWidth(_,y.font))+g[0],-v[1]*((e.textBackgroundColor?10:0)+f)+g[1]]),(w.geometry.type=="Point"?[w.geometry.coordinates]:w.geometry.coordinates).forEach((E,A)=>{const R={index:`${P}${A}`,name:_,position:E,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:w.properties},O=r.addLabel(e.id,e.typeName,y,R);c.id=O.id,c.layer=O.layer,c.screenObjectIds.push(O.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}{this.ad(()=>{u()});let c={id:"",layer:"",screenObjectIds:[]};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{billboard:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:[]})},d=()=>{if(u(),!((e.imageShow??a.ESGeoJson.defaults.imageShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??a.ESGeoJson.defaults.imageAnchor,g=e.imageOffset??a.ESGeoJson.defaults.imageOffset,v=e.imageSize?e.imageSize[0]:a.ESGeoJson.defaults.imageSize[0],y=e.imageSize?e.imageSize[1]:a.ESGeoJson.defaults.imageSize[1],w={width:v,height:y,image:a.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:a.ESGeoJson.defaults.imageUrl),horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],pixelOffset:h.Cartesian2.fromArray([-f[0]*v+g[0],-f[1]*y+g[1]]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((P,_)=>{(P.geometry.type=="Point"?[P.geometry.coordinates]:P.geometry.coordinates).forEach((E,A)=>{const R={index:`${_}${A}`,name:"",position:E,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:P.properties},O=r.addImage(e.id,e.typeName,w,R);c.id=O.id,c.layer=O.layer,c.screenObjectIds.push(O.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}this.ad(e.flyToEvent.disposableOn(c=>{if(!n.actived)return;if(e.flyInParam){const{position:d,rotation:p,flyDuration:f}=e.flyInParam;return ne(n.viewer,d,void 0,p,f),!0}let u;l.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=h.BoundingSphere.fromBoundingSpheres([l.defaultBoundingSphere,this._defaultPointsBoundingSphere]):l.defaultBoundingSphere?u=l.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&qt(n,e,this.id,se(u.center),u.radius,c)}));{const c=async(u,d,p)=>{if(!n.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,d)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")qt(n,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,n),1e3,p);else{const g=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let v=[];g?v=f.positions.flat(f.type=="MultiPolygon"?2:1).map(_=>this._calculateFeatureHeight(_,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):v=f.positions.map(_=>this._calculateFeatureHeight(_,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:y,maxPos:w,center:P}=a.getMinMaxCorner(v);qt(n,e,this.id,P,a.getDistancesFromPositions([y,w],"NONE")[0],p)}};this.d(e.flyToFeatureEvent.don((u,d,p)=>c(u,d,p))),this.d(e.flyToFeatureIndexEvent.don((u,d)=>c(u,void 0,d)))}}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}_getFeatureByIndexOrProperties(e,n){var l,c,u,d,p,f,g,v;const{sceneObject:o}=this,s=o.features;if(!s)return;const r=Reflect.get(s,"features")||Reflect.get(s,"geometries");if(r){if(n){let y=r.find(w=>(w==null?void 0:w.properties[e])==n);return{type:y!=null&&y.coordinates?y.type:(l=y==null?void 0:y.geometry)==null?void 0:l.type,positions:(y==null?void 0:y.coordinates)||((c=y==null?void 0:y.geometry)==null?void 0:c.coordinates)}}else if(typeof e=="number")return{type:(u=r[e])!=null&&u.coordinates?r[e].type:(p=(d=r[e])==null?void 0:d.geometry)==null?void 0:p.type,positions:((f=r[e])==null?void 0:f.coordinates)||((v=(g=r[e])==null?void 0:g.geometry)==null?void 0:v.coordinates)}}}async _calculateFeatureHeight(e,n,o){const s=[...e];return n=="NONE"?s[2]=s[2]??0:n=="CLAMP_TO_GROUND"||!s[2]?s[2]=await o.getTerrainHeight(s)??0:s[2]+=await o.getTerrainHeight(s)??0,s}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}};m(Ya,"type",Ya.register("ESCesiumViewer",a.ESGeoJson.type,Ya));let ap=Ya;const Za=class Za extends yt{constructor(e,n){super(e,n);m(this,"_czmGeoESRectangle");m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new xe(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:u,maxPos:d}=a.getMinMaxCorner(c);s.rectangle=[u[0],u[1],d[0],d[1]],s.height=c[0][2],s.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],v=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];r.positions=[...v,f]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};m(Za,"type",Za.register("ESCesiumViewer",a.ESGeoRectangle.type,Za));let lp=Za;class Zr extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Sn(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=Au([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(Zr||(Zr={})),a.extendClassProps(Zr.prototype,Zr.createDefaultProps);const Qa=class Qa extends yt{constructor(e,n){super(e,n);m(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:Yr.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Qa,"type",Qa.register("ESCesiumViewer",Yr.type,Qa));let cp=Qa;const ka=class ka extends me{constructor(e,n){super(e,n);m(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new ct(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{var c;s.activeAnimationsJson=(c=s.gltf.animations)==null?void 0:c.map((u,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new _c(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c)))}{const l=()=>{var c,u;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=c};l(),this.d(e.rotationChanged.don(l));{const c=()=>{if(l(),!e.instances){s.instances=e.instances;return}s.instances=e.instances.map(u=>{const d=JSON.parse(JSON.stringify(u));return!d.rotation&&(d.rotation=[0,0,0]),d.rotation[0]+=90,d})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const c=[...s.rotation];c[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=c};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};c(),this.d(l.don(c))}const r=()=>{var l;s.url=a.ESSceneObject.context.getStrFromEnv(Pc(typeof e.url=="string"?e.url:((l=e.url)==null?void 0:l.url)??a.ESGltfModel.defaults.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,c)=>{s.setNodeTranslation(l,c)})),this.d(e.setNodeRotationEvent.don((l,c)=>{s.setNodeRotation(l,c)})),this.d(e.setNodeScaleEvent.don((l,c)=>{s.setNodeScale(l,c)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r):!1}};m(ka,"type",ka.register("ESCesiumViewer",a.ESGltfModel.type,ka));let hp=ka;function Ly(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Qr extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distance",this.disposeVar(a.react(0)));m(this,"_surfaceDistance",this.disposeVar(a.react(0)));m(this,"_height",this.disposeVar(a.react(0)));m(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=Ly(r,l),this._surfaceDistance.value=Ly(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new xe(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[u,d]=this.positions;r.positions=[u,d,[u[0],u[1],d[2]]]}else r.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&r.flyTo(c)}));const l=this.disposeVar(new Ge(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const c=()=>{l.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{l.innerHTML=lo(`高度: ${bc(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(l.pickedEvent.don(c=>{Hi(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Qr||(Qr={})),a.extendClassProps(Qr.prototype,Qr.createDefaultProps);const Ka=class Ka extends yt{constructor(e,n){super(e,n);m(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Qr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ka,"type",Ka.register("ESCesiumViewer",a.ESHeightMeasurement.type,Ka));let up=Ka;const dp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Ja=class Ja extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new ct(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(y=>{e.readyEvent.emit(y)}));{const y=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),w=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};w(),this.d(y.don(w))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),d=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=c;break;case"stranger":s.url=u;break;case"suitMan":s.url=d;break;case"suitWoman":s.url=p;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}y==="walking"?s.activeAnimationsJson=dp.czmAnimationsWalk:y==="standing"?s.activeAnimationsJson=dp.czmAnimationsStand:y==="running"&&(s.activeAnimationsJson=dp.czmAnimationsRun)};g();const v=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(v.disposableOn(()=>g())),this.ad(new _c(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r)}};m(Ja,"type",Ja.register("ESCesiumViewer",a.ESHuman.type,Ja));let pp=Ja;class Oy extends a.Destroyable{constructor(e,n){super();m(this,"_czmGeoCanvasImagePoi");m(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,ei,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new _i(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=d=>{let p=d;return d.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Pc(p))},r=()=>{const d=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=d,e.sizeByContent){const f=new Image;f.src=d,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(a.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const d=()=>{o.scale=[e.scale[1],e.scale[2]]};d(),this.dispose(e.scaleChanged.don(d))}const c=()=>{const d=e.anchor,p=e.offset;d?o.originRatioAndOffset=[...d,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(d=>{const{offsetX:p,offsetY:f}=d,v={type:d.button===0?"leftClick":d.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(v)})),this.dispose(o.hoveredChanged.disposableOn(d=>{if(d===void 0)return;const p={type:d?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Ny extends a.Destroyable{constructor(e,n,o){super();m(this,"_czmGeoImageModel");m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return qt(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new qi(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,v,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,v)=>{(g==null?void 0:g.sceneObject)==(v==null?void 0:v.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(v==null?void 0:v.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&v.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Pc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=c,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const f=e.size;s.size=[f[0]/100,f[1]/100]}},s.uri=c,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const f=()=>{s.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(je([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const d=()=>{const f=e.anchor,g=e.offset;f?s.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},p=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>d())),d()}get czmGeoImageModel(){return this._czmGeoImageModel}}const ja=class ja extends Hr{constructor(e,n){super(e,n);m(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new Oy(this.sceneObject,this.czmViewer):new Ny(this.sceneObject,this.czmViewer,this)))}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(ja,"type",ja.register("ESCesiumViewer",a.ESImageLabel.type,ja));let fp=ja;function $A(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const el=class el extends jt{constructor(e,n){super(e,n);m(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=a.ESSceneObject.context.getStrFromEnv(d.url),r.value=d}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var v;if(!r.value)return;const u=(((v=e.options)==null?void 0:v.type)??"auto").toLowerCase(),d=e.options??{};let p={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...d},f=r.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const P=+y.substring(6);p={...d,assetId:P,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const w=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=w:f.url=w,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const w=+g.substring(6);p={...d,assetId:w,type:"IonImageryProvider"}}p.type=$A(u)}console.log("imageryProvider",p),s.imageryProvider=p};l();const c=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(el,"type",el.register("ESCesiumViewer",a.ESImageryLayer.type,el));let gp=el;class qA extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_show");m(this,"_czmESCustomPrimitive");m(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Fe(n,this._sceneObject.id)),this._czmTexture=this.dv(new Oe(n));const r=e,l=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=r.size/2,f=s[0].map(z=>z*p),g=s[1].map(z=>z*p),v=s[2].map(z=>z*p),y=s[3].map(z=>z*p),w=[...f,...g,...v,...y];let P=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(P=P.reverse());const _=[0,0],S=[1,0],E=[1,1],A=[0,1];let R=[];o=="east"||o=="south"?R=[...S,..._,...A,...E]:o=="west"?R=[...S,...E,...A,..._]:o=="top"?R=[...A,...E,...S,..._]:R=[..._,...S,...E,...A],l.indexTypedArray=new Uint16Array(P),l.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},c.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const O=n.getCameraInfo();if(O!=null){const N=a.getDistancesFromPositions([r.position,O.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:N)}const B=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!B)return;const{min:V,max:U}=B;l.setLocalAxisedBoundingBox(V,U)};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(d.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class XA extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const d=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(d)})}}r()}}const Ze=class Ze extends me{constructor(e,n){super(e,n);m(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ze._defaultLocalBox&&Ze._firstLoad&&(Ze._firstLoad=!1,Ze._defaultLocalBox=n.xbsjLocalBoxSources),Ze._eSLocalSkyBoxArr.push(e),this.d(()=>{Ze._eSLocalSkyBoxArr.includes(e)&&Ze._eSLocalSkyBoxArr.splice(Ze._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new qA(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new XA(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ze._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ze._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}Ze._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?(qt(s,o,n,o.position,r,e,!0),!0):!1}}};m(Ze,"type",Ze.register("ESCesiumViewer",a.ESLocalSkyBox.type,Ze)),m(Ze,"_defaultLocalBox"),m(Ze,"_firstLoad",!0),m(Ze,"_eSLocalSkyBoxArr",[]);let mp=Ze;const li=class li extends me{constructor(e,n){super(e,n);m(this,"_geoCustomDivPoi");m(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new Ge(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=c=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:c}))}));{const r=()=>{if(!e.position)return;const c=(this.textFunc??li.defaultTextFunc_度格式)(e.position);s.innerHTML=lo(c)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?li.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?li.defaultTextFunc_度分格式:li.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(li,"type",li.register("ESCesiumViewer",a.ESLocationMeasurement.type,li)),m(li,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1254
|
+
`,$e=class $e extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_data");m(this,"_defaultHeight",{});m(this,"defaultBoundingSphere");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(d=>d.json()).then(d=>{this._data=d}).catch(d=>{console.warn("ESGeoJson数据加载失败",d)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(d=>{var f,g;const p=[];for(const v of d.entities.values){h.Entity.prototype&&(v.ESSceneObjectID=n),this._isEntityShow(v,e);do{if(v.polygon){p.push(...(f=v.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions);break}if(v.polyline){p.push(...(g=v.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now()));break}if(v.position){const y=v.position.getValue(h.JulianDate.now());y&&p.push(y);break}}while(!1)}p.length>0&&(this.defaultBoundingSphere=h.BoundingSphere.fromPoints(p))}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const c=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(l))}{const r=()=>{var c,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(d){console.error(d)}else{const d=this.dataSource.entities.values;for(let p=0;p<d.length;p++){const f=d[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??$e.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??$e.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polygon.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g,f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new h.ConstantProperty(this.stroked??$e.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??$e.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??$e.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??$e.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:$e.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:$e.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:$e.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const v=this.imageAnchor??$e.defaults.imageAnchor,y=this.imageOffset??$e.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-v[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-v[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??$e.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??$e.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??$e.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const w=this.textFontSize&&this.textFontSize!=0?this.textFontSize:$e.defaults.textFontSize,P=this.textOffset??$e.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??$e.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${w}px ${this.textFontFamily??$e.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const _=this.textAnchor??$e.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-_[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+P[0],-_[1]*((this.textBackgroundColor?10:0)+w)+P[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let u=0;u<c.length;u++){const d=c[u];this._isEntityShow(d,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:r?r/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((o=n.viewer)!=null&&o.camera){if(!this.show){e.show=this.show;return}const s=h.JulianDate.now();let r;if(e.polygon&&e.polygon.hierarchy)r=a.getMinMaxCorner(e.polygon.hierarchy.getValue(s).positions.map(u=>se(u))).center;else if(e.polyline&&e.polyline.positions)r=a.getMinMaxCorner(e.polyline.positions.getValue(s).map(u=>se(u))).center;else if(e.position){const u=e.position.getValue(s);u&&(r=se(u))}if(!r||isNaN(r[0]))return;const l=a.getDistancesFromPositions([r,Ht(n.viewer.camera)],"NONE")[0];let c=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?c=this.minFeatureVisibleDistance<l&&l<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?c=l>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(c=l<this.maxFeatureVisibleDistance),e.show=this.show&&c}}};m($e,"defaults",{show:!0,allowPicking:!0,url:zy,defaultLoadFuncStr:Fy,defaultLoadFuncDocStr:HA,data:WA,dataMd:GA,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Io=$e;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Io||(Io={})),a.extendClassProps(Io.prototype,Io.createDefaultProps);const Ya=class Ya extends jt{constructor(e,n){super(e,n);m(this,"_pointFeatures",this.disposeVar(a.react(void 0)));m(this,"_defaultPointsBoundingSphere");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Ke(o);if(!s)return;const{screenManager:r}=s,l=this.disposeVar(new Io(n,e.id));{const c=()=>{if(!e.features)return;const u=a.toGeoJson(e.features),d={type:u.type,features:[]};l.url={type:u.type,features:u.features.filter(p=>p.geometry.type.toLowerCase().includes("point")?(d.features.push(p),!1):!0)},this.pointFeatures=d};c(),this.ad(e.featuresChanged.don(c))}this.ad(a.track([l,"show"],[e,"show"])),this.ad(a.track([l,"allowPicking"],[e,"allowPicking"])),this.ad(a.track([l,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(a.track([l,"stroked"],[e,"stroked"])),this.ad(a.track([l,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.track([l,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(a.track([l,"strokeColor"],[e,"strokeColor"])),this.ad(a.track([l,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(a.track([l,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(a.track([l,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([l,"filled"],[e,"filled"])),this.ad(a.track([l,"fillColor"],[e,"fillColor"])),this.ad(a.track([l,"fillMaterial"],[e,"fillMaterial"])),this.ad(a.track([l,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(a.track([l,"fillGround"],[e,"fillGround"])),this.ad(a.track([l,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(a.track([l,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(a.track([l,"heightReference"],[e,"heightReference"])),this.ad(a.track([l,"classificationType"],[e,"classificationType"]));{const c=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=h.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(p=>Se(p))).flat(1/0)))};c(),this.ad(this.pointFeaturesChanged.don(c))}{let c={id:"",layer:"",screenObjectIds:new Set};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{label:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:new Set})};this.ad(()=>{u()});const d=()=>{if(u(),!((e.textShow??a.ESGeoJson.defaults.textShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:a.ESGeoJson.defaults.textFontSize,g=e.textOffset??a.ESGeoJson.defaults.textOffset,v=e.textAnchor??a.ESGeoJson.defaults.textAnchor,y={heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],fillColor:new h.Color(...e.textColor??a.ESGeoJson.defaults.textColor),showBackground:e.textBackgroundColor!=null,backgroundColor:new h.Color(...e.textBackgroundColor??a.ESGeoJson.defaults.textBackgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??a.ESGeoJson.defaults.textFontFamily}`,horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,eyeOffset:h.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((w,P)=>{const _=e.textProperty&&e.textProperty!==""&&(w!=null&&w.properties)&&w.properties[e.textProperty]?w.properties[e.textProperty]:e.textDefaultText??a.ESGeoJson.defaults.textDefaultText;y.pixelOffset=h.Cartesian2.fromArray([-v[0]*((e.textBackgroundColor?-14:0)+this._getTextPixelWidth(_,y.font))+g[0],-v[1]*((e.textBackgroundColor?10:0)+f)+g[1]]),(w.geometry.type=="Point"?[w.geometry.coordinates]:w.geometry.coordinates).forEach((E,A)=>{const R={index:`${P}${A}`,name:_,position:E,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:w.properties},O=r.addLabel(e.id,e.typeName,y,R);c.id=O.id,c.layer=O.layer,c.screenObjectIds.add(O.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}{this.ad(()=>{u()});let c={id:"",layer:"",screenObjectIds:new Set};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{billboard:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:new Set})},d=()=>{if(u(),!((e.imageShow??a.ESGeoJson.defaults.imageShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??a.ESGeoJson.defaults.imageAnchor,g=e.imageOffset??a.ESGeoJson.defaults.imageOffset,v=e.imageSize?e.imageSize[0]:a.ESGeoJson.defaults.imageSize[0],y=e.imageSize?e.imageSize[1]:a.ESGeoJson.defaults.imageSize[1],w={width:v,height:y,image:a.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:a.ESGeoJson.defaults.imageUrl),horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],pixelOffset:h.Cartesian2.fromArray([-f[0]*v+g[0],-f[1]*y+g[1]]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((P,_)=>{(P.geometry.type=="Point"?[P.geometry.coordinates]:P.geometry.coordinates).forEach((E,A)=>{const R={index:`${_}${A}`,name:"",position:E,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:P.properties},O=r.addImage(e.id,e.typeName,w,R);c.id=O.id,c.layer=O.layer,c.screenObjectIds.add(O.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}this.ad(e.flyToEvent.disposableOn(c=>{if(!n.actived)return;if(e.flyInParam){const{position:d,rotation:p,flyDuration:f}=e.flyInParam;return ne(n.viewer,d,void 0,p,f),!0}let u;l.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=h.BoundingSphere.fromBoundingSpheres([l.defaultBoundingSphere,this._defaultPointsBoundingSphere]):l.defaultBoundingSphere?u=l.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&qt(n,e,this.id,se(u.center),u.radius,c)}));{const c=async(u,d,p)=>{if(!n.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,d)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")qt(n,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,n),1e3,p);else{const g=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let v=[];g?v=f.positions.flat(f.type=="MultiPolygon"?2:1).map(_=>this._calculateFeatureHeight(_,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):v=f.positions.map(_=>this._calculateFeatureHeight(_,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:y,maxPos:w,center:P}=a.getMinMaxCorner(v);qt(n,e,this.id,P,a.getDistancesFromPositions([y,w],"NONE")[0],p)}};this.d(e.flyToFeatureEvent.don((u,d,p)=>c(u,d,p))),this.d(e.flyToFeatureIndexEvent.don((u,d)=>c(u,void 0,d)))}}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}_getFeatureByIndexOrProperties(e,n){var l,c,u,d,p,f,g,v;const{sceneObject:o}=this,s=o.features;if(!s)return;const r=Reflect.get(s,"features")||Reflect.get(s,"geometries");if(r){if(n){let y=r.find(w=>(w==null?void 0:w.properties[e])==n);return{type:y!=null&&y.coordinates?y.type:(l=y==null?void 0:y.geometry)==null?void 0:l.type,positions:(y==null?void 0:y.coordinates)||((c=y==null?void 0:y.geometry)==null?void 0:c.coordinates)}}else if(typeof e=="number")return{type:(u=r[e])!=null&&u.coordinates?r[e].type:(p=(d=r[e])==null?void 0:d.geometry)==null?void 0:p.type,positions:((f=r[e])==null?void 0:f.coordinates)||((v=(g=r[e])==null?void 0:g.geometry)==null?void 0:v.coordinates)}}}async _calculateFeatureHeight(e,n,o){const s=[...e];return n=="NONE"?s[2]=s[2]??0:n=="CLAMP_TO_GROUND"||!s[2]?s[2]=await o.getTerrainHeight(s)??0:s[2]+=await o.getTerrainHeight(s)??0,s}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}};m(Ya,"type",Ya.register("ESCesiumViewer",a.ESGeoJson.type,Ya));let ap=Ya;const Za=class Za extends yt{constructor(e,n){super(e,n);m(this,"_czmGeoESRectangle");m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new xe(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:u,maxPos:d}=a.getMinMaxCorner(c);s.rectangle=[u[0],u[1],d[0],d[1]],s.height=c[0][2],s.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],v=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];r.positions=[...v,f]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};m(Za,"type",Za.register("ESCesiumViewer",a.ESGeoRectangle.type,Za));let lp=Za;class Zr extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Sn(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=Au([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(Zr||(Zr={})),a.extendClassProps(Zr.prototype,Zr.createDefaultProps);const Qa=class Qa extends yt{constructor(e,n){super(e,n);m(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:Yr.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Qa,"type",Qa.register("ESCesiumViewer",Yr.type,Qa));let cp=Qa;const ka=class ka extends me{constructor(e,n){super(e,n);m(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new ct(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{var c;s.activeAnimationsJson=(c=s.gltf.animations)==null?void 0:c.map((u,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new _c(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c)))}{const l=()=>{var c,u;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=c};l(),this.d(e.rotationChanged.don(l));{const c=()=>{if(l(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(u=>{const d=JSON.parse(JSON.stringify(u));return!d.rotation&&(d.rotation=[0,0,0]),d.rotation[0]+=90,d})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const c=[...s.rotation];c[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=c};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};c(),this.d(l.don(c))}const r=()=>{var l;s.url=a.ESSceneObject.context.getStrFromEnv(Pc(typeof e.url=="string"?e.url:((l=e.url)==null?void 0:l.url)??a.ESGltfModel.defaults.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,c)=>{s.setNodeTranslation(l,c)})),this.d(e.setNodeRotationEvent.don((l,c)=>{s.setNodeRotation(l,c)})),this.d(e.setNodeScaleEvent.don((l,c)=>{s.setNodeScale(l,c)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r):!1}};m(ka,"type",ka.register("ESCesiumViewer",a.ESGltfModel.type,ka));let hp=ka;function Ly(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Qr extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distance",this.disposeVar(a.react(0)));m(this,"_surfaceDistance",this.disposeVar(a.react(0)));m(this,"_height",this.disposeVar(a.react(0)));m(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=Ly(r,l),this._surfaceDistance.value=Ly(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new xe(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[u,d]=this.positions;r.positions=[u,d,[u[0],u[1],d[2]]]}else r.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&r.flyTo(c)}));const l=this.disposeVar(new Ge(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const c=()=>{l.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{l.innerHTML=lo(`高度: ${bc(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(l.pickedEvent.don(c=>{Hi(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Qr||(Qr={})),a.extendClassProps(Qr.prototype,Qr.createDefaultProps);const Ka=class Ka extends yt{constructor(e,n){super(e,n);m(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Qr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ka,"type",Ka.register("ESCesiumViewer",a.ESHeightMeasurement.type,Ka));let up=Ka;const dp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Ja=class Ja extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new ct(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(y=>{e.readyEvent.emit(y)}));{const y=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),w=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};w(),this.d(y.don(w))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),d=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=c;break;case"stranger":s.url=u;break;case"suitMan":s.url=d;break;case"suitWoman":s.url=p;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}y==="walking"?s.activeAnimationsJson=dp.czmAnimationsWalk:y==="standing"?s.activeAnimationsJson=dp.czmAnimationsStand:y==="running"&&(s.activeAnimationsJson=dp.czmAnimationsRun)};g();const v=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(v.disposableOn(()=>g())),this.ad(new _c(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r)}};m(Ja,"type",Ja.register("ESCesiumViewer",a.ESHuman.type,Ja));let pp=Ja;class Oy extends a.Destroyable{constructor(e,n){super();m(this,"_czmGeoCanvasImagePoi");m(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,ei,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new _i(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=d=>{let p=d;return d.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Pc(p))},r=()=>{const d=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=d,e.sizeByContent){const f=new Image;f.src=d,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(a.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const d=()=>{o.scale=[e.scale[1],e.scale[2]]};d(),this.dispose(e.scaleChanged.don(d))}const c=()=>{const d=e.anchor,p=e.offset;d?o.originRatioAndOffset=[...d,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(d=>{const{offsetX:p,offsetY:f}=d,v={type:d.button===0?"leftClick":d.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(v)})),this.dispose(o.hoveredChanged.disposableOn(d=>{if(d===void 0)return;const p={type:d?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Ny extends a.Destroyable{constructor(e,n,o){super();m(this,"_czmGeoImageModel");m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return qt(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new qi(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,v,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,v)=>{(g==null?void 0:g.sceneObject)==(v==null?void 0:v.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(v==null?void 0:v.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&v.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Pc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=c,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const f=e.size;s.size=[f[0]/100,f[1]/100]}},s.uri=c,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const f=()=>{s.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(je([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const d=()=>{const f=e.anchor,g=e.offset;f?s.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},p=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>d())),d()}get czmGeoImageModel(){return this._czmGeoImageModel}}const ja=class ja extends Hr{constructor(e,n){super(e,n);m(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new Oy(this.sceneObject,this.czmViewer):new Ny(this.sceneObject,this.czmViewer,this)))}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(ja,"type",ja.register("ESCesiumViewer",a.ESImageLabel.type,ja));let fp=ja;function $A(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const el=class el extends jt{constructor(e,n){super(e,n);m(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=a.ESSceneObject.context.getStrFromEnv(d.url),r.value=d}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var v;if(!r.value)return;const u=(((v=e.options)==null?void 0:v.type)??"auto").toLowerCase(),d=e.options??{};let p={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...d},f=r.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const P=+y.substring(6);p={...d,assetId:P,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const w=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=w:f.url=w,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const w=+g.substring(6);p={...d,assetId:w,type:"IonImageryProvider"}}p.type=$A(u)}console.log("imageryProvider",p),s.imageryProvider=p};l();const c=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(el,"type",el.register("ESCesiumViewer",a.ESImageryLayer.type,el));let gp=el;class qA extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_show");m(this,"_czmESCustomPrimitive");m(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Fe(n,this._sceneObject.id)),this._czmTexture=this.dv(new Oe(n));const r=e,l=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=r.size/2,f=s[0].map(z=>z*p),g=s[1].map(z=>z*p),v=s[2].map(z=>z*p),y=s[3].map(z=>z*p),w=[...f,...g,...v,...y];let P=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(P=P.reverse());const _=[0,0],S=[1,0],E=[1,1],A=[0,1];let R=[];o=="east"||o=="south"?R=[...S,..._,...A,...E]:o=="west"?R=[...S,...E,...A,..._]:o=="top"?R=[...A,...E,...S,..._]:R=[..._,...S,...E,...A],l.indexTypedArray=new Uint16Array(P),l.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},c.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const O=n.getCameraInfo();if(O!=null){const N=a.getDistancesFromPositions([r.position,O.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:N)}const B=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!B)return;const{min:V,max:U}=B;l.setLocalAxisedBoundingBox(V,U)};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(d.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class XA extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const d=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(d)})}}r()}}const Ze=class Ze extends me{constructor(e,n){super(e,n);m(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ze._defaultLocalBox&&Ze._firstLoad&&(Ze._firstLoad=!1,Ze._defaultLocalBox=n.xbsjLocalBoxSources),Ze._eSLocalSkyBoxArr.push(e),this.d(()=>{Ze._eSLocalSkyBoxArr.includes(e)&&Ze._eSLocalSkyBoxArr.splice(Ze._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new qA(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new XA(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ze._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ze._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}Ze._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?(qt(s,o,n,o.position,r,e,!0),!0):!1}}};m(Ze,"type",Ze.register("ESCesiumViewer",a.ESLocalSkyBox.type,Ze)),m(Ze,"_defaultLocalBox"),m(Ze,"_firstLoad",!0),m(Ze,"_eSLocalSkyBoxArr",[]);let mp=Ze;const li=class li extends me{constructor(e,n){super(e,n);m(this,"_geoCustomDivPoi");m(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new Ge(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=c=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:c}))}));{const r=()=>{if(!e.position)return;const c=(this.textFunc??li.defaultTextFunc_度格式)(e.position);s.innerHTML=lo(c)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?li.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?li.defaultTextFunc_度分格式:li.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(li,"type",li.register("ESCesiumViewer",a.ESLocationMeasurement.type,li)),m(li,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1255
1255
|
纬度: ${o.toFixed(5)}°
|
|
1256
1256
|
高度: ${s.toFixed(2)}m`}),m(li,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[n,o,s]=Su(e,!0);return`经度: ${n}
|
|
1257
1257
|
纬度: ${o}
|
|
@@ -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
|
|
@@ -1743,7 +1743,7 @@ ${qy}
|
|
|
1743
1743
|
vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
|
|
1744
1744
|
out_FragColor = imageColor * u_color;
|
|
1745
1745
|
}
|
|
1746
|
-
`};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};m(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Ro=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Cl=class Cl extends yt{constructor(e,n){super(e,n);m(this,"_czmPolygonFence");m(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Ro(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:v,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=v,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};m(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Bp=Cl;const _l=class _l extends yt{constructor(e,n){super(e,n);m(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};m(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Vp=_l;const Qn=class Qn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Qn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const _=h.Material.fromType(h.Material.ImageType);_.uniforms.image=s.value,_.uniforms.repeat=Pe(this.repeat??Qn.defaults.repeat),r.value=_};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(_,S)=>{const E=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});E.renderState.depthMask=!1;const A=[];if(_.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:_,width:this.width??Qn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Qn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:E,asynchronous:!1,allowPicking:this.allowPicking??Qn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const _=pt(this.positions);if(_.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(_,p),d=u(_,r.value),d&&o.scene.primitives.add(d)},v=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(_=>{if(e.actived&&p.radius>0){const S=se(p.center);S&&ne(o,S,p.radius*4,void 0,_)}})),g(),v();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),v()}));const w=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(w.disposableOn(()=>{v()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};m(Qn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Fo=Qn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Fo||(Fo={})),a.extendClassProps(Fo.prototype,Fo.createDefaultProps);const Pl=class Pl extends yt{constructor(e,n){super(e,n);m(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Fo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Up=Pl;const bl=class bl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},w=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(w.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="125px",p.style.display="inline-block",p.style.textAlign="center",p.style.fontSize="14px",p.style.fontWeight="lighter",p.style.lineHeight="30px",p.style.color="#fff",p.innerHTML="1000km";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const w=n.viewerLegend.legend.computedLengthInStr;w&&(p.innerHTML=w);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const _=(135-P)/2;f.style.left=`${_}px`}}};g();const v=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(v))}}}get customDiv(){return this._customDiv}};m(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Wp=bl;const Sl=class Sl extends me{constructor(e,n){super(e,n);m(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new Fe(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Gp=Sl;const xl=class xl extends dh{constructor(e,n){super(e,n);m(this,"czmGeoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!Ke(n.viewer))return;this.czmGeoPolyline=this.dv(new xe(n,e.id)),this.czmWater=this.dv(new mo(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},xc[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Ht(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};m(xl,"type",xl.register("ESCesiumViewer",a.ESDynamicWater.type,xl));let Hp=xl;const Te=class Te extends jt{constructor(e,n){super(e,n);m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_pointFeatures",this.disposeVar(a.reactJsonWithUndefined(void 0)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Ke(o);if(!s)return;const{screenManager:r}=s,l={scale:1*Te.scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Te.scaleByDistance,eyeOffset:new h.Cartesian3(0,0,-10),show:!0},c={scale:1*Te.scaleFactor,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Te.scaleByDistance,image:Te.clusterImageUrl};(async()=>{if(Te.clusterImageAttribute===void 0){const u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(d=>d.json()).then(d=>{Te.clusterImageAttribute=d}).catch(d=>{console.error(d)})}{const u=()=>{if(!e.data)return;const d=a.toGeoJson(e.data),p={type:d.type,features:[]};p.features=d.features.filter(f=>f.geometry.type.toLowerCase().includes("point")),this.pointFeatures=p};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const d=()=>{u(),this.pointFeatures&&h.GeoJsonDataSource.load(this.pointFeatures).then(p=>{o.dataSources.add(p).then(()=>{this.dataSource=p})})};d(),this.ad(this.pointFeaturesChanged.don(d))}this.ad(new a.ObjResettingWithEvent(this.dataSourceChanged,()=>{var v;if(!this.dataSource)return;const u=new a.Destroyable,d=this.dataSource;d.clustering.enabled=d.clustering.clusterBillboards=d.clustering.clusterLabels=d.clustering.clusterPoints=!0;for(let y=0;y<d.entities.values.length;y++){const w=d.entities.values[y];w.billboard&&(w.billboard.color=new h.ConstantProperty(h.Color.TRANSPARENT))}{const y=()=>{const P=d.clustering.pixelRange;d.clustering.pixelRange=0,d.clustering.pixelRange=P};y();let w=(v=this.czmViewer.viewer)==null?void 0:v.camera.moveEnd.addEventListener(()=>{y()});u.d(()=>{var P;w&&((P=this.czmViewer.viewer)==null||P.camera.moveEnd.removeEventListener(w))})}u.d(a.track([d.clustering,"pixelRange"],[e,"pixelRange"])),u.d(a.track([d.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),d.clustering.clusterEvent.addEventListener((y,w)=>{w.label&&(w.label.show=!1),w.billboard&&(w.billboard.show=!1),w.point&&(w.point.show=!1)});const p=u.ad(a.react(!1));let f=[];const g=o.scene.postUpdate.addEventListener(()=>{if(d.clustering._clusterLabelCollection)if(d.clustering._clusterLabelCollection._labels.length!=f.length||!d.clustering._clusterLabelCollection._labels.every(y=>f.includes(y.id.length))){f=[];for(let y=0;y<d.clustering._clusterLabelCollection._labels.length;y++){const w=d.clustering._clusterLabelCollection._labels[y];f.push(w.id.length)}p.value=!0}else p.value=!1});u.ad(()=>g());{let y={id:"",layer:"",screenObjectIds:[]},w={id:"",layer:"",screenObjectIds:[]};const P=()=>{y&&(r.remove(y.layer,y.id,{label:y.screenObjectIds}),y={id:"",layer:"",screenObjectIds:[]}),w&&(r.remove(w.layer,w.id,{billboard:w.screenObjectIds}),w={id:"",layer:"",screenObjectIds:[]})};u.ad(()=>{P()});const _=()=>{var z,N,C;if(P(),!e.show||!Te.clusterImageAttribute)return;const A=e.style??a.ESEntityCluster.defaults.style,R=Te.clusterImageAttribute[((z=A.nonCluster)==null?void 0:z.mode)??"SquareH01"],O=[-R.anchorPixelOffset[0]+R.textPixelOffset[0],-R.anchorPixelOffset[1]-R.textPixelOffset[1]],B={...l,pixelOffset:new h.Cartesian2(O[0]*Te.scaleFactor,O[1]*Te.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},V={...c,width:R.imageSize[0],height:R.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-R.anchorPixelOffset[0]*Te.scaleFactor,-R.anchorPixelOffset[1]*Te.scaleFactor),imageSubRegion:new h.BoundingRectangle(...R.imagePixelOffset,...R.imageSize)},U=new Map;if(d.clustering._clusterLabelCollection)for(let x=0;x<d.clustering._clusterLabelCollection._labels.length;x++){const I=d.clustering._clusterLabelCollection._labels[x];if(!Te.clusterImageAttribute)continue;const L=I.text,G=se(I.position),Y={index:I.id.map(ve=>d.entities.values.length-1-d.clustering._collectionIndicesByEntity[ve.id].billboardIndex).sort((ve,Ne)=>ve-Ne),name:L,position:G},q=this.getClusterStyle(A.cluster??a.ESEntityCluster.defaults.style.cluster,I.id.length).mode,$=Te.clusterImageAttribute[q],Q=[-$.anchorPixelOffset[0]+$.textPixelOffset[0],-$.anchorPixelOffset[1]-$.textPixelOffset[1]],ee={...l,pixelOffset:new h.Cartesian2(Q[0]*Te.scaleFactor,Q[1]*Te.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},le={...c,width:$.imageSize[0],height:$.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-$.anchorPixelOffset[0]*Te.scaleFactor,-$.anchorPixelOffset[1]*Te.scaleFactor),imageSubRegion:new h.BoundingRectangle(...$.imagePixelOffset,...$.imageSize)},ce=r.addImage(e.id,e.typeName,le,Y),ue=r.addLabel(e.id,e.typeName,ee,Y);w.id=ce.id,w.layer=ce.layer,w.screenObjectIds.push(ce.screenObjectId),y.id=ue.id,y.layer=ue.layer,y.screenObjectIds.push(ue.screenObjectId);for(let ve=0;ve<I.id.length;ve++)U.set(I.id[ve].id,1)}for(let x=0;x<d.entities.values.length;x++){const I=d.entities.values[x];if(U.has(I.id)||!this.pointFeatures||!n.isPointVisible(se((N=I.position)==null?void 0:N.getValue())))continue;const L=this.getNthValue(x),G=(L==null?void 0:L.coordinates)??(L==null?void 0:L.geometry.coordinates),Y=(L==null?void 0:L.name)??((C=L.properties)==null?void 0:C.name)??(x+1).toString(),q={index:x,name:Y,position:G},$=r.addImage(e.id,e.typeName,V,q),Q=r.addLabel(e.id,e.typeName,B,q);w.id=$.id,w.layer=$.layer,w.screenObjectIds.push($.screenObjectId),y.id=Q.id,y.layer=Q.layer,y.screenObjectIds.push(Q.screenObjectId)}};_();const S=u.ad(a.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,p.changed));u.ad(S.don(_));const E=()=>{y&&r.update(y.layer,y.id,y.screenObjectIds,{label:{heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]}}),w&&r.update(w.layer,w.id,w.screenObjectIds,{billboard:{heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]}})};E(),u.ad(e.heightReferenceChanged.don(E))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}getNthValue(e){if(!this.pointFeatures)return;let n=0;for(let o=0;o<this.pointFeatures.features.length;o++){const s=this.pointFeatures.features[o].geometry;let r=0;if(s.type==="Point")r=1;else if(s.type==="MultiPoint")r=s.coordinates.length;else continue;if(e<n+r)return s.type==="Point"?this.pointFeatures.features[o]:{type:"Feature",geometry:{type:"Point",coordinates:s.coordinates[e-n]},properties:this.pointFeatures.features[o].properties};n+=r}}};m(Te,"type",Te.register("ESCesiumViewer",a.ESEntityCluster.type,Te)),m(Te,"scaleFactor",.6),m(Te,"scaleByDistance",new h.NearFarScalar(100,1,1e3,1)),m(Te,"clusterImages"),m(Te,"clusterImageAttribute"),m(Te,"clusterImageUrl",a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let $p=Te;const El=class El extends jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};m(El,"type",El.register("ESCesiumViewer",gh.type,El));let qp=El;const Al=class Al extends Yt{constructor(e,n){super(e,n);m(this,"geoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!Ke(n.viewer))return;this.geoPolyline=this.dv(new xe(n,e.id)),this.czmWater=this.dv(new mo(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},xc[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};m(Al,"type",Al.register("ESCesiumViewer",a.ESGeoWater.type,Al));let Xp=Al;const Tl=class Tl extends jt{constructor(e,n){super(e,n);m(this,"_czmImagery");m(this,"mvtLayerJson",{mainJson:"",pointJson:[],otherJson:[]});if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const r=this.dv(a.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),l=()=>{s.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};l(),this.d(r.don(l))}}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Tl,"type",Tl.register("ESCesiumViewer",fh.type,Tl));let bh=Tl;class LT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:_,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(..._),u.push(...this.setIndexs(P))}const[f,g,v]=Dt({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const w=this.setTextureCoordinates(n,o);c.push(...w.flat()),this.updateCustomPrimitive(s,g,l,u,c),o.computeBoundingBox()}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],v=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],w=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,v],[d,p],[p,y]],_=[[f,g],[f,v],[g,y],[v,y]];return{outlinePionts:[...w,...P,..._],customPrimitivePoints:[u,c,d,p,g,f,v,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=Dt({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],v=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+v),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Ml=class Ml extends yt{constructor(e,n){super(e,n);m(this,"_line",this.dv(new xe(this.czmViewer,this.sceneObject.id)));m(this,"_czmTexture",this.ad(new Oe(this.czmViewer,this.sceneObject.id)));m(this,"_czmCustomPrimitive",this.dv(new Fe(this.czmViewer,this.sceneObject.id)));m(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new LT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
1746
|
+
`};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};m(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Ro=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Cl=class Cl extends yt{constructor(e,n){super(e,n);m(this,"_czmPolygonFence");m(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Ro(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:v,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=v,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Rt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};m(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Bp=Cl;const _l=class _l extends yt{constructor(e,n){super(e,n);m(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};m(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Vp=_l;const Qn=class Qn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Qn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const _=h.Material.fromType(h.Material.ImageType);_.uniforms.image=s.value,_.uniforms.repeat=Pe(this.repeat??Qn.defaults.repeat),r.value=_};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(_,S)=>{const E=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});E.renderState.depthMask=!1;const A=[];if(_.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:_,width:this.width??Qn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Qn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:E,asynchronous:!1,allowPicking:this.allowPicking??Qn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const _=pt(this.positions);if(_.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(_,p),d=u(_,r.value),d&&o.scene.primitives.add(d)},v=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(_=>{if(e.actived&&p.radius>0){const S=se(p.center);S&&ne(o,S,p.radius*4,void 0,_)}})),g(),v();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),v()}));const w=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(w.disposableOn(()=>{v()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};m(Qn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Fo=Qn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Fo||(Fo={})),a.extendClassProps(Fo.prototype,Fo.createDefaultProps);const Pl=class Pl extends yt{constructor(e,n){super(e,n);m(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Fo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Up=Pl;const bl=class bl extends a.EngineObject{constructor(e,n){super(e,n);m(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},w=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(w.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="125px",p.style.display="inline-block",p.style.textAlign="center",p.style.fontSize="14px",p.style.fontWeight="lighter",p.style.lineHeight="30px",p.style.color="#fff",p.innerHTML="1000km";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const w=n.viewerLegend.legend.computedLengthInStr;w&&(p.innerHTML=w);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const _=(135-P)/2;f.style.left=`${_}px`}}};g();const v=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(v))}}}get customDiv(){return this._customDiv}};m(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Wp=bl;const Sl=class Sl extends me{constructor(e,n){super(e,n);m(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new Fe(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Gp=Sl;const xl=class xl extends dh{constructor(e,n){super(e,n);m(this,"czmGeoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!Ke(n.viewer))return;this.czmGeoPolyline=this.dv(new xe(n,e.id)),this.czmWater=this.dv(new mo(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},xc[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Ht(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};m(xl,"type",xl.register("ESCesiumViewer",a.ESDynamicWater.type,xl));let Hp=xl;const Te=class Te extends jt{constructor(e,n){super(e,n);m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_pointFeatures",this.disposeVar(a.reactJsonWithUndefined(void 0)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Ke(o);if(!s)return;const{screenManager:r}=s,l={scale:1*Te.scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Te.scaleByDistance,eyeOffset:new h.Cartesian3(0,0,-10),show:!0},c={scale:1*Te.scaleFactor,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scaleByDistance:Te.scaleByDistance,image:Te.clusterImageUrl};(async()=>{if(Te.clusterImageAttribute===void 0){const u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(d=>d.json()).then(d=>{Te.clusterImageAttribute=d}).catch(d=>{console.error(d)})}{const u=()=>{if(!e.data)return;const d=a.toGeoJson(e.data),p={type:d.type,features:[]};p.features=d.features.filter(f=>f.geometry.type.toLowerCase().includes("point")),this.pointFeatures=p};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const d=()=>{u(),this.pointFeatures&&h.GeoJsonDataSource.load(this.pointFeatures).then(p=>{o.dataSources.add(p).then(()=>{this.dataSource=p})})};d(),this.ad(this.pointFeaturesChanged.don(d))}this.ad(new a.ObjResettingWithEvent(this.dataSourceChanged,()=>{var v;if(!this.dataSource)return;const u=new a.Destroyable,d=this.dataSource;d.clustering.enabled=d.clustering.clusterBillboards=d.clustering.clusterLabels=d.clustering.clusterPoints=!0;for(let y=0;y<d.entities.values.length;y++){const w=d.entities.values[y];w.billboard&&(w.billboard.color=new h.ConstantProperty(h.Color.TRANSPARENT))}{const y=()=>{const P=d.clustering.pixelRange;d.clustering.pixelRange=0,d.clustering.pixelRange=P};y();let w=(v=this.czmViewer.viewer)==null?void 0:v.camera.moveEnd.addEventListener(()=>{y()});u.d(()=>{var P;w&&((P=this.czmViewer.viewer)==null||P.camera.moveEnd.removeEventListener(w))})}u.d(a.track([d.clustering,"pixelRange"],[e,"pixelRange"])),u.d(a.track([d.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),d.clustering.clusterEvent.addEventListener((y,w)=>{w.label&&(w.label.show=!1),w.billboard&&(w.billboard.show=!1),w.point&&(w.point.show=!1)});const p=u.ad(a.react(!1));let f=[];const g=o.scene.postUpdate.addEventListener(()=>{if(d.clustering._clusterLabelCollection)if(d.clustering._clusterLabelCollection._labels.length!=f.length||!d.clustering._clusterLabelCollection._labels.every(y=>f.includes(y.id.length))){f=[];for(let y=0;y<d.clustering._clusterLabelCollection._labels.length;y++){const w=d.clustering._clusterLabelCollection._labels[y];f.push(w.id.length)}p.value=!0}else p.value=!1});u.ad(()=>g());{let y={id:"",layer:"",screenObjectIds:new Set},w={id:"",layer:"",screenObjectIds:new Set};const P=()=>{y&&(r.remove(y.layer,y.id,{label:y.screenObjectIds}),y={id:"",layer:"",screenObjectIds:new Set}),w&&(r.remove(w.layer,w.id,{billboard:w.screenObjectIds}),w={id:"",layer:"",screenObjectIds:new Set})};u.ad(()=>{P()});const _=()=>{var z,N,C;if(P(),!e.show||!Te.clusterImageAttribute)return;const A=e.style??a.ESEntityCluster.defaults.style,R=Te.clusterImageAttribute[((z=A.nonCluster)==null?void 0:z.mode)??"SquareH01"],O=[-R.anchorPixelOffset[0]+R.textPixelOffset[0],-R.anchorPixelOffset[1]-R.textPixelOffset[1]],B={...l,pixelOffset:new h.Cartesian2(O[0]*Te.scaleFactor,O[1]*Te.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},V={...c,width:R.imageSize[0],height:R.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-R.anchorPixelOffset[0]*Te.scaleFactor,-R.anchorPixelOffset[1]*Te.scaleFactor),imageSubRegion:new h.BoundingRectangle(...R.imagePixelOffset,...R.imageSize)},U=new Map;if(d.clustering._clusterLabelCollection)for(let x=0;x<d.clustering._clusterLabelCollection._labels.length;x++){const I=d.clustering._clusterLabelCollection._labels[x];if(!Te.clusterImageAttribute)continue;const L=I.text,G=se(I.position),Y={index:I.id.map(ve=>d.entities.values.length-1-d.clustering._collectionIndicesByEntity[ve.id].billboardIndex).sort((ve,Ne)=>ve-Ne),name:L,position:G},q=this.getClusterStyle(A.cluster??a.ESEntityCluster.defaults.style.cluster,I.id.length).mode,$=Te.clusterImageAttribute[q],Q=[-$.anchorPixelOffset[0]+$.textPixelOffset[0],-$.anchorPixelOffset[1]-$.textPixelOffset[1]],ee={...l,pixelOffset:new h.Cartesian2(Q[0]*Te.scaleFactor,Q[1]*Te.scaleFactor),heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]},le={...c,width:$.imageSize[0],height:$.imageSize[1],heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new h.Cartesian2(-$.anchorPixelOffset[0]*Te.scaleFactor,-$.anchorPixelOffset[1]*Te.scaleFactor),imageSubRegion:new h.BoundingRectangle(...$.imagePixelOffset,...$.imageSize)},ce=r.addImage(e.id,e.typeName,le,Y),ue=r.addLabel(e.id,e.typeName,ee,Y);w.id=ce.id,w.layer=ce.layer,w.screenObjectIds.add(ce.screenObjectId),y.id=ue.id,y.layer=ue.layer,y.screenObjectIds.add(ue.screenObjectId);for(let ve=0;ve<I.id.length;ve++)U.set(I.id[ve].id,1)}for(let x=0;x<d.entities.values.length;x++){const I=d.entities.values[x];if(U.has(I.id)||!this.pointFeatures||!n.isPointVisible(se((N=I.position)==null?void 0:N.getValue())))continue;const L=this.getNthValue(x),G=(L==null?void 0:L.coordinates)??(L==null?void 0:L.geometry.coordinates),Y=(L==null?void 0:L.name)??((C=L.properties)==null?void 0:C.name)??(x+1).toString(),q={index:x,name:Y,position:G},$=r.addImage(e.id,e.typeName,V,q),Q=r.addLabel(e.id,e.typeName,B,q);w.id=$.id,w.layer=$.layer,w.screenObjectIds.add($.screenObjectId),y.id=Q.id,y.layer=Q.layer,y.screenObjectIds.add(Q.screenObjectId)}};_();const S=u.ad(a.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,p.changed));u.ad(S.don(_));const E=()=>{y&&r.update(y.layer,y.id,y.screenObjectIds,{label:{heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]}}),w&&r.update(w.layer,w.id,w.screenObjectIds,{billboard:{heightReference:h.HeightReference[(e.heightReference??a.ESEntityCluster.defaults.heightReference).toUpperCase()]}})};E(),u.ad(e.heightReferenceChanged.don(E))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}getNthValue(e){if(!this.pointFeatures)return;let n=0;for(let o=0;o<this.pointFeatures.features.length;o++){const s=this.pointFeatures.features[o].geometry;let r=0;if(s.type==="Point")r=1;else if(s.type==="MultiPoint")r=s.coordinates.length;else continue;if(e<n+r)return s.type==="Point"?this.pointFeatures.features[o]:{type:"Feature",geometry:{type:"Point",coordinates:s.coordinates[e-n]},properties:this.pointFeatures.features[o].properties};n+=r}}};m(Te,"type",Te.register("ESCesiumViewer",a.ESEntityCluster.type,Te)),m(Te,"scaleFactor",.6),m(Te,"scaleByDistance",new h.NearFarScalar(100,1,1e3,1)),m(Te,"clusterImages"),m(Te,"clusterImageAttribute"),m(Te,"clusterImageUrl",a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let $p=Te;const El=class El extends jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};m(El,"type",El.register("ESCesiumViewer",gh.type,El));let qp=El;const Al=class Al extends Yt{constructor(e,n){super(e,n);m(this,"geoPolyline");m(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!Ke(n.viewer))return;this.geoPolyline=this.dv(new xe(n,e.id)),this.czmWater=this.dv(new mo(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},xc[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};m(Al,"type",Al.register("ESCesiumViewer",a.ESGeoWater.type,Al));let Xp=Al;const Tl=class Tl extends jt{constructor(e,n){super(e,n);m(this,"_czmImagery");m(this,"mvtLayerJson",{mainJson:"",pointJson:[],otherJson:[]});if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const r=this.dv(a.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),l=()=>{s.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};l(),this.d(r.don(l))}}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Tl,"type",Tl.register("ESCesiumViewer",fh.type,Tl));let bh=Tl;class LT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:_,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(..._),u.push(...this.setIndexs(P))}const[f,g,v]=Dt({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const w=this.setTextureCoordinates(n,o);c.push(...w.flat()),this.updateCustomPrimitive(s,g,l,u,c),o.computeBoundingBox()}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],v=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],w=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,v],[d,p],[p,y]],_=[[f,g],[f,v],[g,y],[v,y]];return{outlinePionts:[...w,...P,..._],customPrimitivePoints:[u,c,d,p,g,f,v,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=Dt({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],v=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+v),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Ml=class Ml extends yt{constructor(e,n){super(e,n);m(this,"_line",this.dv(new xe(this.czmViewer,this.sceneObject.id)));m(this,"_czmTexture",this.ad(new Oe(this.czmViewer,this.sceneObject.id)));m(this,"_czmCustomPrimitive",this.dv(new Fe(this.czmViewer,this.sceneObject.id)));m(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new LT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
1747
1747
|
in vec2 v_st;
|
|
1748
1748
|
void main()
|
|
1749
1749
|
{
|
|
@@ -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()){u.sources.has(w)||u.sources.set(w,new Map);const _=Array.isArray(P.tiles)?P.tiles:[P.tiles];for(const S of _){if(!S.includes("{z}")||P.maxzoom&&o>P.maxzoom||P.minzoom&&o<P.minzoom)continue;const E=S.replace("{z}",o.toString()).replace("{x}",s.toString()).replace("{y}",c.toString());try{const A=await we.Resource.fetchArrayBuffer({url:E});if(!A)continue;const R=new m_(A),O=new v_.VectorTile(R);for(const B in O.layers)if(Object.prototype.hasOwnProperty.call(O.layers,B)){const V=O.layers[B],U=new Set;for(let z=0;z<V.length;z++){const N=V.feature(z);U.add(N.toGeoJSON(s,r,o))}(g=u.sources.get(w))==null||g.set(B,U)}}catch(A){console.error(`Failed to load tile ${n}:`,A)}}}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=new Set,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.has(p)&&o.add(p),f&&!o.has(f)&&o.add(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();if(s){const r=new Set([...s].flatMap(l=>[...l]));this.screenManager.remove("VectorTile",e,r,!0),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,new Set),(r=this.callbacks.get(s))==null||r.add(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},l=new Set;vm(e.scene.globe._surface._tilesToRender,e.scene.terrainProvider,r).forEach(c=>l.add(`${c.level}-${c.x}-${c.y}`)),!n.has(o)&&n.set(o,l)}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||f.size==0))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,d,!1),this.tileRenderer.update(s,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++,l.label.show=n.show??!0,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++,l.billboard.show=n.show??!0,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++,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=e instanceof Set?e:new Set([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,n=!1){const o=e instanceof Set?e:typeof e=="string"?new Set([e]):e;if(o instanceof Set){for(const s of o){const r=this.objects.get(s);r&&(r.label&&(r.labelRefCount>1&&!n?r.labelRefCount--:(this.screenManager.labelCollection.remove(r.label),r.label=void 0)),r.billboard&&(r.billboardRefCount>1&&!n?r.billboardRefCount--:(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0)),r.rectangle&&(r.rectangleRefCount>1&&!n?r.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0)),this.tryDeleteEmpty(s))}return!0}else{for(const s of Object.keys(o)){const r=o[s]instanceof Set?o[s]:new Set([o[s]]);for(const l of r){if(!l)continue;const c=this.objects.get(l);if(c){if(c[`${s}RefCount`]>1&&!n)c[`${s}RefCount`]--;else{const u=c[s];u&&(this.screenManager.collectionMap[s].remove(u),c[s]=void 0)}this.tryDeleteEmpty(l)}}}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 instanceof Set&&o.size===0?!1:(r.update(o,s),this.refresh(),!0)}remove(e,n,o,s=!1){const r=this.getLayer(e);if(!r.remove(o,s)){console.warn(`屏幕管理器,删除${n}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.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.7",e="2025-11-21T08:49:25.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="0e3ca8b8366860dc0f51a8bc93f13eb5150cd663",l=((Date.now()-1763714965e3)/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}","0e3ca8b8366860dc0f51a8bc93f13eb5150cd663")},get info(){return c},get date(){return"2025-11-21T08:49:25.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.7"},get name(){return"earthsdk3-cesium"},get commitId(){return"0e3ca8b8366860dc0f51a8bc93f13eb5150cd663"},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"})});
|