earthsdk3-cesium 3.4.0-beta.6 → 3.4.0-beta.8
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 +8 -8
- package/dist/earthsdk3-cesium.js +137 -140
- package/dist/earthsdk3-cesium.umd.cjs +8 -8
- package/dist/types/CzmObjects/base/CzmESVisualObject.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmES3DTileset/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmES3DTileset/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESAlarm/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESAlarm/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESApertureEffect/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESApertureEffect/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESAreaMeasurement/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESAreaMeasurement/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESBlastParticleSystem/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESBlastParticleSystem/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESBoxClipping/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESBoxClipping/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESCameraView/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESCameraView/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESCameraVisibleRange/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESCameraVisibleRange/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESCar/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESCar/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESCityBasePoint/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESCityBasePoint/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESClassification/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESClassification/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESClippingPlane/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESClippingPlane/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESCustomPrimitive/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESCustomPrimitive/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESCzml/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESCzml/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESDataMesh/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESDataMesh/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESDirectionMeasurement/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESDirectionMeasurement/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESDistanceMeasurement/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESDistanceMeasurement/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESDynamicWater/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESDynamicWater/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESEntityCluster/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESEntityCluster/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESExcavate/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESExcavate/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESFireParticleSystem/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESFireParticleSystem/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeHistoryImagery/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeHistoryImagery/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoBezierPath/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoBezierPath/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoDiv/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoDiv/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoDivTextPoi/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoDivTextPoi/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoExtrudedPolygon/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoExtrudedPolygon/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoJson/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoJson/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoLineString/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoLineString/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoPoints/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoPoints/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoPolygon/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoPolygon/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoRectangle/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoRectangle/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoSmoothPolygon/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoSmoothPolygon/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoWater/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGeoWater/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESGltfModel/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESGltfModel/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESHeatMap/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESHeatMap/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESHeightMeasurement/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESHeightMeasurement/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESHuman/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESHuman/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESHumanPoi/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESHumanPoi/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESImageLabel/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESImageLabel/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESImageryLayer/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESImageryLayer/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESKml/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESKml/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalCircle/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalCircle/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalLineString/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalLineString/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalLineStringZ/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalLineStringZ/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalPolygon/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalPolygon/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalPolygonZ/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalPolygonZ/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalRectangle/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalRectangle/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalSkyBox/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocalSkyBox/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESLocationMeasurement/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESLocationMeasurement/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESMVTLayer/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESMVTLayer/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESMsTileset/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESMsTileset/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESNavigator/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESNavigator/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESParticleSystemPrimitive/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESParticleSystemPrimitive/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPath/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPath/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPipeFence/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPipeFence/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPipeline/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPipeline/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPipeserTileset/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPipeserTileset/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPit/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPit/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPoi2D/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPoi2D/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPoi3D/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPoi3D/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPolygonFence/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPolygonFence/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPolygonFlattenedPlane/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPolygonFlattenedPlane/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPolygonWithHole/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESPolygonWithHole/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESRectangle/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESRectangle/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESRoad/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESRoad/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESRtsFeatureEditing/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESRtsFeatureEditing/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESRtsTileset/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESRtsTileset/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESScale/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESScale/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESSkylineAnalysis/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESSkylineAnalysis/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESStaticMesh/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESStaticMesh/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESSubmergingAnalysis/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESSubmergingAnalysis/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESSunshineAnalysis/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESSunshineAnalysis/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESSurfaceAreaMeasurement/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESSurfaceAreaMeasurement/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESTerrainLayer/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESTerrainLayer/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESTextLabel/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESTextLabel/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESUEWidget/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESUEWidget/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESUnrealActor/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESUnrealActor/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESVideoFusion/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESVideoFusion/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESViewShed/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESViewShed/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESViewerStatusBar/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESViewerStatusBar/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESViewerStatusBarScale/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESViewerStatusBarScale/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESVisibilityAnalysis/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESVisibilityAnalysis/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESVolumeMeasurement/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESVolumeMeasurement/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESWidget/index.d.ts +1 -1
- package/dist/types/CzmObjects/general/CzmESWidget/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/index.d.ts +2 -0
- package/dist/types/ESCesiumViewer/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixCameraFlight.d.ts +1 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixCameraFlight.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var EarthSDK3_Cesium=function(ae,it,d,V){"use strict";var yV=Object.defineProperty;var vV=(ae,it,d)=>it in ae?yV(ae,it,{enumerable:!0,configurable:!0,writable:!0,value:d}):ae[it]=d;var L=(ae,it,d)=>vV(ae,typeof it!="symbol"?it+"":it,d);var ra=typeof document<"u"?document.currentScript:null;function FE(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const C=FE(it);window.Cesium=C;function BE(){Object.keys(C).forEach(t=>{C[t].prototype&&Object.defineProperty(C[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:d.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const n=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);n&&(C.Ion.defaultAccessToken=n[1],console.log("更新默认Cesium.Ion.Token成功"))});const $l=class $l extends d.Destroyable{};L($l,"defaults",{enabled:!0}),L($l,"createDefaultProps",()=>({...$l.defaults}));let xn=$l;d.extendClassProps(xn.prototype,xn.createDefaultProps);class Un extends V.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r)=>this.flyTo(o,r))),this.d(n.flyInEvent.don((o,r)=>this.flyIn(o,r))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:s}=o;n.flyInParam={position:r,rotation:s,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")})),this.ad(this.createdEvent.don(()=>{this.ad(d.nextAnimateFrame(()=>{n.createdEvent.emit()}))}))}flyToWithPromise(n,e,i,o,r,s,a){const{sceneObject:l,czmViewer:u}=this,h=u.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:s??0,pDelta:a??0},e);h&&h.then(c=>{})}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyToParam&&(i.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}get czmViewer(){return this.viewer}}function ft(t,n){return C.Cartesian3.fromDegrees(...t,void 0,n)}const ME=new C.Cartographic;function Ue(t,n){const e=C.Cartographic.fromCartesian(t,void 0,ME);if(e)return n=n||[0,0,0],n[0]=C.Math.toDegrees(e.longitude),n[1]=C.Math.toDegrees(e.latitude),n[2]=e.height,n}function Xe(t,n){return n=n||new C.Cartesian2,n.x=t[0],n.y=t[1],n}function Yv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function Yn(t,n){return n=n||new C.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ms(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function Bf(t,n){return n=n||new C.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Jv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function Jn(t,n){if(t.length===4)return Bf(t,n);if(t.length===3)return Yn(t,n);if(t.length===2)return Xe(t,n);throw new Error("toCartesian error: should not be here!")}function DE(t,n){if(t instanceof C.Cartesian2)return Yv(t,n);if(t instanceof C.Cartesian3)return Ms(t,n);if(t instanceof C.Cartesian4)return Jv(t,n);throw new Error("fromCartesian error: should not be here!")}function RE(t,n){return n=n||new C.Cartographic,n.longitude=C.Math.toRadians(t[0]),n.latitude=C.Math.toRadians(t[1]),n.height=t[2],n}function oa(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.longitude),n[1]=C.Math.toDegrees(t.latitude),n[2]=t.height,n}function Ie(t,n){return n=n||new C.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function UE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function cr(t,n){return n=n||new C.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function OE(t,n){return n=n||[0,0,0,0],n[0]=t.near,n[1]=t.nearValue,n[2]=t.far,n[3]=t.farValue,n}function jv(t,n){return n=n||new C.HeadingPitchRoll,n.heading=C.Math.toRadians(t[0]-90),n.pitch=C.Math.toRadians(t[1]),n.roll=C.Math.toRadians(t[2]),n}function LE(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.heading+C.Math.PI_OVER_TWO),n[1]=C.Math.toDegrees(t.pitch),n[2]=C.Math.toDegrees(t.roll),n}function Ds(t,n){return n=n||new C.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function zE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function QE(t,n){return n=n||new C.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function VE(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}const NE=new C.HeadingPitchRoll,HE=new C.Cartesian3;function GE(t,n,e){const i=jv(n,NE),o=ft(t,HE);return C.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function mt(t,n){return n=n||new C.Rectangle,n.west=t[0]*Math.PI/180,n.south=t[1]*Math.PI/180,n.east=t[2]*Math.PI/180,n.north=t[3]*Math.PI/180,n}function WE(t,n){return n=n||[0,0,0,0],n[0]=t.west,n[1]=t.south,n[2]=t.east,n[3]=t.north,n}const qE=new C.Cartesian3;function Ke(t,n){return n=n||new C.Ellipsoid,C.Ellipsoid.fromCartesian3(C.Cartesian3.fromArray(t,void 0,qE),n)}function KE(t,n){return n=n||[0,0,0],n[0]=t.radii.x,n[1]=t.radii.y,n[2]=t.radii.z,n}function ui(t){if(t.type==="GeographicTilingScheme")return new C.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),rectangle:t.rectangle&&mt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new C.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new bb({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new Cb({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function Rs(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:s,edgeWidth:a}=t;let l=o&&C.Matrix4.fromArray(o);return n&&(l=l||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4),C.Matrix4.multiply(n,l,l)),new C.ClippingPlaneCollection({planes:e&&e.map(u=>new C.ClippingPlane(Yn(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:s&&Ie(s),edgeWidth:a})}function Kc(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new C.ClippingPlane(Yn(r.normal),r.distance));let o=i.modelMatrix&&C.Matrix4.fromArray(i.modelMatrix)||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4);e&&C.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Ie(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function Zc(t){const{polygons:n,enabled:e,inverse:i}=t;return new C.ClippingPolygonCollection({polygons:n&&n.map(o=>new C.ClippingPolygon({positions:o.positions.map(r=>ft(r))})),enabled:e,inverse:i})}function Xc(t,n){return Mf(t,C.Cartesian3.UNIT_Y,C.Cartesian3.UNIT_Z,C.Cartesian3.UNIT_X,n)}function e0(t,n){return Mf(t,C.Cartesian3.UNIT_X,C.Cartesian3.UNIT_Z,new C.Cartesian3(0,-1,0),n)}function Mf(t,n,e,i,o){const[r,s,a]=t,l=C.Quaternion.fromAxisAngle(e,C.Math.toRadians(-r)),u=C.Quaternion.fromAxisAngle(i,C.Math.toRadians(s)),h=C.Quaternion.fromAxisAngle(n,C.Math.toRadians(a)),c=C.Quaternion.clone(C.Quaternion.IDENTITY,o);return C.Quaternion.multiply(h,c,c),C.Quaternion.multiply(u,c,c),C.Quaternion.multiply(l,c,c),c}function hr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function t0(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function at(t,n){if(!((!t.localScale||hr(t.localScale,3))&&(!t.localRotation||hr(t.localRotation,3))&&(!t.localPosition||hr(t.localPosition,3))&&(!t.localModelMatrix||hr(t.localModelMatrix,16))&&(!t.scale||hr(t.scale,3))&&(!t.rotation||hr(t.rotation,3))&&(!t.position||hr(t.position,3))&&(!t.modelMatrix||hr(t.modelMatrix,16)))||t.localScale&&!t0(t.localScale)||t.scale&&!t0(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 i=n??C.Matrix4.clone(C.Matrix4.IDENTITY);if(t.localScale){const[o,r,s]=t.localScale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=C.Quaternion.fromAxisAngle(C.Cartesian3.UNIT_Z,C.Math.toRadians(90)),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=Xc(t.localRotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=C.Matrix4.fromTranslation(C.Cartesian3.fromArray(t.localPosition));C.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=C.Matrix4.fromArray(t.localModelMatrix);C.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,o,o),new C.Matrix4);C.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,s]=t.scale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if(t.rotation){const o=Xc(t.rotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=C.Cartesian3.fromDegrees(...t.position),r=C.Transforms.eastNorthUpToFixedFrame(o);C.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=C.Matrix4.fromArray(t.modelMatrix);C.Matrix4.multiply(o,i,i)}return i}const ZE=new C.Cartesian3,Us=new C.HeadingPitchRoll,XE=new C.Matrix4,$E=new C.Cartesian3,YE=new C.Cartographic;function JE(t,n=[0,0,0],e=0,i){const[o,r,s]=t,a=C.Cartesian3.fromDegrees(o,r,s,void 0,ZE),l=[...n];for(let h=0;h<3;++h)l[h]=C.Math.RADIANS_PER_DEGREE*l[h];if(e!==0){Us.heading=l[0],Us.pitch=l[1],Us.roll=l[2],Us.heading-=C.Math.PI_OVER_TWO;const h=C.Transforms.headingPitchRollToFixedFrame(a,Us,void 0,void 0,XE),c=C.Matrix4.multiplyByPointAsVector(h,C.Cartesian3.UNIT_X,$E);C.Cartesian3.multiplyByScalar(c,e,c),C.Cartesian3.subtract(a,c,a)}const u=C.Cartographic.fromCartesian(a,void 0,YE);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function n0(t,n,e,i){return JE(t,n,e,i)}const Ar=C.Math.toDegrees;function Sn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=Ar(e),n[1]=Ar(i),n[2]=o,n):[Ar(e),Ar(i),o]}function aa(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=Ar(e),n[1]=Ar(i),n[2]=Ar(o),n):[e,i,o].map(Ar)}class $c extends d.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new C.Matrix4);L(this,"_originProjMatrix",new C.Matrix4);L(this,"_changed",new d.Event);this._scene=e;const i=this._scene.camera;C.Matrix4.clone(i.viewMatrix,this._originViewMatrix),C.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){C.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(C.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),C.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(C.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class jE extends d.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class e2 extends d.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new d.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new jE(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class oo extends d.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(d.react(1)));L(this,"_viewDistance",this.disposeVar(d.react(0)));L(this,"_debug",this.disposeVar(d.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new e2(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:s,czmViewer:a}=this,[l,u,h]=d.getReactFuncs(i),[c,A,p]=d.getReactFuncs(s),[f,g,v]=r?d.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let b=1,E=Number.NEGATIVE_INFINITY;const T=l(),P=c(),k=f?f():0,D=a.getCurrentCameraInfo();if(!T||!P||!D){this._viewDistance.value=E,this._visibleAlpha.value=b;return}E=V.cartesianDistance(D.position,P)-(k??0);const[B,S,I,w]=T;B>S||S>I||I>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=I?b=1:E<=B||E>=w?b=0:E>B&&E<S?S-B<=0?b=0:b=(E-B)/(S-B):E>I&&E<w?(w<=I&&(b=0),b=(w-E)/(w-I)):(b=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=b};y();const m=[a.cameraChanged,h,p];v&&m.push(v);const _=this.disposeVar(d.createNextAnimateFrameEvent(...m));this.dispose(_.disposableOn(y))}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 t2=new C.BoundingSphere(C.Cartesian3.ZERO,0);function Oi(t,n,e){var i=t2;C.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function qt(t){const n=t.length;let e;const i=[];for(let o=0;o<n;++o){const[r,s,a]=t[o],l=C.Cartesian3.fromDegrees(r,s,a);if(!l)continue;const{x:u,y:h,z:c}=l;[u,h,c].every(Number.isFinite)&&(!e||!C.Cartesian3.equals(e,l))&&(e=l,i.push(e))}return i}function ao(t,n,e,i){const o=V.geoRhumbDistance(t,e),r=V.geoRhumbHeading(t,e),s=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return s>0?V.geoRhumbDestination(t,o,n,i):V.geoRhumbDestination(t,o,n+180,i),[s>0?o:-o,i]}function n2(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const s=V.geoRhumbDestination(t,i*r,n);s&&o.push(s)}return o}function i2(t,n){return V.geoNearestPointOnLine(t,n).geometry.coordinates}const i0=new C.Cartesian3,r2=new C.Ray,o2=new C.Plane(C.Cartesian3.UNIT_X,0);function Yc(t,n,e,i){const o=C.Cartesian3.normalize(n,i0),r=C.Cartesian3.cross(t.camera.right,o,i0);C.Cartesian3.normalize(r,r);const s=C.Plane.fromPointNormal(n,r,o2),a=t.camera.getPickRay(e,r2);if(a)return C.IntersectionTests.rayPlane(a,s,i)}const Df=new C.Cartesian3,a2=new C.Ray,s2=new C.Cartographic,l2=new C.Ellipsoid;function sa(t,n,e,i){const o=t.camera.getPickRay(n,a2);if(!o)return;const r=C.Cartesian3.fromElements(e,e,e,Df),s=C.Cartesian3.add(r,C.Ellipsoid.WGS84.radii,Df),a=C.Ellipsoid.fromCartesian3(s,l2),l=C.IntersectionTests.rayEllipsoid(o,a);if(l){const u=l.start>0?l.start:l.stop;if(u){const h=C.Ray.getPoint(o,u,Df),c=C.Cartographic.fromCartesian(h,void 0,s2);return i=i||new C.Cartographic,i.longitude=c.longitude,i.latitude=c.latitude,i.height=e,i}else return}else return}function la(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function r0(t){const n=C.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const o0=new C.Cartographic,a0=new C.Cartesian3,An=[0,0,0],fr=[0,0,0],Rf=new C.Cartesian2,Uf=new C.Cartesian3;function Of(t,n,e,i,o,r){o.constraintMode="none",la([0,0,0],o.startDragPos),r=r||{},Jn(d.getDomEventCurrentTargetPos(t),Rf);const s=e.position;if(!ft(s,Uf))return;const a=Oi(n,Uf,i);if(a===void 0||!Yc(n,Uf,Rf,a0)||!Ue(a0,An))return;const l=r0(An[2])*V.geoDistance(s,An);if(!r.z&&l<a&&Math.abs(s[2]-An[2])<e.dimensions[0]&&An[2]>s[2])return o.constraintMode="z",la(An,o.startDragPos),!0;if(!sa(n,Rf,s[2],o0)||!oa(o0,An))return;const u=r0(s[2])*V.geoDistance(s,An),h=e.dimensions[0];if(!(u>1.05*h)){if(!r.zAxis&&u>.95*h&&u<=1.05*h){o.constraintMode="zAxis",la(An,o.startDragPos);return}{const[c,A]=ao(s,e.heading+90,An,fr);if(!r.x&&c>0&&A&&(fr[2]=s[2],V.geoDistance(fr,An)<a)){o.constraintMode="x",la(fr,o.startDragPos);return}}{const[c,A]=ao(s,e.heading,An,fr);if(!r.y&&c>0&&A&&(fr[2]=s[2],V.geoDistance(fr,An)<a)){o.constraintMode="y",la(fr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",la(An,o.startDragPos))}}async function s0(t,n,e,i){var a;const o=(a=t.viewer)==null?void 0:a.scene;if(!o)throw new Error("!scene");const r=d.getDomEventCurrentTargetPos(n),s=Jn(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=sa(o,s,e);return l?oa(l):void 0}}let Lf,zf;function l0(t,n,e,i,o){o=o||new C.Cartesian3,Lf=Lf||new C.Ray,zf=zf||new C.Plane(C.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,Lf),s=C.Plane.fromPointNormal(n,e,zf);return o=C.IntersectionTests.rayPlane(r,s,o),o}function u0(t){const n=C.Material.fromType(t.type);return Qf(n,t),n}function En(t){return t&&V.ESSceneObject.context.getStrFromEnv(t)||C.Material.DefaultImageId}function u2(t){return{x:t[0],y:t[1]}}function Qf(t,n){n.type==="Color"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.gapColor=Ie(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.outlineColor=Ie(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.color=Ie(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Ie(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Xe(n.lineCount??[8,8]),t.uniforms.lineThickness=Xe(n.lineThickness??[1,1]),t.uniforms.lineOffset=Xe(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Ie(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Ie(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Ie(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Ie(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Ie(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Ie(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Ie(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Ie(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=En(n.specularMap),t.uniforms.normalMap=En(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Ie(n.color??[1,0,0,.7]),t.uniforms.rimColor=Ie(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Ie(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Ie(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=u2(n.fadeDirection??[!0,!0]),t.uniforms.time=Xe(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Ie(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=En(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=En(n.image):n.type==="ElevationBand"?(t.uniforms.color=En(n.colors),t.uniforms.heights=En(n.heights)):console.warn(`未知材质类型,无法更新 ${n.type}`)}function jn(t,n){const e=d.react(void 0);let i="";const[o,r,s]=d.getReactFuncs(t),a=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=u0(l)):e.value&&Qf(e.value,l):(i="",e.value=void 0)}catch{}};return a(),e.dispose(s.disposableOn(a)),e}function Li(t){const n=qt(t.positions),e=t.holes&&t.holes.map(i=>Li(i));return{positions:n,holes:e}}function Vf(t,n){const e=Math.PI/180,i=1/e,o=new C.Cartographic(t[0]*e,t[1]*e,t[2]),r=new C.Cartographic(n[0]*e,n[1]*e,n[2]),s=new C.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new C.Cartographic);if(s)return s.height=(o.height+r.height)*.5,[s.longitude*i,s.latitude*i,s.height]}const c0=new C.Cartesian4,c2=new C.Matrix4;function h2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function h0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function A0(t,n,e){if(t.scene.mode!==C.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,s=t.camera.frustum.projectionMatrix,a=C.Matrix4.multiply(s,r,c2),l=C.Matrix4.multiplyByVector(a,C.Cartesian4.fromElements(n.x,n.y,n.z,1,c0),c0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),h=i*(l.y*.5+.5),c=o-u,A=i-h,p=l.z;if(!(u<0||h<0||c<0||A<0||p<0||p>1))return e?(e.left=u,e.top=A,e.right=c,e.bottom=h,e.depth=p):e={left:u,top:A,right:c,bottom:h,depth:p},e}const so={left:0,top:0,right:0,bottom:0,depth:0};class Jc extends d.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new C.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new d.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new $c(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}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 i=A0(this._viewer,this._cartesian,so);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?h0(this._winPos,so)||(e=!0,this._winPos.left=so.left,this._winPos.top=so.top,this._winPos.right=so.right,this._winPos.bottom=so.bottom,this._winPos.depth=so.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){C.Cartesian3.equals(this._cartesian,e)||(C.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function f0(t){const n=C.Math.toRadians(t[0]),e=C.Math.toRadians(t[1]),i=C.Math.toRadians(t[2]),o=C.Matrix3.fromHeadingPitchRoll(new C.HeadingPitchRoll(n,e,i)),r=new C.Cartesian3;return C.Matrix3.multiplyByVector(o,C.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const A2=C.Check,f2=C.defaultValue,lo=C.defined,d0=C.Math.EPSILON10;function d2(t,n,e,i){if(A2.defined("equalsEpsilon",n),!lo(t))return;e=f2(e,!1);const o=lo(i),r=t.length;if(r<2)return t;let s,a=t[0],l,u,h=0,c=-1;for(s=1;s<r;++s)l=t[s],n(a,l,d0)?(lo(u)||(u=t.slice(0,s),h=s-1,c=0),o&&i.push(s)):(lo(u)&&(u.push(l),h=s,o&&(c=i.length)),a=l);return e&&n(t[0],t[r-1],d0)&&(o&&(lo(u)?i.splice(c,0,h):i.push(r-1)),lo(u)?u.length-=1:u=t.slice(0,-1)),lo(u)?u:t}const He=C.Cartesian3,ua=C.Cartographic,uo=C.defaultValue,co=C.defined,p0=C.DeveloperError,m0=C.Ellipsoid,p2=C.EllipsoidGeodesic,g0=C.EllipsoidRhumbLine,m2=C.IntersectionTests,Nf=C.Math,ca=C.Matrix4,ho=C.Plane,Ft={};Ft.numberOfPoints=function(t,n,e){const i=He.distance(t,n);return Math.ceil(i/e)},Ft.numberOfPointsRhumbLine=function(t,n,e){const i=Math.pow(t.longitude-n.longitude,2)+Math.pow(t.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(e*e))))};const g2=new ua;Ft.extractHeights=function(t,n){const e=t.length,i=new Array(e);for(let o=0;o<e;o++){const r=t[o];i[o]=n.cartesianToCartographic(r,g2).height}return i};const y2=new ca,v2=new He,y0=new He,w2=new ho(He.UNIT_X,0),v0=new He,_2=new ho(He.UNIT_X,0),b2=new He,C2=new He,Hf=[];function w0(t,n,e){const i=Hf;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const s=(e-n)/t;for(o=0;o<t;o++){const a=n+o*s;i[o]=a}return i}const jc=new ua,eh=new ua,dr=new He,Gf=new He,x2=new He,Wf=new p2;let Os=new g0;function S2(t,n,e,i,o,r,s,a){const l=i.scaleToGeodeticSurface(t,Gf),u=i.scaleToGeodeticSurface(n,x2),h=Ft.numberOfPoints(t,n,e),c=i.cartesianToCartographic(l,jc),A=i.cartesianToCartographic(u,eh),p=w0(h,o,r);Wf.setEndPoints(c,A);const f=Wf.surfaceDistance/h;let g=a;c.height=o;let v=i.cartographicToCartesian(c,dr);He.pack(v,s,g),g+=3;for(let y=1;y<h;y++){const m=Wf.interpolateUsingSurfaceDistance(y*f,eh);m.height=p[y],v=i.cartographicToCartesian(m,dr),He.pack(v,s,g),g+=3}return g}function E2(t,n,e,i,o,r,s,a){const l=i.cartesianToCartographic(t,jc),u=i.cartesianToCartographic(n,eh),h=Ft.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const c=w0(h,o,r);Os.ellipsoid.equals(i)||(Os=new g0(void 0,void 0,i)),Os.setEndPoints(l,u);const A=Os.surfaceDistance/h;let p=a;l.height=o;let f=i.cartographicToCartesian(l,dr);He.pack(f,s,p),p+=3;for(let g=1;g<h;g++){const v=Os.interpolateUsingSurfaceDistance(g*A,eh);v.height=c[g],f=i.cartographicToCartesian(v,dr),He.pack(f,s,p),p+=3}return p}Ft.wrapLongitude=function(t,n){const e=[],i=[];if(co(t)&&t.length>0){n=uo(n,ca.IDENTITY);const o=ca.inverseTransformation(n,y2),r=ca.multiplyByPoint(o,He.ZERO,v2),s=He.normalize(ca.multiplyByPointAsVector(o,He.UNIT_Y,y0),y0),a=ho.fromPointNormal(r,s,w2),l=He.normalize(ca.multiplyByPointAsVector(o,He.UNIT_X,v0),v0),u=ho.fromPointNormal(r,l,_2);let h=1;e.push(He.clone(t[0]));let c=e[0];const A=t.length;for(let p=1;p<A;++p){const f=t[p];if(ho.getPointDistance(u,c)<0||ho.getPointDistance(u,f)<0){const g=m2.lineSegmentPlane(c,f,a,b2);if(co(g)){const v=He.multiplyByScalar(s,5e-9,C2);ho.getPointDistance(a,c)<0&&He.negate(v,v),e.push(He.add(g,v,new He)),i.push(h+1),He.negate(v,v),e.push(He.add(g,v,new He)),h=1}}e.push(He.clone(t[p])),h++,c=f}i.push(h)}return{positions:e,lengths:i}},Ft.generateArc=function(t){co(t)||(t={});const n=t.positions;if(!co(n))throw new p0("options.positions is required.");const e=n.length,i=uo(t.ellipsoid,m0.WGS84);let o=uo(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const g=i.scaleToGeodeticSurface(n[0],Gf);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(g,dr);He.multiplyByScalar(v,o,v),He.add(g,v,g)}return[g.x,g.y,g.z]}let s=t.minDistance;if(!co(s)){const g=uo(t.granularity,Nf.RADIANS_PER_DEGREE);s=Nf.chordLength(g,i.maximumRadius)}let a=0,l;for(l=0;l<e-1;l++)a+=Ft.numberOfPoints(n[l],n[l+1],s);const u=(a+1)*3,h=new Array(u);let c=0;for(l=0;l<e-1;l++){const g=n[l],v=n[l+1],y=r?o[l]:o,m=r?o[l+1]:o;c=S2(g,v,s,i,y,m,h,c)}Hf.length=0;const A=n[e-1],p=i.cartesianToCartographic(A,jc);p.height=r?o[e-1]:o;const f=i.cartographicToCartesian(p,dr);return He.pack(f,h,u-3),h};const _0=new ua,P2=new ua;Ft.generateRhumbArc=function(t){co(t)||(t={});const n=t.positions;if(!co(n))throw new p0("options.positions is required.");const e=n.length,i=uo(t.ellipsoid,m0.WGS84);let o=uo(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],Gf);if(o=r?o[0]:o,o!==0){const m=i.geodeticSurfaceNormal(y,dr);He.multiplyByScalar(m,o,m),He.add(y,m,y)}return[y.x,y.y,y.z]}const s=uo(t.granularity,Nf.RADIANS_PER_DEGREE);let a=0,l,u=i.cartesianToCartographic(n[0],_0),h;for(l=0;l<e-1;l++)h=i.cartesianToCartographic(n[l+1],P2),a+=Ft.numberOfPointsRhumbLine(u,h,s),u=ua.clone(h,_0);const c=(a+1)*3,A=new Array(c);let p=0;for(l=0;l<e-1;l++){const y=n[l],m=n[l+1],_=r?o[l]:o,b=r?o[l+1]:o;p=E2(y,m,s,i,_,b,A,p)}Hf.length=0;const f=n[e-1],g=i.cartesianToCartographic(f,jc);g.height=r?o[e-1]:o;const v=i.cartographicToCartesian(g,dr);return He.pack(v,A,c-3),A},Ft.generateCartesianArc=function(t){const n=Ft.generateArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=He.unpack(n,o*3);return i},Ft.generateCartesianRhumbArc=function(t){const n=Ft.generateRhumbArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=He.unpack(n,o*3);return i};const th=C.ArcType,T2=C.Cartesian3,I2=C.Math;function b0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=d2(t.positions,T2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===th.GEODESIC||n===th.RHUMB){let a;n===th.GEODESIC?(a=I2.chordLength(e,i.maximumRadius),Ft.numberOfPoints):(a=e,Ft.numberOfPointsRhumbLine);const l=Ft.extractHeights(r,i);n===th.GEODESIC?r=Ft.generateCartesianArc({positions:r,minDistance:a,ellipsoid:i,height:l}):r=Ft.generateCartesianRhumbArc({positions:r,granularity:a,ellipsoid:i,height:l})}return r}}function qf(t,n="GEODESIC",e){const o=t.map(V.lbhToXyz).map(c=>C.Cartesian3.fromArray(c));let r;if(e>0&&n!=="NONE"){if(r=b0({arcType:C.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:C.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let s=0;const a=[0],l=r.length;for(let c=1;c<l;++c)s+=C.Cartesian3.distance(r[c-1],r[c]),a.push(s);const u=r.map(c=>V.xyzToLbh([c.x,c.y,c.z]));return{timePosRots:a.map((c,A)=>[a[A],u[A],void 0]),distances:a}}function C0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function Kf(t,n){const e=C.Matrix4.clone(C.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:s="YForwardZUp"}=t;if(i){const[a,l,u]=i;C.Transforms.eastNorthUpToFixedFrame(C.Cartesian3.fromDegrees(a,l,u),void 0,e)}if(o){const a=new C.Quaternion;s==="YForwardZUp"?Xc(o,a):s==="XForwardZUp"&&e0(o,a);const l=C.Matrix3.fromQuaternion(a);C.Matrix4.multiply(e,C.Matrix4.fromRotationTranslation(l),e)}return r&&C.Matrix4.multiplyByScale(e,Jn(r),e),C0(e,n)}const k2=new C.Matrix4;function x0(t,n){const e=C.Matrix4.fromArray(t,0,k2);return C.Matrix4.inverse(e,e),C0(e,n)}const F2=new C.Matrix4,B2=new C.Cartesian3;function S0(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromDegrees(i,o,r,void 0,B2),a=C.Matrix4.fromArray(t,0,F2),l=C.Matrix4.multiplyByPoint(a,s,s),{x:u,y:h,z:c}=l;return e=e||[0,0,0],e[0]=u,e[1]=h,e[2]=c,e}const M2=new C.Matrix4,D2=new C.Cartesian3,R2=new C.Cartographic;function pr(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromElements(i,o,r,D2),a=C.Matrix4.fromArray(t,0,M2),l=C.Matrix4.multiplyByPoint(a,s,s),u=C.Cartographic.fromCartesian(l,void 0,R2);return e=e||[0,0,0],e[0]=C.Math.toDegrees(u.longitude),e[1]=C.Math.toDegrees(u.latitude),e[2]=u.height,e}function fn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=Kf({position:e,rotation:i,scale:o,initialRotationMode:r}),a=x0(s);return[n.map(u=>S0(a,u)),s,a]}function mr(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=Kf({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>pr(s,l)),s]}function E0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=it.Cartesian3.fromDegrees(...t[e]),o=it.Cartesian3.fromDegrees(...t[e+1]),r=it.Cartesian3.fromDegrees(...t[e+2]),s=it.Cartesian3.angleBetween(it.Cartesian3.subtract(i,o,new it.Cartesian3),it.Cartesian3.subtract(r,o,new it.Cartesian3));n.push(isNaN(s)?0:it.Math.toDegrees(s))}return n}function Zf(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>Ue(i)))),t.holes&&t.holes.forEach(i=>{e=Zf(i,e)}),e}function Pn(t){return typeof t=="string"?V.ESSceneObject.context.getStrFromEnv(t):new C.Resource({url:V.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 Xf extends d.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[s,a,l]=d.getReactFuncs(e),[u,h,c]=d.getReactFuncs(i),A=new C.Cartesian3,p=()=>{let f=s();f&&(f=[...f],n.editingHeightOffset&&(f[2]-=n.editingHeightOffset),C.Cartesian3.fromDegrees(...f,void 0,A))};p(),this.dispose(l.disposableOn(p)),this.dispose(r.preUpdate.addEventListener(()=>{if(C.Cartesian3.ZERO.equals(A))return;const f=Oi(r,A,o);f!==void 0?h([f,f,f]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${f??"undefined"}`)}))}}function U2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:C.Matrix4.toArray(C.Matrix4.IDENTITY);let e,i,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new C.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const A=t.root.boundingVolume.sphere[3];r=C.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray([A,0,0]),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,A,0]),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,0,A]),new C.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let s,a,l,u,h,c;return C.Matrix4.IDENTITY.equals(C.Matrix4.fromArray(n))?(s=Ue(e),u=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,e,new C.Cartesian3),new C.Cartesian3)),a=Ue(i),h=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,i,new C.Cartesian3),new C.Cartesian3)),l=Ue(o),c=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,o,new C.Cartesian3),new C.Cartesian3))):(s=pr(n,[e.x,e.y,e.z]),u=pr(n,[-e.x,-e.y,-e.z]),a=pr(n,[i.x,i.y,i.z]),h=pr(n,[-i.x,-i.y,-i.z]),l=pr(n,[o.x,o.y,o.z]),c=pr(n,[-o.x,-o.y,-o.z])),!s||!u||!a||!h||!l||!c?"无法生成包围盒,请检查包围盒是否正确":[C.Math.toRadians(Math.min(s[0],u[0],a[0],h[0],l[0],c[0])),C.Math.toRadians(Math.min(s[1],u[1],a[1],h[1],l[1],c[1])),C.Math.toRadians(Math.max(s[0],u[0],a[0],h[0],l[0],c[0])),C.Math.toRadians(Math.max(s[1],u[1],a[1],h[1],l[1],c[1])),Math.min(s[2],u[2],a[2],h[2],l[2],c[2]),Math.max(s[2],u[2],a[2],h[2],l[2],c[2])]}const P0=d.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await d.step(t,async l=>new Promise(async(u,h)=>{for(let c=0;c<n.length;c++){const A=n[c];await fetch(A).then(p=>p.json()).then(p=>{p&&!Reflect.has(p,"success")?i[A]=p:o.push({index:c,url:A,message:p.message}),c==n.length-1&&u()}).catch(p=>{o.push({index:c,url:A,message:p}),c==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],s=[],a=[];for(const l in i){const u=i[l];s.push(u.geometricError??u.root.geometricError??0);const h=U2(u);r.push(h),a.push({content:{uri:l},boundingVolume:{region:h},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...s),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=a),e});function O2(t){return new Promise((n,e)=>{P0.restart(void 0,t),P0.completeEvent.don(i=>{n(i)})})}class $f extends d.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(d.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(d.react(0)));const[i,o,r]=d.getReactFuncs(e);{const s=()=>{const a=i();if(a){const{center:l,minPos:u,maxPos:h}=V.getMinMaxCorner(a);this._center.value=l,this._radius.value=V.geoDistance(u,h)/2}else this._center.value=void 0};s(),this.dispose(r.disposableOn(s))}}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 T0(t){return new C.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new C.Color(.2,.3,.6,1),blendColor:new C.Color(0,1,.699,1),specularMap:C.Material.DefaultImageId,normalMap:C.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
1
|
+
var EarthSDK3_Cesium=function(ae,it,d,V){"use strict";var yV=Object.defineProperty;var vV=(ae,it,d)=>it in ae?yV(ae,it,{enumerable:!0,configurable:!0,writable:!0,value:d}):ae[it]=d;var L=(ae,it,d)=>vV(ae,typeof it!="symbol"?it+"":it,d);var ra=typeof document<"u"?document.currentScript:null;function FE(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const C=FE(it);window.Cesium=C;function BE(){Object.keys(C).forEach(t=>{C[t].prototype&&Object.defineProperty(C[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:d.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const n=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);n&&(C.Ion.defaultAccessToken=n[1],console.log("更新默认Cesium.Ion.Token成功"))});const $l=class $l extends d.Destroyable{};L($l,"defaults",{enabled:!0}),L($l,"createDefaultProps",()=>({...$l.defaults}));let xn=$l;d.extendClassProps(xn.prototype,xn.createDefaultProps);class Un extends V.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r)=>this.flyTo(o,r))),this.d(n.flyInEvent.don((o,r)=>this.flyIn(o,r))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:s}=o;n.flyInParam={position:r,rotation:s,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(n,e,i,o,r,s,a){const{sceneObject:l,czmViewer:u}=this,h=u.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:s??0,pDelta:a??0},e);h&&h.then(c=>{})}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyToParam&&(i.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}get czmViewer(){return this.viewer}}function ft(t,n){return C.Cartesian3.fromDegrees(...t,void 0,n)}const ME=new C.Cartographic;function Ue(t,n){const e=C.Cartographic.fromCartesian(t,void 0,ME);if(e)return n=n||[0,0,0],n[0]=C.Math.toDegrees(e.longitude),n[1]=C.Math.toDegrees(e.latitude),n[2]=e.height,n}function Xe(t,n){return n=n||new C.Cartesian2,n.x=t[0],n.y=t[1],n}function Yv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function Yn(t,n){return n=n||new C.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ms(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function Bf(t,n){return n=n||new C.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Jv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function Jn(t,n){if(t.length===4)return Bf(t,n);if(t.length===3)return Yn(t,n);if(t.length===2)return Xe(t,n);throw new Error("toCartesian error: should not be here!")}function DE(t,n){if(t instanceof C.Cartesian2)return Yv(t,n);if(t instanceof C.Cartesian3)return Ms(t,n);if(t instanceof C.Cartesian4)return Jv(t,n);throw new Error("fromCartesian error: should not be here!")}function RE(t,n){return n=n||new C.Cartographic,n.longitude=C.Math.toRadians(t[0]),n.latitude=C.Math.toRadians(t[1]),n.height=t[2],n}function oa(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.longitude),n[1]=C.Math.toDegrees(t.latitude),n[2]=t.height,n}function Ie(t,n){return n=n||new C.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function UE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function cr(t,n){return n=n||new C.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function OE(t,n){return n=n||[0,0,0,0],n[0]=t.near,n[1]=t.nearValue,n[2]=t.far,n[3]=t.farValue,n}function jv(t,n){return n=n||new C.HeadingPitchRoll,n.heading=C.Math.toRadians(t[0]-90),n.pitch=C.Math.toRadians(t[1]),n.roll=C.Math.toRadians(t[2]),n}function LE(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.heading+C.Math.PI_OVER_TWO),n[1]=C.Math.toDegrees(t.pitch),n[2]=C.Math.toDegrees(t.roll),n}function Ds(t,n){return n=n||new C.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function zE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function QE(t,n){return n=n||new C.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function VE(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}const NE=new C.HeadingPitchRoll,HE=new C.Cartesian3;function GE(t,n,e){const i=jv(n,NE),o=ft(t,HE);return C.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function mt(t,n){return n=n||new C.Rectangle,n.west=t[0]*Math.PI/180,n.south=t[1]*Math.PI/180,n.east=t[2]*Math.PI/180,n.north=t[3]*Math.PI/180,n}function WE(t,n){return n=n||[0,0,0,0],n[0]=t.west,n[1]=t.south,n[2]=t.east,n[3]=t.north,n}const qE=new C.Cartesian3;function Ke(t,n){return n=n||new C.Ellipsoid,C.Ellipsoid.fromCartesian3(C.Cartesian3.fromArray(t,void 0,qE),n)}function KE(t,n){return n=n||[0,0,0],n[0]=t.radii.x,n[1]=t.radii.y,n[2]=t.radii.z,n}function ui(t){if(t.type==="GeographicTilingScheme")return new C.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),rectangle:t.rectangle&&mt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new C.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new bb({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new Cb({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function Rs(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:s,edgeWidth:a}=t;let l=o&&C.Matrix4.fromArray(o);return n&&(l=l||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4),C.Matrix4.multiply(n,l,l)),new C.ClippingPlaneCollection({planes:e&&e.map(u=>new C.ClippingPlane(Yn(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:s&&Ie(s),edgeWidth:a})}function Kc(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new C.ClippingPlane(Yn(r.normal),r.distance));let o=i.modelMatrix&&C.Matrix4.fromArray(i.modelMatrix)||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4);e&&C.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Ie(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function Zc(t){const{polygons:n,enabled:e,inverse:i}=t;return new C.ClippingPolygonCollection({polygons:n&&n.map(o=>new C.ClippingPolygon({positions:o.positions.map(r=>ft(r))})),enabled:e,inverse:i})}function Xc(t,n){return Mf(t,C.Cartesian3.UNIT_Y,C.Cartesian3.UNIT_Z,C.Cartesian3.UNIT_X,n)}function e0(t,n){return Mf(t,C.Cartesian3.UNIT_X,C.Cartesian3.UNIT_Z,new C.Cartesian3(0,-1,0),n)}function Mf(t,n,e,i,o){const[r,s,a]=t,l=C.Quaternion.fromAxisAngle(e,C.Math.toRadians(-r)),u=C.Quaternion.fromAxisAngle(i,C.Math.toRadians(s)),h=C.Quaternion.fromAxisAngle(n,C.Math.toRadians(a)),c=C.Quaternion.clone(C.Quaternion.IDENTITY,o);return C.Quaternion.multiply(h,c,c),C.Quaternion.multiply(u,c,c),C.Quaternion.multiply(l,c,c),c}function hr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function t0(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function at(t,n){if(!((!t.localScale||hr(t.localScale,3))&&(!t.localRotation||hr(t.localRotation,3))&&(!t.localPosition||hr(t.localPosition,3))&&(!t.localModelMatrix||hr(t.localModelMatrix,16))&&(!t.scale||hr(t.scale,3))&&(!t.rotation||hr(t.rotation,3))&&(!t.position||hr(t.position,3))&&(!t.modelMatrix||hr(t.modelMatrix,16)))||t.localScale&&!t0(t.localScale)||t.scale&&!t0(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 i=n??C.Matrix4.clone(C.Matrix4.IDENTITY);if(t.localScale){const[o,r,s]=t.localScale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=C.Quaternion.fromAxisAngle(C.Cartesian3.UNIT_Z,C.Math.toRadians(90)),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=Xc(t.localRotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=C.Matrix4.fromTranslation(C.Cartesian3.fromArray(t.localPosition));C.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=C.Matrix4.fromArray(t.localModelMatrix);C.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,o,o),new C.Matrix4);C.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,s]=t.scale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if(t.rotation){const o=Xc(t.rotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=C.Cartesian3.fromDegrees(...t.position),r=C.Transforms.eastNorthUpToFixedFrame(o);C.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=C.Matrix4.fromArray(t.modelMatrix);C.Matrix4.multiply(o,i,i)}return i}const ZE=new C.Cartesian3,Us=new C.HeadingPitchRoll,XE=new C.Matrix4,$E=new C.Cartesian3,YE=new C.Cartographic;function JE(t,n=[0,0,0],e=0,i){const[o,r,s]=t,a=C.Cartesian3.fromDegrees(o,r,s,void 0,ZE),l=[...n];for(let h=0;h<3;++h)l[h]=C.Math.RADIANS_PER_DEGREE*l[h];if(e!==0){Us.heading=l[0],Us.pitch=l[1],Us.roll=l[2],Us.heading-=C.Math.PI_OVER_TWO;const h=C.Transforms.headingPitchRollToFixedFrame(a,Us,void 0,void 0,XE),c=C.Matrix4.multiplyByPointAsVector(h,C.Cartesian3.UNIT_X,$E);C.Cartesian3.multiplyByScalar(c,e,c),C.Cartesian3.subtract(a,c,a)}const u=C.Cartographic.fromCartesian(a,void 0,YE);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function n0(t,n,e,i){return JE(t,n,e,i)}const Ar=C.Math.toDegrees;function Sn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=Ar(e),n[1]=Ar(i),n[2]=o,n):[Ar(e),Ar(i),o]}function aa(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=Ar(e),n[1]=Ar(i),n[2]=Ar(o),n):[e,i,o].map(Ar)}class $c extends d.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new C.Matrix4);L(this,"_originProjMatrix",new C.Matrix4);L(this,"_changed",new d.Event);this._scene=e;const i=this._scene.camera;C.Matrix4.clone(i.viewMatrix,this._originViewMatrix),C.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){C.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(C.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),C.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(C.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class jE extends d.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class e2 extends d.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new d.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new jE(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class oo extends d.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(d.react(1)));L(this,"_viewDistance",this.disposeVar(d.react(0)));L(this,"_debug",this.disposeVar(d.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new e2(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:s,czmViewer:a}=this,[l,u,h]=d.getReactFuncs(i),[c,A,p]=d.getReactFuncs(s),[f,g,v]=r?d.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let b=1,E=Number.NEGATIVE_INFINITY;const T=l(),P=c(),k=f?f():0,D=a.getCurrentCameraInfo();if(!T||!P||!D){this._viewDistance.value=E,this._visibleAlpha.value=b;return}E=V.cartesianDistance(D.position,P)-(k??0);const[B,S,I,w]=T;B>S||S>I||I>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=I?b=1:E<=B||E>=w?b=0:E>B&&E<S?S-B<=0?b=0:b=(E-B)/(S-B):E>I&&E<w?(w<=I&&(b=0),b=(w-E)/(w-I)):(b=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=b};y();const m=[a.cameraChanged,h,p];v&&m.push(v);const _=this.disposeVar(d.createNextAnimateFrameEvent(...m));this.dispose(_.disposableOn(y))}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 t2=new C.BoundingSphere(C.Cartesian3.ZERO,0);function Oi(t,n,e){var i=t2;C.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function qt(t){const n=t.length;let e;const i=[];for(let o=0;o<n;++o){const[r,s,a]=t[o],l=C.Cartesian3.fromDegrees(r,s,a);if(!l)continue;const{x:u,y:h,z:c}=l;[u,h,c].every(Number.isFinite)&&(!e||!C.Cartesian3.equals(e,l))&&(e=l,i.push(e))}return i}function ao(t,n,e,i){const o=V.geoRhumbDistance(t,e),r=V.geoRhumbHeading(t,e),s=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return s>0?V.geoRhumbDestination(t,o,n,i):V.geoRhumbDestination(t,o,n+180,i),[s>0?o:-o,i]}function n2(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const s=V.geoRhumbDestination(t,i*r,n);s&&o.push(s)}return o}function i2(t,n){return V.geoNearestPointOnLine(t,n).geometry.coordinates}const i0=new C.Cartesian3,r2=new C.Ray,o2=new C.Plane(C.Cartesian3.UNIT_X,0);function Yc(t,n,e,i){const o=C.Cartesian3.normalize(n,i0),r=C.Cartesian3.cross(t.camera.right,o,i0);C.Cartesian3.normalize(r,r);const s=C.Plane.fromPointNormal(n,r,o2),a=t.camera.getPickRay(e,r2);if(a)return C.IntersectionTests.rayPlane(a,s,i)}const Df=new C.Cartesian3,a2=new C.Ray,s2=new C.Cartographic,l2=new C.Ellipsoid;function sa(t,n,e,i){const o=t.camera.getPickRay(n,a2);if(!o)return;const r=C.Cartesian3.fromElements(e,e,e,Df),s=C.Cartesian3.add(r,C.Ellipsoid.WGS84.radii,Df),a=C.Ellipsoid.fromCartesian3(s,l2),l=C.IntersectionTests.rayEllipsoid(o,a);if(l){const u=l.start>0?l.start:l.stop;if(u){const h=C.Ray.getPoint(o,u,Df),c=C.Cartographic.fromCartesian(h,void 0,s2);return i=i||new C.Cartographic,i.longitude=c.longitude,i.latitude=c.latitude,i.height=e,i}else return}else return}function la(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function r0(t){const n=C.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const o0=new C.Cartographic,a0=new C.Cartesian3,An=[0,0,0],fr=[0,0,0],Rf=new C.Cartesian2,Uf=new C.Cartesian3;function Of(t,n,e,i,o,r){o.constraintMode="none",la([0,0,0],o.startDragPos),r=r||{},Jn(d.getDomEventCurrentTargetPos(t),Rf);const s=e.position;if(!ft(s,Uf))return;const a=Oi(n,Uf,i);if(a===void 0||!Yc(n,Uf,Rf,a0)||!Ue(a0,An))return;const l=r0(An[2])*V.geoDistance(s,An);if(!r.z&&l<a&&Math.abs(s[2]-An[2])<e.dimensions[0]&&An[2]>s[2])return o.constraintMode="z",la(An,o.startDragPos),!0;if(!sa(n,Rf,s[2],o0)||!oa(o0,An))return;const u=r0(s[2])*V.geoDistance(s,An),h=e.dimensions[0];if(!(u>1.05*h)){if(!r.zAxis&&u>.95*h&&u<=1.05*h){o.constraintMode="zAxis",la(An,o.startDragPos);return}{const[c,A]=ao(s,e.heading+90,An,fr);if(!r.x&&c>0&&A&&(fr[2]=s[2],V.geoDistance(fr,An)<a)){o.constraintMode="x",la(fr,o.startDragPos);return}}{const[c,A]=ao(s,e.heading,An,fr);if(!r.y&&c>0&&A&&(fr[2]=s[2],V.geoDistance(fr,An)<a)){o.constraintMode="y",la(fr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",la(An,o.startDragPos))}}async function s0(t,n,e,i){var a;const o=(a=t.viewer)==null?void 0:a.scene;if(!o)throw new Error("!scene");const r=d.getDomEventCurrentTargetPos(n),s=Jn(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=sa(o,s,e);return l?oa(l):void 0}}let Lf,zf;function l0(t,n,e,i,o){o=o||new C.Cartesian3,Lf=Lf||new C.Ray,zf=zf||new C.Plane(C.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,Lf),s=C.Plane.fromPointNormal(n,e,zf);return o=C.IntersectionTests.rayPlane(r,s,o),o}function u0(t){const n=C.Material.fromType(t.type);return Qf(n,t),n}function En(t){return t&&V.ESSceneObject.context.getStrFromEnv(t)||C.Material.DefaultImageId}function u2(t){return{x:t[0],y:t[1]}}function Qf(t,n){n.type==="Color"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.gapColor=Ie(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.outlineColor=Ie(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.color=Ie(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=En(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Ie(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Xe(n.lineCount??[8,8]),t.uniforms.lineThickness=Xe(n.lineThickness??[1,1]),t.uniforms.lineOffset=Xe(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Ie(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Ie(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Ie(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Ie(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Ie(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Ie(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Ie(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Ie(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=En(n.specularMap),t.uniforms.normalMap=En(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Ie(n.color??[1,0,0,.7]),t.uniforms.rimColor=Ie(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Ie(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Ie(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=u2(n.fadeDirection??[!0,!0]),t.uniforms.time=Xe(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Ie(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=En(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=En(n.image):n.type==="ElevationBand"?(t.uniforms.color=En(n.colors),t.uniforms.heights=En(n.heights)):console.warn(`未知材质类型,无法更新 ${n.type}`)}function jn(t,n){const e=d.react(void 0);let i="";const[o,r,s]=d.getReactFuncs(t),a=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=u0(l)):e.value&&Qf(e.value,l):(i="",e.value=void 0)}catch{}};return a(),e.dispose(s.disposableOn(a)),e}function Li(t){const n=qt(t.positions),e=t.holes&&t.holes.map(i=>Li(i));return{positions:n,holes:e}}function Vf(t,n){const e=Math.PI/180,i=1/e,o=new C.Cartographic(t[0]*e,t[1]*e,t[2]),r=new C.Cartographic(n[0]*e,n[1]*e,n[2]),s=new C.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new C.Cartographic);if(s)return s.height=(o.height+r.height)*.5,[s.longitude*i,s.latitude*i,s.height]}const c0=new C.Cartesian4,c2=new C.Matrix4;function h2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function h0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function A0(t,n,e){if(t.scene.mode!==C.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,s=t.camera.frustum.projectionMatrix,a=C.Matrix4.multiply(s,r,c2),l=C.Matrix4.multiplyByVector(a,C.Cartesian4.fromElements(n.x,n.y,n.z,1,c0),c0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),h=i*(l.y*.5+.5),c=o-u,A=i-h,p=l.z;if(!(u<0||h<0||c<0||A<0||p<0||p>1))return e?(e.left=u,e.top=A,e.right=c,e.bottom=h,e.depth=p):e={left:u,top:A,right:c,bottom:h,depth:p},e}const so={left:0,top:0,right:0,bottom:0,depth:0};class Jc extends d.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new C.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new d.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new $c(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}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 i=A0(this._viewer,this._cartesian,so);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?h0(this._winPos,so)||(e=!0,this._winPos.left=so.left,this._winPos.top=so.top,this._winPos.right=so.right,this._winPos.bottom=so.bottom,this._winPos.depth=so.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){C.Cartesian3.equals(this._cartesian,e)||(C.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function f0(t){const n=C.Math.toRadians(t[0]),e=C.Math.toRadians(t[1]),i=C.Math.toRadians(t[2]),o=C.Matrix3.fromHeadingPitchRoll(new C.HeadingPitchRoll(n,e,i)),r=new C.Cartesian3;return C.Matrix3.multiplyByVector(o,C.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const A2=C.Check,f2=C.defaultValue,lo=C.defined,d0=C.Math.EPSILON10;function d2(t,n,e,i){if(A2.defined("equalsEpsilon",n),!lo(t))return;e=f2(e,!1);const o=lo(i),r=t.length;if(r<2)return t;let s,a=t[0],l,u,h=0,c=-1;for(s=1;s<r;++s)l=t[s],n(a,l,d0)?(lo(u)||(u=t.slice(0,s),h=s-1,c=0),o&&i.push(s)):(lo(u)&&(u.push(l),h=s,o&&(c=i.length)),a=l);return e&&n(t[0],t[r-1],d0)&&(o&&(lo(u)?i.splice(c,0,h):i.push(r-1)),lo(u)?u.length-=1:u=t.slice(0,-1)),lo(u)?u:t}const He=C.Cartesian3,ua=C.Cartographic,uo=C.defaultValue,co=C.defined,p0=C.DeveloperError,m0=C.Ellipsoid,p2=C.EllipsoidGeodesic,g0=C.EllipsoidRhumbLine,m2=C.IntersectionTests,Nf=C.Math,ca=C.Matrix4,ho=C.Plane,Ft={};Ft.numberOfPoints=function(t,n,e){const i=He.distance(t,n);return Math.ceil(i/e)},Ft.numberOfPointsRhumbLine=function(t,n,e){const i=Math.pow(t.longitude-n.longitude,2)+Math.pow(t.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(e*e))))};const g2=new ua;Ft.extractHeights=function(t,n){const e=t.length,i=new Array(e);for(let o=0;o<e;o++){const r=t[o];i[o]=n.cartesianToCartographic(r,g2).height}return i};const y2=new ca,v2=new He,y0=new He,w2=new ho(He.UNIT_X,0),v0=new He,_2=new ho(He.UNIT_X,0),b2=new He,C2=new He,Hf=[];function w0(t,n,e){const i=Hf;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const s=(e-n)/t;for(o=0;o<t;o++){const a=n+o*s;i[o]=a}return i}const jc=new ua,eh=new ua,dr=new He,Gf=new He,x2=new He,Wf=new p2;let Os=new g0;function S2(t,n,e,i,o,r,s,a){const l=i.scaleToGeodeticSurface(t,Gf),u=i.scaleToGeodeticSurface(n,x2),h=Ft.numberOfPoints(t,n,e),c=i.cartesianToCartographic(l,jc),A=i.cartesianToCartographic(u,eh),p=w0(h,o,r);Wf.setEndPoints(c,A);const f=Wf.surfaceDistance/h;let g=a;c.height=o;let v=i.cartographicToCartesian(c,dr);He.pack(v,s,g),g+=3;for(let y=1;y<h;y++){const m=Wf.interpolateUsingSurfaceDistance(y*f,eh);m.height=p[y],v=i.cartographicToCartesian(m,dr),He.pack(v,s,g),g+=3}return g}function E2(t,n,e,i,o,r,s,a){const l=i.cartesianToCartographic(t,jc),u=i.cartesianToCartographic(n,eh),h=Ft.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const c=w0(h,o,r);Os.ellipsoid.equals(i)||(Os=new g0(void 0,void 0,i)),Os.setEndPoints(l,u);const A=Os.surfaceDistance/h;let p=a;l.height=o;let f=i.cartographicToCartesian(l,dr);He.pack(f,s,p),p+=3;for(let g=1;g<h;g++){const v=Os.interpolateUsingSurfaceDistance(g*A,eh);v.height=c[g],f=i.cartographicToCartesian(v,dr),He.pack(f,s,p),p+=3}return p}Ft.wrapLongitude=function(t,n){const e=[],i=[];if(co(t)&&t.length>0){n=uo(n,ca.IDENTITY);const o=ca.inverseTransformation(n,y2),r=ca.multiplyByPoint(o,He.ZERO,v2),s=He.normalize(ca.multiplyByPointAsVector(o,He.UNIT_Y,y0),y0),a=ho.fromPointNormal(r,s,w2),l=He.normalize(ca.multiplyByPointAsVector(o,He.UNIT_X,v0),v0),u=ho.fromPointNormal(r,l,_2);let h=1;e.push(He.clone(t[0]));let c=e[0];const A=t.length;for(let p=1;p<A;++p){const f=t[p];if(ho.getPointDistance(u,c)<0||ho.getPointDistance(u,f)<0){const g=m2.lineSegmentPlane(c,f,a,b2);if(co(g)){const v=He.multiplyByScalar(s,5e-9,C2);ho.getPointDistance(a,c)<0&&He.negate(v,v),e.push(He.add(g,v,new He)),i.push(h+1),He.negate(v,v),e.push(He.add(g,v,new He)),h=1}}e.push(He.clone(t[p])),h++,c=f}i.push(h)}return{positions:e,lengths:i}},Ft.generateArc=function(t){co(t)||(t={});const n=t.positions;if(!co(n))throw new p0("options.positions is required.");const e=n.length,i=uo(t.ellipsoid,m0.WGS84);let o=uo(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const g=i.scaleToGeodeticSurface(n[0],Gf);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(g,dr);He.multiplyByScalar(v,o,v),He.add(g,v,g)}return[g.x,g.y,g.z]}let s=t.minDistance;if(!co(s)){const g=uo(t.granularity,Nf.RADIANS_PER_DEGREE);s=Nf.chordLength(g,i.maximumRadius)}let a=0,l;for(l=0;l<e-1;l++)a+=Ft.numberOfPoints(n[l],n[l+1],s);const u=(a+1)*3,h=new Array(u);let c=0;for(l=0;l<e-1;l++){const g=n[l],v=n[l+1],y=r?o[l]:o,m=r?o[l+1]:o;c=S2(g,v,s,i,y,m,h,c)}Hf.length=0;const A=n[e-1],p=i.cartesianToCartographic(A,jc);p.height=r?o[e-1]:o;const f=i.cartographicToCartesian(p,dr);return He.pack(f,h,u-3),h};const _0=new ua,P2=new ua;Ft.generateRhumbArc=function(t){co(t)||(t={});const n=t.positions;if(!co(n))throw new p0("options.positions is required.");const e=n.length,i=uo(t.ellipsoid,m0.WGS84);let o=uo(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],Gf);if(o=r?o[0]:o,o!==0){const m=i.geodeticSurfaceNormal(y,dr);He.multiplyByScalar(m,o,m),He.add(y,m,y)}return[y.x,y.y,y.z]}const s=uo(t.granularity,Nf.RADIANS_PER_DEGREE);let a=0,l,u=i.cartesianToCartographic(n[0],_0),h;for(l=0;l<e-1;l++)h=i.cartesianToCartographic(n[l+1],P2),a+=Ft.numberOfPointsRhumbLine(u,h,s),u=ua.clone(h,_0);const c=(a+1)*3,A=new Array(c);let p=0;for(l=0;l<e-1;l++){const y=n[l],m=n[l+1],_=r?o[l]:o,b=r?o[l+1]:o;p=E2(y,m,s,i,_,b,A,p)}Hf.length=0;const f=n[e-1],g=i.cartesianToCartographic(f,jc);g.height=r?o[e-1]:o;const v=i.cartographicToCartesian(g,dr);return He.pack(v,A,c-3),A},Ft.generateCartesianArc=function(t){const n=Ft.generateArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=He.unpack(n,o*3);return i},Ft.generateCartesianRhumbArc=function(t){const n=Ft.generateRhumbArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=He.unpack(n,o*3);return i};const th=C.ArcType,T2=C.Cartesian3,I2=C.Math;function b0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=d2(t.positions,T2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===th.GEODESIC||n===th.RHUMB){let a;n===th.GEODESIC?(a=I2.chordLength(e,i.maximumRadius),Ft.numberOfPoints):(a=e,Ft.numberOfPointsRhumbLine);const l=Ft.extractHeights(r,i);n===th.GEODESIC?r=Ft.generateCartesianArc({positions:r,minDistance:a,ellipsoid:i,height:l}):r=Ft.generateCartesianRhumbArc({positions:r,granularity:a,ellipsoid:i,height:l})}return r}}function qf(t,n="GEODESIC",e){const o=t.map(V.lbhToXyz).map(c=>C.Cartesian3.fromArray(c));let r;if(e>0&&n!=="NONE"){if(r=b0({arcType:C.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:C.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let s=0;const a=[0],l=r.length;for(let c=1;c<l;++c)s+=C.Cartesian3.distance(r[c-1],r[c]),a.push(s);const u=r.map(c=>V.xyzToLbh([c.x,c.y,c.z]));return{timePosRots:a.map((c,A)=>[a[A],u[A],void 0]),distances:a}}function C0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function Kf(t,n){const e=C.Matrix4.clone(C.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:s="YForwardZUp"}=t;if(i){const[a,l,u]=i;C.Transforms.eastNorthUpToFixedFrame(C.Cartesian3.fromDegrees(a,l,u),void 0,e)}if(o){const a=new C.Quaternion;s==="YForwardZUp"?Xc(o,a):s==="XForwardZUp"&&e0(o,a);const l=C.Matrix3.fromQuaternion(a);C.Matrix4.multiply(e,C.Matrix4.fromRotationTranslation(l),e)}return r&&C.Matrix4.multiplyByScale(e,Jn(r),e),C0(e,n)}const k2=new C.Matrix4;function x0(t,n){const e=C.Matrix4.fromArray(t,0,k2);return C.Matrix4.inverse(e,e),C0(e,n)}const F2=new C.Matrix4,B2=new C.Cartesian3;function S0(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromDegrees(i,o,r,void 0,B2),a=C.Matrix4.fromArray(t,0,F2),l=C.Matrix4.multiplyByPoint(a,s,s),{x:u,y:h,z:c}=l;return e=e||[0,0,0],e[0]=u,e[1]=h,e[2]=c,e}const M2=new C.Matrix4,D2=new C.Cartesian3,R2=new C.Cartographic;function pr(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromElements(i,o,r,D2),a=C.Matrix4.fromArray(t,0,M2),l=C.Matrix4.multiplyByPoint(a,s,s),u=C.Cartographic.fromCartesian(l,void 0,R2);return e=e||[0,0,0],e[0]=C.Math.toDegrees(u.longitude),e[1]=C.Math.toDegrees(u.latitude),e[2]=u.height,e}function fn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=Kf({position:e,rotation:i,scale:o,initialRotationMode:r}),a=x0(s);return[n.map(u=>S0(a,u)),s,a]}function mr(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=Kf({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>pr(s,l)),s]}function E0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=it.Cartesian3.fromDegrees(...t[e]),o=it.Cartesian3.fromDegrees(...t[e+1]),r=it.Cartesian3.fromDegrees(...t[e+2]),s=it.Cartesian3.angleBetween(it.Cartesian3.subtract(i,o,new it.Cartesian3),it.Cartesian3.subtract(r,o,new it.Cartesian3));n.push(isNaN(s)?0:it.Math.toDegrees(s))}return n}function Zf(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>Ue(i)))),t.holes&&t.holes.forEach(i=>{e=Zf(i,e)}),e}function Pn(t){return typeof t=="string"?V.ESSceneObject.context.getStrFromEnv(t):new C.Resource({url:V.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 Xf extends d.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[s,a,l]=d.getReactFuncs(e),[u,h,c]=d.getReactFuncs(i),A=new C.Cartesian3,p=()=>{let f=s();f&&(f=[...f],n.editingHeightOffset&&(f[2]-=n.editingHeightOffset),C.Cartesian3.fromDegrees(...f,void 0,A))};p(),this.dispose(l.disposableOn(p)),this.dispose(r.preUpdate.addEventListener(()=>{if(C.Cartesian3.ZERO.equals(A))return;const f=Oi(r,A,o);f!==void 0?h([f,f,f]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${f??"undefined"}`)}))}}function U2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:C.Matrix4.toArray(C.Matrix4.IDENTITY);let e,i,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new C.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const A=t.root.boundingVolume.sphere[3];r=C.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray([A,0,0]),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,A,0]),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,0,A]),new C.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let s,a,l,u,h,c;return C.Matrix4.IDENTITY.equals(C.Matrix4.fromArray(n))?(s=Ue(e),u=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,e,new C.Cartesian3),new C.Cartesian3)),a=Ue(i),h=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,i,new C.Cartesian3),new C.Cartesian3)),l=Ue(o),c=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,o,new C.Cartesian3),new C.Cartesian3))):(s=pr(n,[e.x,e.y,e.z]),u=pr(n,[-e.x,-e.y,-e.z]),a=pr(n,[i.x,i.y,i.z]),h=pr(n,[-i.x,-i.y,-i.z]),l=pr(n,[o.x,o.y,o.z]),c=pr(n,[-o.x,-o.y,-o.z])),!s||!u||!a||!h||!l||!c?"无法生成包围盒,请检查包围盒是否正确":[C.Math.toRadians(Math.min(s[0],u[0],a[0],h[0],l[0],c[0])),C.Math.toRadians(Math.min(s[1],u[1],a[1],h[1],l[1],c[1])),C.Math.toRadians(Math.max(s[0],u[0],a[0],h[0],l[0],c[0])),C.Math.toRadians(Math.max(s[1],u[1],a[1],h[1],l[1],c[1])),Math.min(s[2],u[2],a[2],h[2],l[2],c[2]),Math.max(s[2],u[2],a[2],h[2],l[2],c[2])]}const P0=d.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await d.step(t,async l=>new Promise(async(u,h)=>{for(let c=0;c<n.length;c++){const A=n[c];await fetch(A).then(p=>p.json()).then(p=>{p&&!Reflect.has(p,"success")?i[A]=p:o.push({index:c,url:A,message:p.message}),c==n.length-1&&u()}).catch(p=>{o.push({index:c,url:A,message:p}),c==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],s=[],a=[];for(const l in i){const u=i[l];s.push(u.geometricError??u.root.geometricError??0);const h=U2(u);r.push(h),a.push({content:{uri:l},boundingVolume:{region:h},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...s),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=a),e});function O2(t){return new Promise((n,e)=>{P0.restart(void 0,t),P0.completeEvent.don(i=>{n(i)})})}class $f extends d.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(d.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(d.react(0)));const[i,o,r]=d.getReactFuncs(e);{const s=()=>{const a=i();if(a){const{center:l,minPos:u,maxPos:h}=V.getMinMaxCorner(a);this._center.value=l,this._radius.value=V.geoDistance(u,h)/2}else this._center.value=void 0};s(),this.dispose(r.disposableOn(s))}}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 T0(t){return new C.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new C.Color(.2,.3,.6,1),blendColor:new C.Color(0,1,.699,1),specularMap:C.Material.DefaultImageId,normalMap:C.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;
|
|
@@ -132,7 +132,7 @@ void main()
|
|
|
132
132
|
vec4 imageColor = texture(u_image, v_st);
|
|
133
133
|
out_FragColor = imageColor;
|
|
134
134
|
}
|
|
135
|
-
`,uniformMap:{u_image:{type:"texture",id:"059734c9-7bba-489a-854d-9ce3bfedd86a"}},name:"自定义屏幕图元_clone",attributes:{position:{typedArray:{type:"Float32Array",array:[-.5,.5,0,-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,-.5,0,.5,.5,0]},componentsPerAttribute:3},textureCoordinates:{typedArray:{type:"Float32Array",array:[0,1,0,0,1,0,0,1,1,0,1,1]},componentsPerAttribute:2}}};class _P extends d.Destroyable{constructor(e,i){super();L(this,"_nativeTextureResetting");this._czmViewer=e,this._comlexImage=i,this._nativeTextureResetting=this.disposeVar(new d.ObjResettingWithEvent(this.comlexImage.createNativeTextureEvent,()=>{if(!this.comlexImage.enabled||!this.comlexImage.size)return;const{flipY:o,size:r}=this.comlexImage,[s,a]=r;return new C.Texture({context:this.czmViewer.scene.context,pixelFormat:C.PixelFormat[this.pixelFormat],width:s,height:a,flipY:o})})),this.ad(this.nativeTextureChanged.don(()=>{this.dispose(this.comlexImage.copyTextureEvent.disposableOn(o=>{this.copyTexture(o)}))}))}get czmViewer(){return this._czmViewer}get comlexImage(){return this._comlexImage}get nativeTextureResetting(){return this._nativeTextureResetting}get nativeTextureChanged(){return this._nativeTextureResetting.objChanged}get nativeTexture(){return this._nativeTextureResetting.obj}copyTexture(e){if(!this.nativeTexture)throw new Error("copyTexture error: !this.nativeTexture");this.nativeTexture.copyFrom(e)}}function cd(t,n,e){var i;return C.defined(n.internalFormat)?i=new C.Texture({context:t,pixelFormat:n.internalFormat,width:n.width,height:n.height,flipY:(e==null?void 0:e.flipY)??!0,source:{arrayBufferView:n.bufferView}}):(i=new C.Texture({context:t,source:n,flipY:(e==null?void 0:e.flipY)??!0,sampler:new C.Sampler({wrapS:C.TextureWrap[(e==null?void 0:e.wrapS)??"REPEAT"],wrapT:C.TextureWrap[(e==null?void 0:e.wrapT)??"REPEAT"],minificationFilter:C.TextureMinificationFilter[(e==null?void 0:e.minificationFilter)??"LINEAR"],magnificationFilter:C.TextureMinificationFilter[(e==null?void 0:e.magnificationFilter)??"LINEAR"]})}),bP(i.sampler)&&i.generateMipmap()),i}function bP(t){return[C.TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,C.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,C.TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,C.TextureMinificationFilter.LINEAR_MIPMAP_LINEAR].includes(t.minificationFilter)}class ha extends d.Destroyable{constructor(e){super();L(this,"_resouceRef");e&&(this._resouceRef={resouce:e,ref:1}),this.dispose(()=>this.reset())}get valid(){return!!this._resouceRef}get raw(){var e;return(e=this._resouceRef)==null?void 0:e.resouce}get ref(){var e;return(e=this._resouceRef)==null?void 0:e.ref}getRef(e){return e=e??new ha,e.reset(this),e}equal(e){return e._resouceRef===this._resouceRef}reset(e){if(this._resouceRef){if(this._resouceRef.ref<=0)throw new Error("ref <= 0!");--this._resouceRef.ref,this._resouceRef.ref===0&&this._resouceRef.resouce.destroy(),this._resouceRef=void 0}if(e){if(!e._resouceRef)throw new Error("handler._resouceRef is undefined!");e._resouceRef.ref+=1,this._resouceRef=e._resouceRef}return this}}class H0{constructor(n){L(this,"_map");L(this,"_loadingMap");this._context=n,this._map=new Map,this._loadingMap=new Map}getTextureHandler(n){if(this._map.has(n)){const i=this._map.get(n);if(i&&i.valid)return i;this._map.delete(n)}let e;return this._loadingMap.has(n)?e=this._loadingMap.get(n):(e=new Promise((i,o)=>{C.Resource.createIfNeeded(n).fetchImage().then(r=>{const s=cd(this._context,r),a=new ha(s);this._map.set(n,a),this._loadingMap.delete(n),i(a)}).catch(()=>{console.error("loading image error!"),this._loadingMap.delete(n),o()})}),this._loadingMap.set(n,e)),e}clearUnused(){const n=[];for(let[e,i]of this._map)i.ref===1&&n.push(e);for(let e of n)this._map.get(e).reset(),this._map.delete(e)}}const hd=new Map;function G0(t){return hd.has(t)||hd.set(t,new H0(t)),hd.get(t)}const Ss=class Ss extends d.Destroyable{constructor(e,i){super();L(this,"_complexImage",this.disposeVar(new d.ComplexImage));L(this,"_copyFromClipboardProcessing",this.disposeVar(d.createProcessingFromAsyncFunc(async e=>{const i=await e.promise(navigator.clipboard.read());if(i.length===0){console.warn("剪切板中没有内容,无法粘贴!");return}const o=i[0],r=o.types.findIndex(u=>u.startsWith("image"));if(r===-1){console.warn("剪切板中没有图像!");return}const s=await e.promise(o.getType(o.types[r])),a=window.URL.createObjectURL(new Blob([s]));e.disposer.dispose(()=>window.URL.revokeObjectURL(a));const l=await e.promise(new Promise((u,h)=>{const c=new Image;c.src=a,c.onload=()=>u(c),c.onerror=()=>h("无法加载图片!"),c.onabort=()=>h("加载图片被中断!")}));this.copyFromImage(l)})));L(this,"_readyEvent",this.disposeVar(new d.Event));L(this,"_czmNativeTexture");L(this,"_id",this.disposeVar(d.react(d.createGuid())));if(this._czmViewer=e,i&&(this.id=i),this._czmNativeTexture=this.disposeVar(new _P(this.czmViewer.viewer,this.complexImage)),this.disposeVar(new d.ObjResettingWithEvent(this.showPreviewChanged,()=>{if(this.showPreview)return new CP(this)})),!this._czmViewer.viewer)return;this.readyEvent.emit(e),this.dispose(d.track([this._complexImage,"enabled"],[this,"enabled"])),this.dispose(d.bind([this._complexImage,"size"],[this,"size"])),this.dispose(d.bind([this._complexImage,"pixelFormat"],[this,"pixelFormat"])),this.dispose(d.bind([this._complexImage,"flipY"],[this,"flipY"]));const r=this.disposeVar(V.ESSceneObject.context.createEnvStrReact([this,"uri"],""));this.dispose(d.bind([this._complexImage,"uri"],r)),this.dispose(d.bind([this._complexImage,"type"],[this,"uriType"])),this.dispose(d.bind([this._complexImage,"crossOrigin"],[this,"crossOrigin"],s=>s==="null"?null:s)),this.dispose(d.bind([this._complexImage,"autoplay"],[this,"autoplay"])),this.dispose(d.bind([this._complexImage,"loop"],[this,"loop"])),window.czmTexture||(window.czmTexture={}),window.czmTexture[this.id]=this,this.ad(()=>{Reflect.has(window.czmTexture,this.id)&&Reflect.deleteProperty(window.czmTexture,this.id)})}get complexImage(){return this._complexImage}copyTexture(e){this._complexImage.copyTexture(e)}copyFromImage(e){if(e.naturalWidth<=0||e.naturalHeight<=0){console.warn("copyFromImage error: image.naturalWidth <= 0 || image.naturalHeight <= 0");return}this.size=[e.naturalWidth,e.naturalHeight],this.copyTexture({source:e})}copyFromCanvas(e){this._complexImage.copyFromCanvas(e)}copyFromClipboard(){this._copyFromClipboardProcessing.restart()}reset(){this.uri="",this.size=void 0,this.uriType=void 0,this.flipY=!0,this.pixelFormat="RGBA"}get readyEvent(){return this._readyEvent}get czmNativeTexture(){return this._czmNativeTexture}getDefaultTexture(){if(!this._czmViewer.viewer)throw new Error("!this.czmViewer.viewer");return this._czmViewer.viewer.scene.context.defaultTexture}get texture(){return this.czmNativeTexture.nativeTexture??this.getDefaultTexture()}get czmViewer(){return this._czmViewer}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};L(Ss,"types",d.ComplexImage.types),L(Ss,"suffixTypes",d.ComplexImage.suffixTypes),L(Ss,"defaults",{size:[256,256],uriType:"img",czmPixelFormats:d.czmPixelFormats,uriTypes:Ss.types});let ht=Ss;(t=>{t.createDefaultProps=()=>({enabled:!0,showPreview:!1,size:d.reactArrayWithUndefined(void 0),pixelFormat:"RGBA",flipY:!0,uri:void 0,uriType:void 0,crossOrigin:"",autoplay:!0,loop:!0,...V.ESSceneObject.createDefaultProps()})})(ht||(ht={})),d.extendClassProps(ht.prototype,ht.createDefaultProps);class CP extends d.HasOwner{constructor(e){super(e);L(this,"_builtin",(()=>{const e=this.disposeVar(V.ESSceneObject.createFromJson(wP));e.uniformMap={u_image:{type:"texture",id:this.owner.id}},this.dispose(this.owner.czmViewer.disposableAdd(e))})())}}const Es=class Es extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_updateObjectsToExcludeWrapper",this.ad(new d.Event));const o=e.viewer;if(!o)return;const r=new C.PointPrimitiveCollection;let s;{const a=()=>{r&&(s&&r.remove(s),o.scene.primitives.remove(r),s=void 0)};this.ad(a),a(),s=r.add({}),C.PointPrimitive.prototype&&(s.ESSceneObjectID=i),o.scene.primitives.add(r)}{const a=this.ad(d.createNextAnimateFrameEvent(this.positionChanged,this.showChanged,this.pixelSizeChanged,this.colorChanged,this.outlineColorChanged,this.outlineWidthChanged,this.distanceDisplayConditionChanged,this.scaleByDistanceChanged,this.translucencyByDistanceChanged)),l=()=>{!s||!r||(s.show=(this.show??!0)&&!!this.position,this.position&&(s.position=ft(this.position)),s.pixelSize=this.pixelSize??1,s.color=Ie(this.color??Es.defaults.color),this.distanceDisplayCondition&&(s.distanceDisplayCondition=Ds(this.distanceDisplayCondition)),s.outlineColor=Ie(this.outlineColor??Es.defaults.outlineColor),s.outlineWidth=this.outlineWidth??Es.defaults.outlineWidth,this.scaleByDistance&&(s.scaleByDistance=cr(this.scaleByDistance)),this.translucencyByDistance&&(s.translucencyByDistance=cr(this.translucencyByDistance)))};l(),this.ad(a.don(l))}{const a=this.ad(d.createNextAnimateFrameEvent(this._updateObjectsToExcludeWrapper,this.allowPickingChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{if(!(this.allowPicking||!s))return new tt.ObjectsToExcludeWrapper(e,s)}))}this.ad(this.flyToEvent.don(a=>{if(!this.position){console.warn("没有位置信息,无法飞行");return}const l=o.scene.camera.positionCartographic.height;Be(o,this.position,l,void 0,a)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(Es,"defaults",{pixelSize:1,outlineWidth:1,color:[1,1,1,.5],outlineColor:[1,1,1,1]});let zn=Es;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:!1,position:d.reactArrayWithUndefined(void 0),pixelSize:void 0,color:d.reactArrayWithUndefined(void 0),distanceDisplayCondition:void 0,disableDepthTestDistance:void 0,outlineColor:d.reactArrayWithUndefined(void 0),outlineWidth:void 0,scaleByDistance:d.reactArrayWithUndefined(void 0),translucencyByDistance:d.reactArrayWithUndefined(void 0)})})(zn||(zn={})),d.extendClassProps(zn.prototype,zn.createDefaultProps);class Tn extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_primitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.ad(r);const s=()=>{!this._primitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.primitives.lowerToBottom(this._primitive):this.topOrBottom=="top"&&o.scene.primitives.raiseToTop(this._primitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const c=()=>{this._primitive&&(this._primitive.show=this.show??!0)};c(),this.ad(this.showChanged.don(c));const A=()=>{if(r(),!this.positions){this._boundingSphere=void 0;return}const f=this.positions.map(qt);this._primitive=h(f),this._primitive&&o.scene.primitives.add(this._primitive),s(),c();const g=[],v=f.length;for(let y=0;y<v;y++){const m=f[y].length;for(let _=0;_<m;_++)g.push(f[y][_])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g):void 0};A();const p=this.ad(d.createNextAnimateFrameEvent(this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.positionsChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(p.don(A)),this.ad(this.flyToEvent.don(()=>{e.actived&&(p.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,u=()=>{let c;return this.hasArrow?(c=C.Material.fromType("PolylineArrow"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(c=C.Material.fromType("PolylineDash"),c.uniforms.color=Ie(this.color??[1,1,1,1],a),c.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),c.uniforms.dashLength=this.dashLength??16,c.uniforms.dashPattern=this.dashPattern??255):(c=C.Material.fromType("Color"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)),c},h=c=>{const A=new C.PolylineMaterialAppearance({material:u(),renderState:{depthTest:{enabled:this.depthTest??!1}}});A.renderState.depthMask=!1;const p=[];for(let g=0;g<c.length;++g){const v=c[g];v.length<2||p.push(new C.GeometryInstance({geometry:new C.PolylineGeometry({positions:v,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(p.length===0)return;const f=new C.Primitive({geometryInstances:p,appearance:A,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.Primitive.prototype&&(f.ESSceneObjectID=i),f}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:d.reactPositionsSet(void 0),width:void 0,color:d.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:d.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(Tn||(Tn={})),d.extendClassProps(Tn.prototype,Tn.createDefaultProps);class Aa extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_groundPrimitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._groundPrimitive&&o.scene.groundPrimitives.remove(this._groundPrimitive),this._groundPrimitive=void 0};this.ad(r);const s=()=>{!this._groundPrimitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.groundPrimitives.lowerToBottom(this._groundPrimitive):this.topOrBottom=="top"&&o.scene.groundPrimitives.raiseToTop(this._groundPrimitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const c=()=>{if(r(),!(this.show??!0)||!this.positions)return;const p=this.positions.map(qt);this._groundPrimitive=u(p),this._groundPrimitive&&o.scene.groundPrimitives.add(this._groundPrimitive),s(),this._groundPrimitive&&(this._groundPrimitive.show=this.show??!0);const f=new C.BoundingSphere;if(!p){this._boundingSphere=void 0;return}const g=[],v=p.length;for(let y=0;y<v;++y){const m=p[y].length;for(let _=0;_<m;++_)g.push(p[y][_])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g,f):void 0};c();const A=this.ad(d.createNextAnimateFrameEvent(this.showChanged,this.positionsChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(A.don(c)),this.dispose(this.flyToEvent.disposableOn(()=>{e.actived&&(A.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,u=c=>{const A=[];for(let f=0;f<c.length;++f){const g=c[f];g.length<2||A.push(new C.GeometryInstance({geometry:new C.GroundPolylineGeometry({positions:g,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(A.length===0)return;const p=new C.GroundPolylinePrimitive({geometryInstances:A,appearance:new C.PolylineMaterialAppearance({material:h(),renderState:{depthTest:{enabled:this.depthTest??!1}}}),asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.GroundPolylinePrimitive.prototype&&(p.ESSceneObjectID=i),p},h=()=>{let c;return this.hasArrow?(c=C.Material.fromType("PolylineArrow"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(c=C.Material.fromType("PolylineDash"),c.uniforms.color=Ie(this.color??[1,1,1,1],l),c.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),c.uniforms.dashLength=this.dashLength??16,c.uniforms.dashPattern=this.dashPattern??255):(c=C.Material.fromType("Color"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)),c}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:d.reactPositionsSet(void 0),width:void 0,color:d.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:d.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(Aa||(Aa={})),d.extendClassProps(Aa.prototype,Aa.createDefaultProps);class ei extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));if(!e.viewer)return;const r=this.ad(new Tn(e,i)),s=this.ad(new Aa(e,i));this.dispose(d.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(d.track([s,"allowPicking"],[this,"allowPicking"]));{const a=()=>{const u=this.ground??!1,h=this.show??!0;r.show=h&&!u,s.show=h&&u,r.positions=s.positions=xP(this),r.arcType=s.arcType=this.arcType,r.width=s.width=this.width??1,r.hasDash=s.hasDash=this.hasDash,r.hasArrow=s.hasArrow=this.hasArrow,r.color=s.color=this.color,r.gapColor=s.gapColor=this.gapColor,r.dashLength=s.dashLength=this.dashLength,r.dashPattern=s.dashPattern=this.dashPattern,r.depthTest=s.depthTest=this.depthTest??!1,r.allowPicking=s.allowPicking=this.allowPicking??!1,r.topOrBottom=s.topOrBottom=this.topOrBottom??"none"};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(this.showChanged,this.groundChanged,this.positionsChanged,this.arcTypeChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.depthTestChanged,this.allowPickingChanged,this.topOrBottomChanged));this.dispose(l.disposableOn(()=>{a()})),this.dispose(this.flyToEvent.disposableOn(u=>{this.ground?s.flyTo(u):r.flyTo(u)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:d.reactPositionsSet(void 0),width:1,ground:!1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,topOrBottom:"none",loop:!1})})(ei||(ei={})),d.extendClassProps(ei.prototype,ei.createDefaultProps);function xP(t){if(t.loop&&t.positions&&t.positions.length>0){const e=[];return t.positions.forEach(i=>{e.push([...i,i[0]])}),e}else return t.positions}const SP=`
|
|
135
|
+
`,uniformMap:{u_image:{type:"texture",id:"059734c9-7bba-489a-854d-9ce3bfedd86a"}},name:"自定义屏幕图元_clone",attributes:{position:{typedArray:{type:"Float32Array",array:[-.5,.5,0,-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,-.5,0,.5,.5,0]},componentsPerAttribute:3},textureCoordinates:{typedArray:{type:"Float32Array",array:[0,1,0,0,1,0,0,1,1,0,1,1]},componentsPerAttribute:2}}};class _P extends d.Destroyable{constructor(e,i){super();L(this,"_nativeTextureResetting");this._czmViewer=e,this._comlexImage=i,this._nativeTextureResetting=this.disposeVar(new d.ObjResettingWithEvent(this.comlexImage.createNativeTextureEvent,()=>{if(!this.comlexImage.enabled||!this.comlexImage.size)return;const{flipY:o,size:r}=this.comlexImage,[s,a]=r;return new C.Texture({context:this.czmViewer.scene.context,pixelFormat:C.PixelFormat[this.pixelFormat],width:s,height:a,flipY:o})})),this.ad(this.nativeTextureChanged.don(()=>{this.dispose(this.comlexImage.copyTextureEvent.disposableOn(o=>{this.copyTexture(o)}))}))}get czmViewer(){return this._czmViewer}get comlexImage(){return this._comlexImage}get nativeTextureResetting(){return this._nativeTextureResetting}get nativeTextureChanged(){return this._nativeTextureResetting.objChanged}get nativeTexture(){return this._nativeTextureResetting.obj}copyTexture(e){if(!this.nativeTexture)throw new Error("copyTexture error: !this.nativeTexture");this.nativeTexture.copyFrom(e)}}function cd(t,n,e){var i;return C.defined(n.internalFormat)?i=new C.Texture({context:t,pixelFormat:n.internalFormat,width:n.width,height:n.height,flipY:(e==null?void 0:e.flipY)??!0,source:{arrayBufferView:n.bufferView}}):(i=new C.Texture({context:t,source:n,flipY:(e==null?void 0:e.flipY)??!0,sampler:new C.Sampler({wrapS:C.TextureWrap[(e==null?void 0:e.wrapS)??"REPEAT"],wrapT:C.TextureWrap[(e==null?void 0:e.wrapT)??"REPEAT"],minificationFilter:C.TextureMinificationFilter[(e==null?void 0:e.minificationFilter)??"LINEAR"],magnificationFilter:C.TextureMinificationFilter[(e==null?void 0:e.magnificationFilter)??"LINEAR"]})}),bP(i.sampler)&&i.generateMipmap()),i}function bP(t){return[C.TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,C.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,C.TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,C.TextureMinificationFilter.LINEAR_MIPMAP_LINEAR].includes(t.minificationFilter)}class ha extends d.Destroyable{constructor(e){super();L(this,"_resouceRef");e&&(this._resouceRef={resouce:e,ref:1}),this.dispose(()=>this.reset())}get valid(){return!!this._resouceRef}get raw(){var e;return(e=this._resouceRef)==null?void 0:e.resouce}get ref(){var e;return(e=this._resouceRef)==null?void 0:e.ref}getRef(e){return e=e??new ha,e.reset(this),e}equal(e){return e._resouceRef===this._resouceRef}reset(e){if(this._resouceRef){if(this._resouceRef.ref<=0)throw new Error("ref <= 0!");--this._resouceRef.ref,this._resouceRef.ref===0&&this._resouceRef.resouce.destroy(),this._resouceRef=void 0}if(e){if(!e._resouceRef)throw new Error("handler._resouceRef is undefined!");e._resouceRef.ref+=1,this._resouceRef=e._resouceRef}return this}}class H0{constructor(n){L(this,"_map");L(this,"_loadingMap");this._context=n,this._map=new Map,this._loadingMap=new Map}getTextureHandler(n){if(this._map.has(n)){const i=this._map.get(n);if(i&&i.valid)return i;this._map.delete(n)}let e;return this._loadingMap.has(n)?e=this._loadingMap.get(n):(e=new Promise((i,o)=>{C.Resource.createIfNeeded(n).fetchImage().then(r=>{const s=cd(this._context,r),a=new ha(s);this._map.set(n,a),this._loadingMap.delete(n),i(a)}).catch(()=>{console.error("loading image error!"),this._loadingMap.delete(n),o()})}),this._loadingMap.set(n,e)),e}clearUnused(){const n=[];for(let[e,i]of this._map)i.ref===1&&n.push(e);for(let e of n)this._map.get(e).reset(),this._map.delete(e)}}const hd=new Map;function G0(t){return hd.has(t)||hd.set(t,new H0(t)),hd.get(t)}const Ss=class Ss extends d.Destroyable{constructor(e,i){super();L(this,"_complexImage",this.disposeVar(new d.ComplexImage));L(this,"_copyFromClipboardProcessing",this.disposeVar(d.createProcessingFromAsyncFunc(async e=>{const i=await e.promise(navigator.clipboard.read());if(i.length===0){console.warn("剪切板中没有内容,无法粘贴!");return}const o=i[0],r=o.types.findIndex(u=>u.startsWith("image"));if(r===-1){console.warn("剪切板中没有图像!");return}const s=await e.promise(o.getType(o.types[r])),a=window.URL.createObjectURL(new Blob([s]));e.disposer.dispose(()=>window.URL.revokeObjectURL(a));const l=await e.promise(new Promise((u,h)=>{const c=new Image;c.src=a,c.onload=()=>u(c),c.onerror=()=>h("无法加载图片!"),c.onabort=()=>h("加载图片被中断!")}));this.copyFromImage(l)})));L(this,"_readyEvent",this.disposeVar(new d.Event));L(this,"_czmNativeTexture");L(this,"_id",this.disposeVar(d.react(d.createGuid())));if(this._czmViewer=e,i&&(this.id=i),this._czmNativeTexture=this.disposeVar(new _P(this.czmViewer.viewer,this.complexImage)),this.disposeVar(new d.ObjResettingWithEvent(this.showPreviewChanged,()=>{if(this.showPreview)return new CP(this)})),!this._czmViewer.viewer)return;this.readyEvent.emit(e),this.dispose(d.track([this._complexImage,"enabled"],[this,"enabled"])),this.dispose(d.bind([this._complexImage,"size"],[this,"size"])),this.dispose(d.bind([this._complexImage,"pixelFormat"],[this,"pixelFormat"])),this.dispose(d.bind([this._complexImage,"flipY"],[this,"flipY"]));const r=this.disposeVar(V.ESSceneObject.context.createEnvStrReact([this,"uri"],""));this.dispose(d.bind([this._complexImage,"uri"],r)),this.dispose(d.bind([this._complexImage,"type"],[this,"uriType"])),this.dispose(d.bind([this._complexImage,"crossOrigin"],[this,"crossOrigin"],s=>s==="null"?null:s)),this.dispose(d.bind([this._complexImage,"autoplay"],[this,"autoplay"])),this.dispose(d.bind([this._complexImage,"loop"],[this,"loop"])),window.czmTexture||(window.czmTexture={}),window.czmTexture[this.id]=this,this.ad(()=>{Reflect.has(window.czmTexture,this.id)&&Reflect.deleteProperty(window.czmTexture,this.id)})}get complexImage(){return this._complexImage}copyTexture(e){this._complexImage.copyTexture(e)}copyFromImage(e){if(e.naturalWidth<=0||e.naturalHeight<=0){console.warn("copyFromImage error: image.naturalWidth <= 0 || image.naturalHeight <= 0");return}this.size=[e.naturalWidth,e.naturalHeight],this.copyTexture({source:e})}copyFromCanvas(e){this._complexImage.copyFromCanvas(e)}copyFromClipboard(){this._copyFromClipboardProcessing.restart()}reset(){this.uri="",this.size=void 0,this.uriType=void 0,this.flipY=!0,this.pixelFormat="RGBA"}get readyEvent(){return this._readyEvent}get czmNativeTexture(){return this._czmNativeTexture}getDefaultTexture(){if(!this._czmViewer.viewer)throw new Error("!this.czmViewer.viewer");return this._czmViewer.viewer.scene.context.defaultTexture}get texture(){return this.czmNativeTexture.nativeTexture??this.getDefaultTexture()}get czmViewer(){return this._czmViewer}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};L(Ss,"types",d.ComplexImage.types),L(Ss,"suffixTypes",d.ComplexImage.suffixTypes),L(Ss,"defaults",{size:[256,256],uriType:"img",czmPixelFormats:d.czmPixelFormats,uriTypes:Ss.types});let ht=Ss;(t=>{t.createDefaultProps=()=>({enabled:!0,showPreview:!1,size:d.reactArrayWithUndefined(void 0),pixelFormat:"RGBA",flipY:!0,uri:void 0,uriType:void 0,crossOrigin:"",autoplay:!0,loop:!0,...V.ESSceneObject.createDefaultProps()})})(ht||(ht={})),d.extendClassProps(ht.prototype,ht.createDefaultProps);class CP extends d.HasOwner{constructor(e){super(e);L(this,"_builtin",(()=>{const e=this.disposeVar(V.ESSceneObject.createFromJson(wP));e.uniformMap={u_image:{type:"texture",id:this.owner.id}},this.dispose(this.owner.czmViewer.disposableAdd(e))})())}}const Es=class Es extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_updateObjectsToExcludeWrapper",this.ad(new d.Event));const o=e.viewer;if(!o)return;const r=new C.PointPrimitiveCollection;let s;{const a=()=>{r&&(s&&r.remove(s),o.scene.primitives.remove(r),s=void 0)};this.ad(a),a(),s=r.add({}),C.PointPrimitive.prototype&&(s.ESSceneObjectID=i),o.scene.primitives.add(r)}{const a=this.ad(d.createNextAnimateFrameEvent(this.positionChanged,this.showChanged,this.pixelSizeChanged,this.colorChanged,this.outlineColorChanged,this.outlineWidthChanged,this.distanceDisplayConditionChanged,this.scaleByDistanceChanged,this.translucencyByDistanceChanged)),l=()=>{!s||!r||(s.show=(this.show??!0)&&!!this.position,this.position&&(s.position=ft(this.position)),s.pixelSize=this.pixelSize??1,s.color=Ie(this.color??Es.defaults.color),this.distanceDisplayCondition&&(s.distanceDisplayCondition=Ds(this.distanceDisplayCondition)),s.outlineColor=Ie(this.outlineColor??Es.defaults.outlineColor),s.outlineWidth=this.outlineWidth??Es.defaults.outlineWidth,this.scaleByDistance&&(s.scaleByDistance=cr(this.scaleByDistance)),this.translucencyByDistance&&(s.translucencyByDistance=cr(this.translucencyByDistance)))};l(),this.ad(a.don(l))}{const a=this.ad(d.createNextAnimateFrameEvent(this._updateObjectsToExcludeWrapper,this.allowPickingChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{if(!(this.allowPicking||!s))return new tt.ObjectsToExcludeWrapper(e,s)}))}this.ad(this.flyToEvent.don(a=>{if(!this.position){console.warn("没有位置信息,无法飞行");return}const l=o.scene.camera.positionCartographic.height;Be(o,this.position,l,void 0,a)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(Es,"defaults",{pixelSize:1,outlineWidth:1,color:[1,1,1,.5],outlineColor:[1,1,1,1]});let zn=Es;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:!1,position:d.reactArrayWithUndefined(void 0),pixelSize:void 0,color:d.reactArrayWithUndefined(void 0),distanceDisplayCondition:void 0,disableDepthTestDistance:void 0,outlineColor:d.reactArrayWithUndefined(void 0),outlineWidth:void 0,scaleByDistance:d.reactArrayWithUndefined(void 0),translucencyByDistance:d.reactArrayWithUndefined(void 0)})})(zn||(zn={})),d.extendClassProps(zn.prototype,zn.createDefaultProps);class Tn extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_primitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.ad(r);const s=()=>{!this._primitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.primitives.lowerToBottom(this._primitive):this.topOrBottom=="top"&&o.scene.primitives.raiseToTop(this._primitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const c=()=>{this._primitive&&(this._primitive.show=this.show??!0)};c(),this.ad(this.showChanged.don(c));const A=()=>{if(r(),!this.positions){this._boundingSphere=void 0;return}const f=this.positions.map(qt);this._primitive=h(f),this._primitive&&o.scene.primitives.add(this._primitive),s(),c();const g=[],v=f.length;for(let y=0;y<v;y++){const m=f[y].length;for(let _=0;_<m;_++)g.push(f[y][_])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g):void 0};A();const p=this.ad(d.createNextAnimateFrameEvent(this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.positionsChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(p.don(A)),this.ad(this.flyToEvent.don(()=>{e.actived&&(p.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,u=()=>{let c;return this.hasArrow?(c=C.Material.fromType("PolylineArrow"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(c=C.Material.fromType("PolylineDash"),c.uniforms.color=Ie(this.color??[1,1,1,1],a),c.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),c.uniforms.dashLength=this.dashLength??16,c.uniforms.dashPattern=this.dashPattern??255):(c=C.Material.fromType("Color"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)),c},h=c=>{const A=new C.PolylineMaterialAppearance({material:u(),renderState:{depthTest:{enabled:this.depthTest??!1}}});A.renderState.depthMask=!1;const p=[];for(let g=0;g<c.length;++g){const v=c[g];v.length<2||p.push(new C.GeometryInstance({geometry:new C.PolylineGeometry({positions:v,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(p.length===0)return;const f=new C.Primitive({geometryInstances:p,appearance:A,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.Primitive.prototype&&(f.ESSceneObjectID=i),f}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:d.reactPositionsSet(void 0),width:void 0,color:d.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:d.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(Tn||(Tn={})),d.extendClassProps(Tn.prototype,Tn.createDefaultProps);class Aa extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_groundPrimitive");L(this,"_boundingSphere");const o=e.viewer;if(!o)return;const r=()=>{this._groundPrimitive&&o.scene.groundPrimitives.remove(this._groundPrimitive),this._groundPrimitive=void 0};this.ad(r);const s=()=>{!this._groundPrimitive||this.topOrBottom=="none"||(this.topOrBottom=="bottom"?o.scene.groundPrimitives.lowerToBottom(this._groundPrimitive):this.topOrBottom=="top"&&o.scene.groundPrimitives.raiseToTop(this._groundPrimitive))};s(),this.ad(this.topOrBottomChanged.don(s));{const c=()=>{if(r(),!(this.show??!0)||!this.positions)return;const p=this.positions.map(qt);this._groundPrimitive=u(p),this._groundPrimitive&&o.scene.groundPrimitives.add(this._groundPrimitive),s(),this._groundPrimitive&&(this._groundPrimitive.show=this.show??!0);const f=new C.BoundingSphere;if(!p){this._boundingSphere=void 0;return}const g=[],v=p.length;for(let y=0;y<v;++y){const m=p[y].length;for(let _=0;_<m;++_)g.push(p[y][_])}this._boundingSphere=g?C.BoundingSphere.fromPoints(g,f):void 0};c();const A=this.ad(d.createNextAnimateFrameEvent(this.showChanged,this.positionsChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.arcTypeChanged,this.depthTestChanged,this.allowPickingChanged));this.ad(A.don(c)),this.dispose(this.flyToEvent.disposableOn(()=>{e.actived&&(A.flush(),this._boundingSphere&&o.camera.flyToBoundingSphere(this._boundingSphere))}))}const a=new C.Color,l=new C.Color,u=c=>{const A=[];for(let f=0;f<c.length;++f){const g=c[f];g.length<2||A.push(new C.GeometryInstance({geometry:new C.GroundPolylineGeometry({positions:g,width:this.width??1,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??"GEODESIC"]}),id:this}))}if(A.length===0)return;const p=new C.GroundPolylinePrimitive({geometryInstances:A,appearance:new C.PolylineMaterialAppearance({material:h(),renderState:{depthTest:{enabled:this.depthTest??!1}}}),asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return C.GroundPolylinePrimitive.prototype&&(p.ESSceneObjectID=i),p},h=()=>{let c;return this.hasArrow?(c=C.Material.fromType("PolylineArrow"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)):this.hasDash?(c=C.Material.fromType("PolylineDash"),c.uniforms.color=Ie(this.color??[1,1,1,1],l),c.uniforms.gapColor=Ie(this.gapColor??[0,0,0,0],l),c.uniforms.dashLength=this.dashLength??16,c.uniforms.dashPattern=this.dashPattern??255):(c=C.Material.fromType("Color"),c.uniforms.color=Ie(this.color??[1,1,1,1],a)),c}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:d.reactPositionsSet(void 0),width:void 0,color:d.reactArrayWithUndefined(void 0),hasDash:void 0,gapColor:d.reactArrayWithUndefined(void 0),dashLength:void 0,dashPattern:void 0,hasArrow:void 0,arcType:void 0,depthTest:void 0,topOrBottom:"none"})})(Aa||(Aa={})),d.extendClassProps(Aa.prototype,Aa.createDefaultProps);class ei extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));if(!e.viewer)return;const r=this.ad(new Tn(e,i)),s=this.ad(new Aa(e,i));this.dispose(d.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(d.track([s,"allowPicking"],[this,"allowPicking"]));{const a=()=>{const u=this.ground??!1,h=this.show??!0;r.show=h&&!u,s.show=h&&u,r.positions=s.positions=xP(this),r.arcType=s.arcType=this.arcType,r.width=s.width=this.width??1,r.hasDash=s.hasDash=this.hasDash,r.hasArrow=s.hasArrow=this.hasArrow,r.color=s.color=this.color,r.gapColor=s.gapColor=this.gapColor,r.dashLength=s.dashLength=this.dashLength,r.dashPattern=s.dashPattern=this.dashPattern,r.depthTest=s.depthTest=this.depthTest??!1,r.allowPicking=s.allowPicking=this.allowPicking??!1,r.topOrBottom=s.topOrBottom=this.topOrBottom??"none"};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(this.showChanged,this.groundChanged,this.positionsChanged,this.arcTypeChanged,this.widthChanged,this.hasDashChanged,this.hasArrowChanged,this.colorChanged,this.gapColorChanged,this.dashLengthChanged,this.dashPatternChanged,this.depthTestChanged,this.allowPickingChanged,this.topOrBottomChanged));this.dispose(l.disposableOn(()=>{a()})),this.dispose(this.flyToEvent.disposableOn(u=>{this.ground?s.flyTo(u):r.flyTo(u)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:d.reactPositionsSet(void 0),width:1,ground:!1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!0,topOrBottom:"none",loop:!1})})(ei||(ei={})),d.extendClassProps(ei.prototype,ei.createDefaultProps);function xP(t){if(t.loop&&t.positions&&t.positions.length>0){const e=[];return t.positions.forEach(i=>{e.push([...i,i[0]])}),e}else return t.positions}const SP=`
|
|
136
136
|
类型说明:
|
|
137
137
|
\`\`\`javascript
|
|
138
138
|
|
|
@@ -2394,7 +2394,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
2394
2394
|
material.diffuse *= (u_topColor.rgb * u_topColor.a);
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
|
-
`})));this._sceneObject=o,this._viewer=r;{const s=()=>{this._customShader.uniforms.u_discardRatio.value=C.Cartesian2.fromArray(n.discard)};s(),this.dispose(n.discardChanged.disposableOn(s))}{const s=()=>{this._customShader.uniforms.u_bottomColor.value=new C.Color(...n.bottomColor)};s(),this.dispose(n.bottomColorChanged.disposableOn(s))}{const s=()=>{this._customShader.uniforms.u_topColor.value=new C.Color(...n.topColor)};s(),this.dispose(n.topColorChanged.disposableOn(s))}}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get customShader(){return this._customShader}update(){alert("暂未实现!")}}}function UR(t,n,e){const i=t,o=n,r=[[i[0],i[1],0],[o[0],i[1],0],[o[0],o[1],0],[i[0],o[1],0]],s=C.Math.toDegrees,a=r.map(u=>{const h=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...u),new C.Cartesian3),c=C.Cartographic.fromCartesian(h);return[s(c.longitude),s(c.latitude),c.height]});return[[a[0],a[1],a[2],a[3],a[0]]]}class OR extends d.Destroyable{constructor(e,i){super();L(this,"_customShader");this._czmFlattenedPlane=e,this._reverse=i,this._customShader=RR(this._reverse,this._czmFlattenedPlane),this._czmFlattenedPlane.computedCustomShader=this.customShader,this.dispose(()=>{this._czmFlattenedPlane.computedCustomShader=void 0})}get customShader(){return this._customShader}}class Gr extends d.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_computedCustomShader",this.disposeVar(d.react(void 0)));L(this,"_polylines");L(this,"_finalMatrix",this.disposeVar(d.react(void 0)));L(this,"_czmTextureWithId");i&&(this.id=i),this._czmTextureWithId=this.disposeVar(new V.ESSceneObjectWithId),this._polylines=this.disposeVar(new Tn(e)),this._polylines.arcType="NONE",this.dispose(d.track([this._czmTextureWithId,"id"],[this,"czmTextureId"])),this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof tt)||!e.actived)return;if(!this.position){console.warn("CzmFlattenedPlane warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{if(!this.enabled){this.finalMatrix=void 0,this.polylines.positions=void 0;return}const s=[...this.modelMatrix];let a=[];if(this.finalMatrix=void 0,this.position){const l=at({position:this.position,rotation:this.rotation});if(l){const u=C.Matrix4.fromArray(this.modelMatrix),h=C.Matrix4.multiply(l,u,new C.Matrix4);C.Matrix4.toArray(h,s),this.finalMatrix=h,a=UR(this.minSize,this.maxSize,h)}}this.polylines.positions=a};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}{const o=this.disposeVar(d.createNextAnimateFrameEvent(this.enabledChanged,this.reverseChanged));this.disposeVar(new d.ObjResettingWithEvent(o,()=>{if(this.enabled)return new OR(this,this.reverse)}))}this.dispose(d.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(d.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(d.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedCustomShader(){return this._computedCustomShader.value}set computedCustomShader(e){this._computedCustomShader.value=e}get computedCustomShaderChanged(){return this._computedCustomShader.changed}get polylines(){return this._polylines}get finalMatrix(){return this._finalMatrix.value}set finalMatrix(e){this._finalMatrix.value=e}get finalMatrixChanged(){return this._finalMatrix.changed}get czmTextureWithId(){return this._czmTextureWithId}}L(Gr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,position:d.reactArrayWithUndefined(void 0),rotation:d.reactArray([0,0,0]),modelMatrix:d.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,discard:d.reactArray([0,1]),topColor:d.reactArray([1,1,1,1]),bottomColor:d.reactArray([1,1,1,1]),edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2,minSize:d.reactArray([-100,-100]),maxSize:d.reactArray([100,100]),sceneObjectIds:d.reactArray([]),czmTextureId:""})})(Gr||(Gr={})),d.extendClassProps(Gr.prototype,Gr.createDefaultProps);class LR extends V.Destroyable{constructor(n,e){super(),this._czmPolygonFlattenedPlane=n,this._czmFlattenedPlane=e;{const{polygonCanvas:i}=this._czmPolygonFlattenedPlane,o=6378137,r=C.Math.toRadians,s=()=>{const{canvasGeoInfo:a}=i;if(!a)return;const{rect:l,height:u}=a,h=[(l[0]+l[2])/2,(l[1]+l[3])/2,u],c=r(l[2]-l[0])*o*Math.cos(r(h[1])),A=r(l[3]-l[1])*o;this._czmFlattenedPlane.position=h,this._czmFlattenedPlane.minSize=[-c*.5,-A*.5],this._czmFlattenedPlane.maxSize=[c*.5,A*.5]};s(),this.dispose(i.canvasGeoInfoChanged.disposableOn(s))}this._czmFlattenedPlane.czmTextureWithId.id=this._czmPolygonFlattenedPlane.czmTexture.id,this.dispose(()=>this._czmFlattenedPlane.czmTextureWithId.id=void 0);{const i=this._czmFlattenedPlane.showHelper;this._czmFlattenedPlane.showHelper=!1,this.dispose(()=>this._czmFlattenedPlane.showHelper=i)}this.dispose(d.track([this._czmFlattenedPlane,"enabled"],[this._czmPolygonFlattenedPlane,"enabled"]))}}class Il extends V.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_czmTexture");L(this,"_polygon");L(this,"_polygonCanvas");L(this,"_czmFlattenedPlaneWithId");L(this,"_czmFlattendPlaneWithIdResetting");i&&(this._id.value=i);{this._czmTexture=this.disposeVar(new ht(e,i)),this._polygon=this.disposeVar(new V.ESGeoPolygon(`${i}_polygon`)),e.add(this._polygon),this.ad(()=>{e.delete(this._polygon)}),this.dispose(d.track([this._polygon,"allowPicking"],[this,"allowPicking"])),this.dispose(d.track([this._polygon,"points"],[this,"positions"])),this.dispose(d.track([this._polygon,"show"],[this,"show"])),this._polygonCanvas=this.disposeVar(new Mo(e,i)),this._polygonCanvas.geoPolygonWithId.sceneObject=this._polygon;const o=()=>{this._czmTexture.copyFromCanvas(this._polygonCanvas.canvas)};o(),this.dispose(this._polygonCanvas.canvasChanged.disposableOn(o)),this.dispose(this._czmTexture.readyEvent.disposableOn(o)),this._czmFlattenedPlaneWithId=this.disposeVar(new V.ESSceneObjectWithId),this.dispose(d.track([this._czmFlattenedPlaneWithId,"id"],[this,"czmFlattenedPlaneId"])),this._czmFlattendPlaneWithIdResetting=this.disposeVar(new d.ObjResettingWithEvent(this.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:r}=this.czmFlattenedPlaneWithId;if(!r)return;let s;V.registerCreatedEventUpdate(this,r,()=>{const a=e.getEngineObject(r);if(r instanceof V.ES3DTileset&&(s=a.flattenedPlane),s instanceof Gr)return new LR(this,s)})}))}this.dispose(this._flyToEvent.disposableOn(o=>{this._polygon.flyTo(o)}))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmTexture(){return this._czmTexture}get polygon(){return this._polygon}get polygonCanvas(){return this._polygonCanvas}get czmFlattenedPlaneWithId(){return this._czmFlattenedPlaneWithId}get czmFlattendPlaneWithIdResetting(){return this._czmFlattendPlaneWithIdResetting}}(t=>{t.createDefaultProps=()=>({enabled:!0,show:!0,positions:d.reactPositions([]),allowPicking:!1,czmFlattenedPlaneId:""})})(Il||(Il={})),d.extendClassProps(Il.prototype,Il.createDefaultProps);class xi extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));if(!e.viewer)return;const r=this.ad(new da(e,i)),s=this.ad(new Ye(e,i));s.loop=!0,this.ad(d.bind([s,"depthTest"],[this,"depthTest"])),this.dispose(d.track([r,"allowPicking"],[this,"allowPicking"]));{const u=()=>{r.ground=this.ground,s.ground=this.strokeGround,s.arcType=this.strokeGround?"NONE":"GEODESIC"};u();const h=this.ad(d.createNextAnimateFrameEvent(this.groundChanged,this.strokeGroundChanged));this.ad(h.don(u))}const a=()=>{s.show=this.show&&this.outline,r.show=this.show&&this.fill,s.positions=this.positions,r.polygonHierarchy=r.show?{positions:this.positions||[]}:{positions:[]},s.color=this.outlineColor,s.width=this.outlineWidth,r.material={type:"Color",color:this.color||[1,1,1,.5]}};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.outlineColorChanged,this.outlineWidthChanged,this.fillChanged,this.colorChanged,this.positionsChanged));this.dispose(l.disposableOn(a)),this.dispose(this.flyToEvent.disposableOn(u=>{this.viewDistanceRange||(r.flyTo(u),this.fill||s.flyTo(u))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}L(xi,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4],positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,outline:!0,strokeGround:!1,ground:!1,outlineColor:d.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:d.reactArray([1,1,1,.5]),positions:d.reactPositions(void 0),viewDistanceRange:d.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(xi||(xi={})),d.extendClassProps(xi.prototype,xi.createDefaultProps);const nu=class nu extends en{constructor(e,i){super(e,i);L(this,"_geoPolygon");if(!i.viewer){console.warn("viewer is undefined!");return}this._geoPolygon=this.ad(new xi(i,e.id));const r=this.geoPolygon;r&&(this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(d.track([r,"ground"],[e,"fillGround"])),this.dispose(d.track([r,"outline"],[e,"stroked"])),this.dispose(d.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(d.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(d.track([r,"fill"],[e,"filled"])),this.dispose(d.track([r,"color"],[e,"fillColor"])))}get geoPolygon(){return this._geoPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s!=null&&s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):s!=null&&s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(nu,"type",nu.register("ESCesiumViewer",V.ESGeoPolygon.type,nu));let kn=nu,zR=class extends d.Destroyable{constructor(n,e){super(),this._czmESPolygonFlattenedPlane=n,this._eS3DTileset=e,this._eS3DTileset.flattenedPlaneEnabled=!0,this._czmESPolygonFlattenedPlane.polygonFlattenedPlane.czmFlattenedPlaneId=this._eS3DTileset.flattenedPlaneId,this.dispose(()=>this._eS3DTileset.flattenedPlaneEnabled=!1)}};const iu=class iu extends kn{constructor(e,i){super(e,i);L(this,"_polygonFlattenedPlane");L(this,"_tilesSceneObjectWithId");this._polygonFlattenedPlane=this.disposeVar(new Il(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=V.ESSceneObject.getSceneObject(e.targetID);o.value=l?l.mainClass.id:""})),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),!i.viewer){console.warn("viewer is undefined!");return}const s=this._polygonFlattenedPlane;s.enabled=!0,this.dispose(d.track([s,"show"],[e,"show"])),this.dispose(d.bind([s,"positions"],[e,"points"])),this.dispose(d.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([s,"czmFlattenedPlaneId"],[e,"czmFlattenedPlaneId"])),this.dispose(d.track([s.polygon,"stroked"],[e,"stroked"])),this.dispose(d.track([s.polygon,"strokeColor"],[e,"strokeColor"])),this.dispose(d.track([s.polygon,"strokeWidth"],[e,"strokeWidth"])),this.dispose(d.track([s.polygon,"filled"],[e,"filled"])),this.dispose(d.track([s.polygon,"fillColor"],[e,"fillColor"])),this.dispose(d.track([s.polygon,"strokeGround"],[e,"strokeGround"])),this.dispose(d.track([s.polygon,"fillGround"],[e,"fillGround"]));const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof V.ES3DTileset&&this.sceneObject.show)return new zR(this,l)}))}get polygonFlattenedPlane(){return this._polygonFlattenedPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,polygonFlattenedPlane:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(iu,"type",iu.register("ESCesiumViewer",V.ESPolygonFlattenedPlane.type,iu));let fm=iu;function QR(t,n,e){const i=t,o=n,r=(o[0]-i[0]+(o[1]-i[1]))/4,s=[[i[0],0,i[1]],[o[0],0,i[1]],[o[0],0,o[1]],[i[0],0,o[1]],[0,r,0]],a=C.Math.toDegrees,l=s.map(h=>{const c=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...h),new C.Cartesian3),A=C.Cartographic.fromCartesian(c);return[a(A.longitude),a(A.latitude),A.height]});return[[[l[0],l[1],l[2],l[3],l[0]]],l[4]]}class Do extends d.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_polylines");L(this,"_axis");i&&(this.id=i),this._polylines=this.disposeVar(new Tn(e,i)),this._axis=this.disposeVar(new Ye(e,i)),this._axis.hasArrow=!0,this._axis.width=10,this._polylines.arcType=this._axis.arcType="NONE",this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof tt)||!e.actived)return;if(!this.position){console.warn("CzmPlane warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{let s=[],a;if(this.position){const l=at({position:this.position,rotation:this.rotation});if(l){const u=QR(this.minSize,this.maxSize,l);s=u[0],a=u[1]}}this.polylines.positions=s,!(!this.position||!a)&&(this.axis.positions=[this.position,a])};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(d.track([this.polylines,"color"],[this,"color"])),this.dispose(d.track([this.polylines,"width"],[this,"width"])),this.dispose(d.track([this.polylines,"show"],[this,"show"])),this.dispose(d.track([this.axis,"color"],[this,"color"]));{const o=()=>{this.axis.show=this.show&&this.showArrow};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.showArrowChanged.disposableOn(o))}}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylines(){return this._polylines}get axis(){return this._axis}}L(Do,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,showArrow:!0,position:d.reactArrayWithUndefined(void 0),rotation:d.reactArray([0,0,0]),color:d.reactArray([1,1,1,1]),width:2,minSize:d.reactArray([-100,-100]),maxSize:d.reactArray([100,100])})})(Do||(Do={})),d.extendClassProps(Do.prototype,Do.createDefaultProps);class VR extends V.Destroyable{constructor(e,i,o){super();L(this,"_centerMatrix",this.disposeVar(d.react(void 0)));L(this,"_inverseCenterMatrix",this.disposeVar(d.react(void 0)));L(this,"_czmPlaneWrappers");L(this,"_czmPlaneWrappersChanged",this.disposeVar(d.createNextAnimateFrameEvent()));L(this,"_computedPlanesChanged",this.disposeVar(d.createNextAnimateFrameEvent()));this._czmClippingPlanes=i,this._planeIds=o,this._czmPlaneWrappers=this._planeIds.map(r=>this.disposeVar(new HR(e,this,r)));{const r=()=>{let s,a;const l=this._czmPlaneWrappers.filter(u=>u.position&&u.rotation);if(l.length!==0){const u=l.map(c=>c.position),h=V.getMinMaxCorner(u);s=at({position:h.center}),s&&(a=C.Matrix4.inverseTransformation(s,new C.Matrix4))}this.centerMatrix=s,this.inverseCenterMatrix=a};r(),this.dispose(this.czmPlaneWrappersChanged.disposableOn(r))}{const r=()=>{if(!this.centerMatrix){this._czmClippingPlanes.computedClippingPlanes=void 0;return}const a=C.Matrix4.toArray(this.centerMatrix),l=this._czmPlaneWrappers.filter(u=>!!u.computedPlane).map(u=>u.computedPlane);this._czmClippingPlanes.computedClippingPlanes={planes:l,enabled:this._czmClippingPlanes.enabled,modelMatrix:a,unionClippingRegions:this._czmClippingPlanes.unionClippingRegions,edgeColor:this._czmClippingPlanes.edgeColor,edgeWidth:this._czmClippingPlanes.edgeWidth}};r();const s=this.disposeVar(d.createNextAnimateFrameEvent(this._czmClippingPlanes.enabledChanged,this.centerMatrixChanged,this.inverseCenterMatrixChanged,this.computedPlanesChanged,this._czmClippingPlanes.unionClippingRegionsChanged,this._czmClippingPlanes.edgeColorChanged,this._czmClippingPlanes.edgeWidthChanged));this.dispose(s.disposableOn(r))}}get centerMatrix(){return this._centerMatrix.value}set centerMatrix(e){this._centerMatrix.value=e}get centerMatrixChanged(){return this._centerMatrix.changed}get inverseCenterMatrix(){return this._inverseCenterMatrix.value}set inverseCenterMatrix(e){this._inverseCenterMatrix.value=e}get inverseCenterMatrixChanged(){return this._inverseCenterMatrix.changed}get czmPlaneWrappers(){return this._czmPlaneWrappers}get czmPlaneWrappersChanged(){return this._czmPlaneWrappersChanged}get computedPlanesChanged(){return this._computedPlanesChanged}get czmClippingPlanes(){return this._czmClippingPlanes}}class NR extends V.Destroyable{constructor(n,e){super(),this._czmPlaneWrapper=n,this._czmPlane=e,this._czmPlaneWrapper.position=this._czmPlane.position,this.dispose(()=>this._czmPlaneWrapper.position=void 0),this.dispose(d.track([this._czmPlaneWrapper,"position"],[this._czmPlane,"position"])),this._czmPlaneWrapper.rotation=this._czmPlane.rotation,this.dispose(()=>this._czmPlaneWrapper.rotation=[0,0,0]),this.dispose(d.track([this._czmPlaneWrapper,"rotation"],[this._czmPlane,"rotation"]))}}class HR extends V.Destroyable{constructor(e,i,o){super();L(this,"_sowi");L(this,"_position",this.disposeVar(d.reactArrayWithUndefined(void 0)));L(this,"_rotation",this.disposeVar(d.reactArray([0,0,0])));L(this,"_computedPlane",this.disposeVar(d.reactJson(void 0)));this._planesResetting=i,this._planeId=o,this._sowi=this.disposeVar(new V.ESSceneObjectWithId),this._sowi.id=this._planeId,this.disposeVar(new d.ObjResettingWithEvent(this.sowi.sceneObjectChanged,()=>{const{sceneObject:r}=this.sowi;if(!r)return;let s;V.registerCreatedEventUpdate(this,r,()=>{const a=e.getEngineObject(r);if(r instanceof V.ESClippingPlane&&(s=a.czmPlane),!!s&&s instanceof Do)return new NR(this,s)})})),this.dispose(this.positionChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next())),this.dispose(this.rotationChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next()));{const r=()=>{const{inverseCenterMatrix:a}=this._planesResetting;if(!a)return this.computedPlane=void 0;const{position:l,rotation:u}=this;if(!l)return this.computedPlane=void 0;const h=at({position:l,rotation:u});if(!h)return this.computedPlane=void 0;const A=C.Matrix4.multiply(a,h,new C.Matrix4),p=new C.Cartesian3(A[4],A[5],A[6]),f=new C.Cartesian3(A[12],A[13],A[14]);C.Cartesian3.normalize(p,p);let g=-C.Cartesian3.dot(p,f);const v=[p.x,p.y,p.z];this._planesResetting.czmClippingPlanes.reverseNormal&&(d.Vector.negate(v,v),g=-g),this.computedPlane={normal:v,distance:g}};r();const s=this.disposeVar(d.createNextAnimateFrameEvent(this._planesResetting.inverseCenterMatrixChanged,this.positionChanged,this.rotationChanged,this._planesResetting.czmClippingPlanes.reverseNormalChanged));this.dispose(s.disposableOn(r))}this.dispose(this.computedPlaneChanged.disposableOn(()=>this._planesResetting.computedPlanesChanged.next()))}get sowi(){return this._sowi}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get rotation(){return this._rotation.value}set rotation(e){this._rotation.value=e}get rotationChanged(){return this._rotation.changed}get computedPlane(){return this._computedPlane.value}set computedPlane(e){this._computedPlane.value=e}get computedPlaneChanged(){return this._computedPlane.changed}}class Ya extends V.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_computedClippingPlanes",this.disposeVar(d.react(void 0)));i&&(this.id=i),this.disposeVar(new d.ObjResettingWithEvent(this.planeIdsChanged,()=>new VR(e,this,this.planeIds)))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,planeIds:d.reactArray([]),reverseNormal:!1,unionClippingRegions:!0,edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2})})(Ya||(Ya={})),d.extendClassProps(Ya.prototype,Ya.createDefaultProps);let GR=class extends d.Destroyable{constructor(n,e){super(),this._czmESClippingPlane=n,this._eS3DTileset=e;const o=[this._czmESClippingPlane.czmPlane.id,...this._eS3DTileset.clippingPlaneIds];this._eS3DTileset.clippingPlaneIds=o,this.dispose(()=>{const r=[...this._eS3DTileset.clippingPlaneIds],s=this._czmESClippingPlane.czmPlane.id;r.includes(s)&&(r.splice(r.indexOf(s),1),this._eS3DTileset.clippingPlaneIds=r)})}},WR=class extends d.Destroyable{constructor(n){if(super(),this._czmESClippingPlane=n,!this._czmESClippingPlane.viewer)return;this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId=this._czmESClippingPlane.czmPlane.id;const e=()=>{if(!this._czmESClippingPlane.viewer)return;const o=at({position:this._czmESClippingPlane.sceneObject.position});if(!o)return;const r=f0(this._czmESClippingPlane.sceneObject.rotation);this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes={planes:[{normal:r,distance:0}],enabled:!0,modelMatrix:C.Matrix4.toArray(o),unionClippingRegions:!1,edgeColor:this._czmESClippingPlane.sceneObject.edgeColor,edgeWidth:this._czmESClippingPlane.sceneObject.edgetWidth}};e();const i=this.dv(d.createNextAnimateFrameEvent(this._czmESClippingPlane.sceneObject.positionChanged,this._czmESClippingPlane.sceneObject.rotationChanged,this._czmESClippingPlane.sceneObject.edgeColorChanged,this._czmESClippingPlane.sceneObject.edgetWidthChanged));this.d(i.don(e)),this.dispose(()=>{this._czmESClippingPlane.viewer&&(this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId="",this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes=void 0)})}};const ru=class ru extends Ge{constructor(e,i){super(e,i);L(this,"_innerPositionReact",this.disposeVar(d.reactArrayWithUndefined(void 0)));L(this,"_czmPlane");L(this,"_tilesSceneObjectWithId");this._czmPlane=this.disposeVar(new Do(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=V.ESSceneObject.getSceneObject(e.targetID);o.value=a?a.mainClass.id:""})),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),!i.viewer)return;const s=this._czmPlane;V.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmPlane.showChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(!(!this.sceneObject.show||!this.czmPlane.show))return u===""?new WR(this):!l||!(l instanceof V.ES3DTileset)?void 0:new GR(this,l)}))}),this.dispose(d.track([s,"show"],[e,"show"])),this.dispose(d.bind([s,"position"],[e,"position"])),this.dispose(Bt([s,"rotation"],[e,"rotation"])),this.dispose(d.track([s,"showArrow"],[e,"showArrow"])),this.dispose(d.track([s,"color"],[e,"edgeColor"])),this.dispose(d.track([s,"width"],[e,"edgetWidth"]));{const a=()=>{s.minSize=[-e.width/2,-e.height/2],s.maxSize=[e.width/2,e.height/2]};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(e.widthChanged,e.heightChanged));this.dispose(l.disposableOn(a))}{const a=()=>{d.Vector.equals(e.position,[0,0,0])?this._innerPositionReact.value=void 0:this._innerPositionReact.value=e.position};a(),this.dispose(this.sceneObject.positionChanged.disposableOn(a))}{const a=()=>{this._innerPositionReact.value==null?e.position=[0,0,0]:e.position=this._innerPositionReact.value};this.dispose(this._innerPositionReact.changed.disposableOn(a))}}get czmPlane(){return this._czmPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Ln(r,o,i,o.position,Math.max(o.width,o.height),e,!0),!0):!1:!1}};L(ru,"type",ru.register("ESCesiumViewer",V.ESClippingPlane.type,ru));let dm=ru;const qR=(t,n)=>C.Color.fromBytes(t[0]*255,t[1]*255,t[2]*255,t[3]*255,n),KR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case"contain":n&&n.includes(e.value)&&(i=!0);break;case"empty":(n===""||n===null||n===void 0||!n)&&(i=!0);break;default:i=!1;break}return i},ZR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case">":n>e.value&&(i=!0);break;case">=":n>=e.value&&(i=!0);break;case"<":n<e.value&&(i=!0);break;case"<=":n<=e.value&&(i=!0);break;default:i=!1;break}return i},XR=(t,n)=>{const e=[];for(let i of t.condition){if(typeof i=="boolean"){e.push(i);continue}const r=typeof i.value=="string",s=typeof i.value=="number";if(!r&&!s){e.push(!1);continue}const a=i.field;let l;if(a.includes("."))try{const u=a.split(".");l=JSON.parse(n.getProperty(u[0]));for(let h of u.slice(1))if(l=l==null?void 0:l[h],l===void 0)throw new Error(`${l}上不存在属性${h},将使用默认颜色!`)}catch{e.push(!1);continue}else l=n.getProperty(a);if(r){e.push(KR(i,l));continue}else if(s){e.push(ZR(i,l));continue}else{e.push(!1);continue}}return e},$R=(t,n)=>{const e=[];for(let i of t.condition){if(typeof i=="boolean"){e.push(i);continue}const r=typeof i.value=="string",s=typeof i.value=="number";if(!r&&!s){e.push(!1);continue}const a=i.field;let l;if(a.includes("."))try{const u=a.split(".");l=JSON.parse(n.getProperty(u[0]));for(let h of u.slice(1))if(l=l==null?void 0:l[h],l===void 0)throw new Error(`${l}上不存在属性${h},将使用默认颜色!`)}catch{e.push(!1);continue}else l=n.getProperty(a);if(r){e.push(YR(i,l));continue}else if(s){e.push(JR(i,l));continue}else{e.push(!1);continue}}return e},YR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case"contain":n.includes(e.value)&&(i=!0);break;case"empty":(n===""||n===null||n===void 0||!n)&&(i=!0);break;default:i=!1;break}return i},JR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case">":n>e.value&&(i=!0);break;case">=":n>=e.value&&(i=!0);break;case"<":n<e.value&&(i=!0);break;case"<=":n<=e.value&&(i=!0);break;default:i=!1;break}return i};class jR extends d.Destroyable{constructor(){super();L(this,"strokeSilhouette",C.PostProcessStageLibrary.createEdgeDetectionStage());L(this,"_viewer",this.disposeVar(d.react(void 0)));L(this,"_featureMap",new Map);const e=()=>{this.viewer&&(this.viewer.scene.postProcessStages.add(C.PostProcessStageLibrary.createSilhouetteStage([this.strokeSilhouette])),this.strokeSilhouette.uniforms.length=.01,this.strokeSilhouette.uniforms.color=C.Color.RED,this.strokeSilhouette.selected=[],this.ad(()=>{this.viewer&&this.viewer.scene.postProcessStages.remove(this.strokeSilhouette)}))};e(),this.ad(this.viewerChanged.don(e))}get viewer(){return this._viewer.value}set viewer(e){this.viewer instanceof C.Viewer||(this._viewer.value=e)}get viewerChanged(){return this._viewer.changed}get selected(){return[...this._featureMap.values()].flat()}setStrokeLength(e){this.strokeSilhouette.uniforms.length=e??.01}setStrokeColor(e){this.strokeSilhouette.uniforms.color=C.Color.fromBytes(e[0]*255,e[1]*255,e[2]*255,e[3]*255)}setStrokeSelect(e,i,o=!1){if(!this._featureMap.has(e))return;let r=this._featureMap.get(e);o&&(r==null||r.push(...i)),r=i,this._featureMap.set(e,r),this.strokeSilhouette.selected=this.selected}register(e){this.viewer=e.viewer.viewer,!this._featureMap.has(e)&&this._featureMap.set(e,[])}unregister(e){this._featureMap.has(e)&&(this._featureMap.delete(e),this.strokeSilhouette.selected=this.selected)}}let zb=[1,1,1];class e5 extends d.Destroyable{constructor(e,i){super();L(this,"_customShader");const o=new C.CustomShader({uniforms:{u_baseColor:{type:C.UniformType.VEC3,value:C.Cartesian3.fromArray(zb)}},fragmentShaderText:`
|
|
2397
|
+
`})));this._sceneObject=o,this._viewer=r;{const s=()=>{this._customShader.uniforms.u_discardRatio.value=C.Cartesian2.fromArray(n.discard)};s(),this.dispose(n.discardChanged.disposableOn(s))}{const s=()=>{this._customShader.uniforms.u_bottomColor.value=new C.Color(...n.bottomColor)};s(),this.dispose(n.bottomColorChanged.disposableOn(s))}{const s=()=>{this._customShader.uniforms.u_topColor.value=new C.Color(...n.topColor)};s(),this.dispose(n.topColorChanged.disposableOn(s))}}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get customShader(){return this._customShader}update(){alert("暂未实现!")}}}function UR(t,n,e){const i=t,o=n,r=[[i[0],i[1],0],[o[0],i[1],0],[o[0],o[1],0],[i[0],o[1],0]],s=C.Math.toDegrees,a=r.map(u=>{const h=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...u),new C.Cartesian3),c=C.Cartographic.fromCartesian(h);return[s(c.longitude),s(c.latitude),c.height]});return[[a[0],a[1],a[2],a[3],a[0]]]}class OR extends d.Destroyable{constructor(e,i){super();L(this,"_customShader");this._czmFlattenedPlane=e,this._reverse=i,this._customShader=RR(this._reverse,this._czmFlattenedPlane),this._czmFlattenedPlane.computedCustomShader=this.customShader,this.dispose(()=>{this._czmFlattenedPlane.computedCustomShader=void 0})}get customShader(){return this._customShader}}class Gr extends d.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_computedCustomShader",this.disposeVar(d.react(void 0)));L(this,"_polylines");L(this,"_finalMatrix",this.disposeVar(d.react(void 0)));L(this,"_czmTextureWithId");i&&(this.id=i),this._czmTextureWithId=this.disposeVar(new V.ESSceneObjectWithId),this._polylines=this.disposeVar(new Tn(e)),this._polylines.arcType="NONE",this.dispose(d.track([this._czmTextureWithId,"id"],[this,"czmTextureId"])),this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof tt)||!e.actived)return;if(!this.position){console.warn("CzmFlattenedPlane warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{if(!this.enabled){this.finalMatrix=void 0,this.polylines.positions=void 0;return}const s=[...this.modelMatrix];let a=[];if(this.finalMatrix=void 0,this.position){const l=at({position:this.position,rotation:this.rotation});if(l){const u=C.Matrix4.fromArray(this.modelMatrix),h=C.Matrix4.multiply(l,u,new C.Matrix4);C.Matrix4.toArray(h,s),this.finalMatrix=h,a=UR(this.minSize,this.maxSize,h)}}this.polylines.positions=a};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}{const o=this.disposeVar(d.createNextAnimateFrameEvent(this.enabledChanged,this.reverseChanged));this.disposeVar(new d.ObjResettingWithEvent(o,()=>{if(this.enabled)return new OR(this,this.reverse)}))}this.dispose(d.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(d.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(d.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedCustomShader(){return this._computedCustomShader.value}set computedCustomShader(e){this._computedCustomShader.value=e}get computedCustomShaderChanged(){return this._computedCustomShader.changed}get polylines(){return this._polylines}get finalMatrix(){return this._finalMatrix.value}set finalMatrix(e){this._finalMatrix.value=e}get finalMatrixChanged(){return this._finalMatrix.changed}get czmTextureWithId(){return this._czmTextureWithId}}L(Gr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,position:d.reactArrayWithUndefined(void 0),rotation:d.reactArray([0,0,0]),modelMatrix:d.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,discard:d.reactArray([0,1]),topColor:d.reactArray([1,1,1,1]),bottomColor:d.reactArray([1,1,1,1]),edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2,minSize:d.reactArray([-100,-100]),maxSize:d.reactArray([100,100]),sceneObjectIds:d.reactArray([]),czmTextureId:""})})(Gr||(Gr={})),d.extendClassProps(Gr.prototype,Gr.createDefaultProps);class LR extends V.Destroyable{constructor(n,e){super(),this._czmPolygonFlattenedPlane=n,this._czmFlattenedPlane=e;{const{polygonCanvas:i}=this._czmPolygonFlattenedPlane,o=6378137,r=C.Math.toRadians,s=()=>{const{canvasGeoInfo:a}=i;if(!a)return;const{rect:l,height:u}=a,h=[(l[0]+l[2])/2,(l[1]+l[3])/2,u],c=r(l[2]-l[0])*o*Math.cos(r(h[1])),A=r(l[3]-l[1])*o;this._czmFlattenedPlane.position=h,this._czmFlattenedPlane.minSize=[-c*.5,-A*.5],this._czmFlattenedPlane.maxSize=[c*.5,A*.5]};s(),this.dispose(i.canvasGeoInfoChanged.disposableOn(s))}this._czmFlattenedPlane.czmTextureWithId.id=this._czmPolygonFlattenedPlane.czmTexture.id,this.dispose(()=>this._czmFlattenedPlane.czmTextureWithId.id=void 0);{const i=this._czmFlattenedPlane.showHelper;this._czmFlattenedPlane.showHelper=!1,this.dispose(()=>this._czmFlattenedPlane.showHelper=i)}this.dispose(d.track([this._czmFlattenedPlane,"enabled"],[this._czmPolygonFlattenedPlane,"enabled"]))}}class Il extends V.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_czmTexture");L(this,"_polygon");L(this,"_polygonCanvas");L(this,"_czmFlattenedPlaneWithId");L(this,"_czmFlattendPlaneWithIdResetting");i&&(this._id.value=i);{this._czmTexture=this.disposeVar(new ht(e,i)),this._polygon=this.disposeVar(new V.ESGeoPolygon(`${i}_polygon`)),e.add(this._polygon),this.ad(()=>{e.delete(this._polygon)}),this.dispose(d.track([this._polygon,"allowPicking"],[this,"allowPicking"])),this.dispose(d.track([this._polygon,"points"],[this,"positions"])),this.dispose(d.track([this._polygon,"show"],[this,"show"])),this._polygonCanvas=this.disposeVar(new Mo(e,i)),this._polygonCanvas.geoPolygonWithId.sceneObject=this._polygon;const o=()=>{this._czmTexture.copyFromCanvas(this._polygonCanvas.canvas)};o(),this.dispose(this._polygonCanvas.canvasChanged.disposableOn(o)),this.dispose(this._czmTexture.readyEvent.disposableOn(o)),this._czmFlattenedPlaneWithId=this.disposeVar(new V.ESSceneObjectWithId),this.dispose(d.track([this._czmFlattenedPlaneWithId,"id"],[this,"czmFlattenedPlaneId"])),this._czmFlattendPlaneWithIdResetting=this.disposeVar(new d.ObjResettingWithEvent(this.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:r}=this.czmFlattenedPlaneWithId;if(!r)return;let s;V.registerCreatedEventUpdate(this,r,()=>{const a=e.getEngineObject(r);if(r instanceof V.ES3DTileset&&(s=a.flattenedPlane),s instanceof Gr)return new LR(this,s)})}))}this.dispose(this._flyToEvent.disposableOn(o=>{this._polygon.flyTo(o)}))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmTexture(){return this._czmTexture}get polygon(){return this._polygon}get polygonCanvas(){return this._polygonCanvas}get czmFlattenedPlaneWithId(){return this._czmFlattenedPlaneWithId}get czmFlattendPlaneWithIdResetting(){return this._czmFlattendPlaneWithIdResetting}}(t=>{t.createDefaultProps=()=>({enabled:!0,show:!0,positions:d.reactPositions([]),allowPicking:!1,czmFlattenedPlaneId:""})})(Il||(Il={})),d.extendClassProps(Il.prototype,Il.createDefaultProps);class xi extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));if(!e.viewer)return;const r=this.ad(new da(e,i)),s=this.ad(new Ye(e,i));s.loop=!0,this.ad(d.bind([s,"depthTest"],[this,"depthTest"])),this.dispose(d.track([r,"allowPicking"],[this,"allowPicking"]));{const u=()=>{r.ground=this.ground,s.ground=this.strokeGround,s.arcType=this.strokeGround?"NONE":"GEODESIC"};u();const h=this.ad(d.createNextAnimateFrameEvent(this.groundChanged,this.strokeGroundChanged));this.ad(h.don(u))}const a=()=>{s.show=this.show&&this.outline,r.show=this.show&&this.fill,s.positions=this.positions,r.polygonHierarchy=r.show?{positions:this.positions||[]}:{positions:[]},s.color=this.outlineColor,s.width=this.outlineWidth,r.material={type:"Color",color:this.color||[1,1,1,.5]}};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.outlineColorChanged,this.outlineWidthChanged,this.fillChanged,this.colorChanged,this.positionsChanged));this.dispose(l.disposableOn(a)),this.dispose(this.flyToEvent.disposableOn(u=>{this.viewDistanceRange||(r.flyTo(u),this.fill||s.flyTo(u))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}L(xi,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4],positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,outline:!0,strokeGround:!1,ground:!1,outlineColor:d.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:d.reactArray([1,1,1,.5]),positions:d.reactPositions(void 0),viewDistanceRange:d.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(xi||(xi={})),d.extendClassProps(xi.prototype,xi.createDefaultProps);const nu=class nu extends en{constructor(e,i){super(e,i);L(this,"_geoPolygon");if(!i.viewer){console.warn("viewer is undefined!");return}this._geoPolygon=this.ad(new xi(i,e.id));const r=this.geoPolygon;r&&(this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(d.track([r,"ground"],[e,"fillGround"])),this.dispose(d.track([r,"outline"],[e,"stroked"])),this.dispose(d.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(d.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(d.track([r,"fill"],[e,"filled"])),this.dispose(d.track([r,"color"],[e,"fillColor"])))}get geoPolygon(){return this._geoPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s!=null&&s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):s!=null&&s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(nu,"type",nu.register("ESCesiumViewer",V.ESGeoPolygon.type,nu));let kn=nu,zR=class extends d.Destroyable{constructor(n,e){super(),this._czmESPolygonFlattenedPlane=n,this._eS3DTileset=e,this._eS3DTileset.flattenedPlaneEnabled=!0,this._czmESPolygonFlattenedPlane.polygonFlattenedPlane.czmFlattenedPlaneId=this._eS3DTileset.flattenedPlaneId,this.dispose(()=>this._eS3DTileset.flattenedPlaneEnabled=!1)}};const iu=class iu extends kn{constructor(e,i){super(e,i);L(this,"_polygonFlattenedPlane");L(this,"_tilesSceneObjectWithId");this._polygonFlattenedPlane=this.disposeVar(new Il(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=V.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),!i.viewer){console.warn("viewer is undefined!");return}const s=this._polygonFlattenedPlane;s.enabled=!0,this.dispose(d.track([s,"show"],[e,"show"])),this.dispose(d.bind([s,"positions"],[e,"points"])),this.dispose(d.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([s,"czmFlattenedPlaneId"],[e,"czmFlattenedPlaneId"])),this.dispose(d.track([s.polygon,"stroked"],[e,"stroked"])),this.dispose(d.track([s.polygon,"strokeColor"],[e,"strokeColor"])),this.dispose(d.track([s.polygon,"strokeWidth"],[e,"strokeWidth"])),this.dispose(d.track([s.polygon,"filled"],[e,"filled"])),this.dispose(d.track([s.polygon,"fillColor"],[e,"fillColor"])),this.dispose(d.track([s.polygon,"strokeGround"],[e,"strokeGround"])),this.dispose(d.track([s.polygon,"fillGround"],[e,"fillGround"]));const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof V.ES3DTileset&&this.sceneObject.show)return new zR(this,l)}))}get polygonFlattenedPlane(){return this._polygonFlattenedPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,polygonFlattenedPlane:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(iu,"type",iu.register("ESCesiumViewer",V.ESPolygonFlattenedPlane.type,iu));let fm=iu;function QR(t,n,e){const i=t,o=n,r=(o[0]-i[0]+(o[1]-i[1]))/4,s=[[i[0],0,i[1]],[o[0],0,i[1]],[o[0],0,o[1]],[i[0],0,o[1]],[0,r,0]],a=C.Math.toDegrees,l=s.map(h=>{const c=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...h),new C.Cartesian3),A=C.Cartographic.fromCartesian(c);return[a(A.longitude),a(A.latitude),A.height]});return[[[l[0],l[1],l[2],l[3],l[0]]],l[4]]}class Do extends d.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_polylines");L(this,"_axis");i&&(this.id=i),this._polylines=this.disposeVar(new Tn(e,i)),this._axis=this.disposeVar(new Ye(e,i)),this._axis.hasArrow=!0,this._axis.width=10,this._polylines.arcType=this._axis.arcType="NONE",this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof tt)||!e.actived)return;if(!this.position){console.warn("CzmPlane warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{let s=[],a;if(this.position){const l=at({position:this.position,rotation:this.rotation});if(l){const u=QR(this.minSize,this.maxSize,l);s=u[0],a=u[1]}}this.polylines.positions=s,!(!this.position||!a)&&(this.axis.positions=[this.position,a])};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(d.track([this.polylines,"color"],[this,"color"])),this.dispose(d.track([this.polylines,"width"],[this,"width"])),this.dispose(d.track([this.polylines,"show"],[this,"show"])),this.dispose(d.track([this.axis,"color"],[this,"color"]));{const o=()=>{this.axis.show=this.show&&this.showArrow};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.showArrowChanged.disposableOn(o))}}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylines(){return this._polylines}get axis(){return this._axis}}L(Do,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,showArrow:!0,position:d.reactArrayWithUndefined(void 0),rotation:d.reactArray([0,0,0]),color:d.reactArray([1,1,1,1]),width:2,minSize:d.reactArray([-100,-100]),maxSize:d.reactArray([100,100])})})(Do||(Do={})),d.extendClassProps(Do.prototype,Do.createDefaultProps);class VR extends V.Destroyable{constructor(e,i,o){super();L(this,"_centerMatrix",this.disposeVar(d.react(void 0)));L(this,"_inverseCenterMatrix",this.disposeVar(d.react(void 0)));L(this,"_czmPlaneWrappers");L(this,"_czmPlaneWrappersChanged",this.disposeVar(d.createNextAnimateFrameEvent()));L(this,"_computedPlanesChanged",this.disposeVar(d.createNextAnimateFrameEvent()));this._czmClippingPlanes=i,this._planeIds=o,this._czmPlaneWrappers=this._planeIds.map(r=>this.disposeVar(new HR(e,this,r)));{const r=()=>{let s,a;const l=this._czmPlaneWrappers.filter(u=>u.position&&u.rotation);if(l.length!==0){const u=l.map(c=>c.position),h=V.getMinMaxCorner(u);s=at({position:h.center}),s&&(a=C.Matrix4.inverseTransformation(s,new C.Matrix4))}this.centerMatrix=s,this.inverseCenterMatrix=a};r(),this.dispose(this.czmPlaneWrappersChanged.disposableOn(r))}{const r=()=>{if(!this.centerMatrix){this._czmClippingPlanes.computedClippingPlanes=void 0;return}const a=C.Matrix4.toArray(this.centerMatrix),l=this._czmPlaneWrappers.filter(u=>!!u.computedPlane).map(u=>u.computedPlane);this._czmClippingPlanes.computedClippingPlanes={planes:l,enabled:this._czmClippingPlanes.enabled,modelMatrix:a,unionClippingRegions:this._czmClippingPlanes.unionClippingRegions,edgeColor:this._czmClippingPlanes.edgeColor,edgeWidth:this._czmClippingPlanes.edgeWidth}};r();const s=this.disposeVar(d.createNextAnimateFrameEvent(this._czmClippingPlanes.enabledChanged,this.centerMatrixChanged,this.inverseCenterMatrixChanged,this.computedPlanesChanged,this._czmClippingPlanes.unionClippingRegionsChanged,this._czmClippingPlanes.edgeColorChanged,this._czmClippingPlanes.edgeWidthChanged));this.dispose(s.disposableOn(r))}}get centerMatrix(){return this._centerMatrix.value}set centerMatrix(e){this._centerMatrix.value=e}get centerMatrixChanged(){return this._centerMatrix.changed}get inverseCenterMatrix(){return this._inverseCenterMatrix.value}set inverseCenterMatrix(e){this._inverseCenterMatrix.value=e}get inverseCenterMatrixChanged(){return this._inverseCenterMatrix.changed}get czmPlaneWrappers(){return this._czmPlaneWrappers}get czmPlaneWrappersChanged(){return this._czmPlaneWrappersChanged}get computedPlanesChanged(){return this._computedPlanesChanged}get czmClippingPlanes(){return this._czmClippingPlanes}}class NR extends V.Destroyable{constructor(n,e){super(),this._czmPlaneWrapper=n,this._czmPlane=e,this._czmPlaneWrapper.position=this._czmPlane.position,this.dispose(()=>this._czmPlaneWrapper.position=void 0),this.dispose(d.track([this._czmPlaneWrapper,"position"],[this._czmPlane,"position"])),this._czmPlaneWrapper.rotation=this._czmPlane.rotation,this.dispose(()=>this._czmPlaneWrapper.rotation=[0,0,0]),this.dispose(d.track([this._czmPlaneWrapper,"rotation"],[this._czmPlane,"rotation"]))}}class HR extends V.Destroyable{constructor(e,i,o){super();L(this,"_sowi");L(this,"_position",this.disposeVar(d.reactArrayWithUndefined(void 0)));L(this,"_rotation",this.disposeVar(d.reactArray([0,0,0])));L(this,"_computedPlane",this.disposeVar(d.reactJson(void 0)));this._planesResetting=i,this._planeId=o,this._sowi=this.disposeVar(new V.ESSceneObjectWithId),this._sowi.id=this._planeId,this.disposeVar(new d.ObjResettingWithEvent(this.sowi.sceneObjectChanged,()=>{const{sceneObject:r}=this.sowi;if(!r)return;let s;V.registerCreatedEventUpdate(this,r,()=>{const a=e.getEngineObject(r);if(r instanceof V.ESClippingPlane&&(s=a.czmPlane),!!s&&s instanceof Do)return new NR(this,s)})})),this.dispose(this.positionChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next())),this.dispose(this.rotationChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next()));{const r=()=>{const{inverseCenterMatrix:a}=this._planesResetting;if(!a)return this.computedPlane=void 0;const{position:l,rotation:u}=this;if(!l)return this.computedPlane=void 0;const h=at({position:l,rotation:u});if(!h)return this.computedPlane=void 0;const A=C.Matrix4.multiply(a,h,new C.Matrix4),p=new C.Cartesian3(A[4],A[5],A[6]),f=new C.Cartesian3(A[12],A[13],A[14]);C.Cartesian3.normalize(p,p);let g=-C.Cartesian3.dot(p,f);const v=[p.x,p.y,p.z];this._planesResetting.czmClippingPlanes.reverseNormal&&(d.Vector.negate(v,v),g=-g),this.computedPlane={normal:v,distance:g}};r();const s=this.disposeVar(d.createNextAnimateFrameEvent(this._planesResetting.inverseCenterMatrixChanged,this.positionChanged,this.rotationChanged,this._planesResetting.czmClippingPlanes.reverseNormalChanged));this.dispose(s.disposableOn(r))}this.dispose(this.computedPlaneChanged.disposableOn(()=>this._planesResetting.computedPlanesChanged.next()))}get sowi(){return this._sowi}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get rotation(){return this._rotation.value}set rotation(e){this._rotation.value=e}get rotationChanged(){return this._rotation.changed}get computedPlane(){return this._computedPlane.value}set computedPlane(e){this._computedPlane.value=e}get computedPlaneChanged(){return this._computedPlane.changed}}class Ya extends V.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_computedClippingPlanes",this.disposeVar(d.react(void 0)));i&&(this.id=i),this.disposeVar(new d.ObjResettingWithEvent(this.planeIdsChanged,()=>new VR(e,this,this.planeIds)))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,planeIds:d.reactArray([]),reverseNormal:!1,unionClippingRegions:!0,edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2})})(Ya||(Ya={})),d.extendClassProps(Ya.prototype,Ya.createDefaultProps);let GR=class extends d.Destroyable{constructor(n,e){super(),this._czmESClippingPlane=n,this._eS3DTileset=e;const o=[this._czmESClippingPlane.czmPlane.id,...this._eS3DTileset.clippingPlaneIds];this._eS3DTileset.clippingPlaneIds=o,this.dispose(()=>{const r=[...this._eS3DTileset.clippingPlaneIds],s=this._czmESClippingPlane.czmPlane.id;r.includes(s)&&(r.splice(r.indexOf(s),1),this._eS3DTileset.clippingPlaneIds=r)})}},WR=class extends d.Destroyable{constructor(n){if(super(),this._czmESClippingPlane=n,!this._czmESClippingPlane.viewer)return;this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId=this._czmESClippingPlane.czmPlane.id;const e=()=>{if(!this._czmESClippingPlane.viewer)return;const o=at({position:this._czmESClippingPlane.sceneObject.position});if(!o)return;const r=f0(this._czmESClippingPlane.sceneObject.rotation);this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes={planes:[{normal:r,distance:0}],enabled:!0,modelMatrix:C.Matrix4.toArray(o),unionClippingRegions:!1,edgeColor:this._czmESClippingPlane.sceneObject.edgeColor,edgeWidth:this._czmESClippingPlane.sceneObject.edgetWidth}};e();const i=this.dv(d.createNextAnimateFrameEvent(this._czmESClippingPlane.sceneObject.positionChanged,this._czmESClippingPlane.sceneObject.rotationChanged,this._czmESClippingPlane.sceneObject.edgeColorChanged,this._czmESClippingPlane.sceneObject.edgetWidthChanged));this.d(i.don(e)),this.dispose(()=>{this._czmESClippingPlane.viewer&&(this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId="",this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes=void 0)})}};const ru=class ru extends Ge{constructor(e,i){super(e,i);L(this,"_innerPositionReact",this.disposeVar(d.reactArrayWithUndefined(void 0)));L(this,"_czmPlane");L(this,"_tilesSceneObjectWithId");this._czmPlane=this.disposeVar(new Do(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=V.ESSceneObject.getSceneObject(e.targetID);o.value=a?(a.components.main??a).id:""})),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),!i.viewer)return;const s=this._czmPlane;V.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmPlane.showChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(!(!this.sceneObject.show||!this.czmPlane.show))return u===""?new WR(this):!l||!(l instanceof V.ES3DTileset)?void 0:new GR(this,l)}))}),this.dispose(d.track([s,"show"],[e,"show"])),this.dispose(d.bind([s,"position"],[e,"position"])),this.dispose(Bt([s,"rotation"],[e,"rotation"])),this.dispose(d.track([s,"showArrow"],[e,"showArrow"])),this.dispose(d.track([s,"color"],[e,"edgeColor"])),this.dispose(d.track([s,"width"],[e,"edgetWidth"]));{const a=()=>{s.minSize=[-e.width/2,-e.height/2],s.maxSize=[e.width/2,e.height/2]};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(e.widthChanged,e.heightChanged));this.dispose(l.disposableOn(a))}{const a=()=>{d.Vector.equals(e.position,[0,0,0])?this._innerPositionReact.value=void 0:this._innerPositionReact.value=e.position};a(),this.dispose(this.sceneObject.positionChanged.disposableOn(a))}{const a=()=>{this._innerPositionReact.value==null?e.position=[0,0,0]:e.position=this._innerPositionReact.value};this.dispose(this._innerPositionReact.changed.disposableOn(a))}}get czmPlane(){return this._czmPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Ln(r,o,i,o.position,Math.max(o.width,o.height),e,!0),!0):!1:!1}};L(ru,"type",ru.register("ESCesiumViewer",V.ESClippingPlane.type,ru));let dm=ru;const qR=(t,n)=>C.Color.fromBytes(t[0]*255,t[1]*255,t[2]*255,t[3]*255,n),KR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case"contain":n&&n.includes(e.value)&&(i=!0);break;case"empty":(n===""||n===null||n===void 0||!n)&&(i=!0);break;default:i=!1;break}return i},ZR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case">":n>e.value&&(i=!0);break;case">=":n>=e.value&&(i=!0);break;case"<":n<e.value&&(i=!0);break;case"<=":n<=e.value&&(i=!0);break;default:i=!1;break}return i},XR=(t,n)=>{const e=[];for(let i of t.condition){if(typeof i=="boolean"){e.push(i);continue}const r=typeof i.value=="string",s=typeof i.value=="number";if(!r&&!s){e.push(!1);continue}const a=i.field;let l;if(a.includes("."))try{const u=a.split(".");l=JSON.parse(n.getProperty(u[0]));for(let h of u.slice(1))if(l=l==null?void 0:l[h],l===void 0)throw new Error(`${l}上不存在属性${h},将使用默认颜色!`)}catch{e.push(!1);continue}else l=n.getProperty(a);if(r){e.push(KR(i,l));continue}else if(s){e.push(ZR(i,l));continue}else{e.push(!1);continue}}return e},$R=(t,n)=>{const e=[];for(let i of t.condition){if(typeof i=="boolean"){e.push(i);continue}const r=typeof i.value=="string",s=typeof i.value=="number";if(!r&&!s){e.push(!1);continue}const a=i.field;let l;if(a.includes("."))try{const u=a.split(".");l=JSON.parse(n.getProperty(u[0]));for(let h of u.slice(1))if(l=l==null?void 0:l[h],l===void 0)throw new Error(`${l}上不存在属性${h},将使用默认颜色!`)}catch{e.push(!1);continue}else l=n.getProperty(a);if(r){e.push(YR(i,l));continue}else if(s){e.push(JR(i,l));continue}else{e.push(!1);continue}}return e},YR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case"contain":n.includes(e.value)&&(i=!0);break;case"empty":(n===""||n===null||n===void 0||!n)&&(i=!0);break;default:i=!1;break}return i},JR=(t,n)=>{const e=t;let i=!1;switch(e.op){case"==":n===e.value&&(i=!0);break;case"!=":n!==e.value&&(i=!0);break;case">":n>e.value&&(i=!0);break;case">=":n>=e.value&&(i=!0);break;case"<":n<e.value&&(i=!0);break;case"<=":n<=e.value&&(i=!0);break;default:i=!1;break}return i};class jR extends d.Destroyable{constructor(){super();L(this,"strokeSilhouette",C.PostProcessStageLibrary.createEdgeDetectionStage());L(this,"_viewer",this.disposeVar(d.react(void 0)));L(this,"_featureMap",new Map);const e=()=>{this.viewer&&(this.viewer.scene.postProcessStages.add(C.PostProcessStageLibrary.createSilhouetteStage([this.strokeSilhouette])),this.strokeSilhouette.uniforms.length=.01,this.strokeSilhouette.uniforms.color=C.Color.RED,this.strokeSilhouette.selected=[],this.ad(()=>{this.viewer&&this.viewer.scene.postProcessStages.remove(this.strokeSilhouette)}))};e(),this.ad(this.viewerChanged.don(e))}get viewer(){return this._viewer.value}set viewer(e){this.viewer instanceof C.Viewer||(this._viewer.value=e)}get viewerChanged(){return this._viewer.changed}get selected(){return[...this._featureMap.values()].flat()}setStrokeLength(e){this.strokeSilhouette.uniforms.length=e??.01}setStrokeColor(e){this.strokeSilhouette.uniforms.color=C.Color.fromBytes(e[0]*255,e[1]*255,e[2]*255,e[3]*255)}setStrokeSelect(e,i,o=!1){if(!this._featureMap.has(e))return;let r=this._featureMap.get(e);o&&(r==null||r.push(...i)),r=i,this._featureMap.set(e,r),this.strokeSilhouette.selected=this.selected}register(e){this.viewer=e.viewer.viewer,!this._featureMap.has(e)&&this._featureMap.set(e,[])}unregister(e){this._featureMap.has(e)&&(this._featureMap.delete(e),this.strokeSilhouette.selected=this.selected)}}let zb=[1,1,1];class e5 extends d.Destroyable{constructor(e,i){super();L(this,"_customShader");const o=new C.CustomShader({uniforms:{u_baseColor:{type:C.UniformType.VEC3,value:C.Cartesian3.fromArray(zb)}},fragmentShaderText:`
|
|
2398
2398
|
// Color tiles by distance to the camera
|
|
2399
2399
|
void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
|
|
2400
2400
|
{
|
|
@@ -2453,7 +2453,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
2453
2453
|
function (particle, dt) {
|
|
2454
2454
|
particle.velocity = Cesium.Cartesian3.ZERO;
|
|
2455
2455
|
}
|
|
2456
|
-
`;const s={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},a=Object.keys(s);for(const l of a)r[l]=s[l]}{const s=()=>{r.startScale=1*(e.scale[0]>0?e.scale[0]:1),r.endScale=10*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.d(d.track([r,"show"],[e,"show"])),this.d(d.bind([r,"position"],[e,"position"])),this.d(d.track([r,"translation"],[e,"translation"])),this.d(Bt([r,"rotation"],[e,"rotation"])),this.d(d.track([r,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBlastParticeSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,On,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(lu,"type",lu.register("ESCesiumViewer",V.ESBlastParticleSystem.type,lu));let ym=lu;function s5(t,n,e){const i=t,o=n,r=[[i[0],i[1],i[2]],[o[0],i[1],i[2]],[o[0],o[1],i[2]],[i[0],o[1],i[2]],[i[0],i[1],o[2]],[o[0],i[1],o[2]],[o[0],o[1],o[2]],[i[0],o[1],o[2]]],s=C.Math.toDegrees,a=r.map(u=>{const h=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...u),new C.Cartesian3),c=C.Cartographic.fromCartesian(h);return[s(c.longitude),s(c.latitude),c.height]});return[[a[0],a[1],a[2],a[3],a[0]],[a[4],a[5],a[6],a[7],a[4]],[a[0],a[4]],[a[1],a[5]],[a[2],a[6]],[a[3],a[7]]]}class es extends d.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_computedClippingPlanes",this.disposeVar(d.react(void 0)));L(this,"_polylines");i&&(this.id=i),this._polylines=this.disposeVar(new Tn(e,i)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof tt)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{e instanceof tt&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&i||"")};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(r.disposableOn(o)),this.ad(()=>{e instanceof tt&&e.sceneGlobeClippingPlanesId===i&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const s=this.minSize,a=this.maxSize,l=[a[0]-s[0],a[1]-s[1],a[2]-s[2]],u=this.reverse?-1:1,h=[...this.modelMatrix];let c=[];if(this.position){const A=at({position:this.position,rotation:this.rotation});if(A){const p=C.Matrix4.fromArray(this.modelMatrix),f=C.Matrix4.multiply(A,p,new C.Matrix4);C.Matrix4.toArray(f,h),c=s5(this.minSize,this.maxSize,f)}}this.polylines.positions=c,this._computedClippingPlanes.value={planes:[{normal:[-1*u,0,0],distance:(l[0]+s[0])*u},{normal:[1*u,0,0],distance:-s[0]*u},{normal:[0,-1*u,0],distance:(l[1]+s[1])*u},{normal:[0,1*u,0],distance:-s[1]*u},{normal:[0,0,-1*u],distance:(l[2]+s[2])*u},{normal:[0,0,1*u],distance:-s[2]*u}],enabled:this.enabled,modelMatrix:h,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(d.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(d.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(d.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}L(es,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,position:d.reactArrayWithUndefined(void 0),rotation:d.reactArray([0,0,0]),modelMatrix:d.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2,minSize:d.reactArray([-100,-100,-100]),maxSize:d.reactArray([100,100,100])})})(es||(es={})),d.extendClassProps(es.prototype,es.createDefaultProps);let l5=class extends d.Destroyable{constructor(n,e){super(),this._czmESBoxClippingPlanes=n,this._eS3DTileset=e;const i=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=i,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const uu=class uu extends Ge{constructor(e,i){super(e,i);L(this,"_czmBoxClippingPlanes");L(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=V.ESSceneObject.getSceneObject(e.targetID);o.value=a?a.mainClass.id:""})),this._czmBoxClippingPlanes=this.ad(new es(i,e.id)),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),V.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof V.ES3DTileset&&this.sceneObject.show)return new l5(this,l)}))}),!i.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:s}=this;{const a=()=>{s.enabled=e.show,s.showHelper=e.show};a(),this.dispose(e.showChanged.don(a))}{const a=()=>{s.reverse=!e.reverse};a(),this.dispose(e.reverseChanged.don(a))}{const a=()=>{e.targetID?s.applyOnTerrain=!1:s.applyOnTerrain=!0};a(),this.dispose(e.targetIDChanged.don(a))}{const a=()=>{const[l,u,h]=e.size;s.minSize=[-.5*l,-.5*u,-.5*h],s.maxSize=[.5*l,.5*u,.5*h]};a(),this.dispose(e.sizeChanged.don(a))}this.dispose(d.bind([s,"position"],[e,"position"])),this.dispose(d.bind([s,"rotation"],[e,"rotation"])),this.dispose(d.track([s,"edgeColor"],[e,"edgeColor"])),this.dispose(d.track([s,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Ln(r,o,i,o.position,Math.max(...o.size),e,!0),!0):!1}};L(uu,"type",uu.register("ESCesiumViewer",V.ESBoxClipping.type,uu));let vm=uu;const cu=class cu extends Ge{constructor(e,i){super(e,i);L(this,"_view");if(this._view=this.disposeVar(new pn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{view:r}=this;this.dispose(d.bind([r,"position"],[e,"position"])),this.dispose(d.bind([r,"rotation"],[e,"rotation"])),this.dispose(d.bind([r,"thumbnail"],[e,"thumbnail"])),this.dispose(d.bind([r,"duration"],[e,"duration"])),r.show=!1,this.dispose(e.flyInEvent.disposableOn((s,a,l="default")=>{r.flyTo(e.duration??s??1)})),!r.position&&!r.rotation&&r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((s,a)=>{r.capture(s??64,a??64)}))}get view(){return this._view}flyTo(e,i){const{sceneObject:o,czmViewer:r,view:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(cu,"type",cu.register("ESCesiumViewer",V.ESCameraView.type,cu));let wm=cu;const hu=class hu extends Ge{constructor(e,i){super(e,i);L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new st(i,e.id)),this._czmTexture=this.dv(new ht(i,e.id));const r=this._czmESCustomPrimitive,s=this._czmTexture;this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.track([r,"rotation"],[e,"rotation"])),this.dispose(d.track([r,"position"],[e,"position"])),this.dispose(d.track([r,"scale"],[e,"scale"]));{const a=()=>{const u=e.far*Math.tan(Math.PI*(e.fov/360))*2,h=u/e.aspectRatio,c=e.far,A=e.near*Math.tan(Math.PI*(e.fov/360))*2,p=A/e.aspectRatio,f=e.near,g=[f,-A/2,-p/2],v=[f,-A/2,p/2],y=[f,A/2,p/2],m=[f,A/2,-p/2],_=[c,-u/2,-h/2],b=[c,-u/2,h/2],E=[c,u/2,h/2],T=[c,u/2,-h/2],P=[...g,...v,...y,...m,..._,...b,...E,...T],k=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],D=[...k,...k.reverse()],B=[1,0],S=[1,1],I=[1,0],w=[1,1],x=[0,0],U=[0,1],F=[0,0],M=[0,1],R=[...B,...S,...I,...w,...x,...U,...F,...M];r.indexTypedArray=new Uint16Array(D),r.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},s.uri=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),r.uniformMap={u_image:{type:"texture",id:s.id},u_color:[1,1,1,1]};const O=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:z,max:Q}=O;r.setLocalAxisedBoundingBox(z,Q)};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(l.disposableOn(()=>a()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i),!0;{const s=Math.max(o.far,o.near)??V.ESCameraVisibleRange.defaults.far;return o.position?(Ln(r,o,i,o.position,s,e),!0):!1}}};L(hu,"type",hu.register("ESCesiumViewer",V.ESCameraVisibleRange.type,hu));let _m=hu;const Au=class Au extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Qt(i,e.id));const r=this._czmModelPrimitive;this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.bind([r,"position"],[e,"position"])),this.dispose(Bt([r,"rotation"],[e,"rotation"])),this.dispose(d.bind([r,"scale"],[e,"scale"]));{const l=this.dv(d.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};u(),this.d(l.don(u))}const s=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),a=()=>{switch(e.mode){case"policeCar":r.url=s;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>a())),a()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s):!1}};L(Au,"type",Au.register("ESCesiumViewer",V.ESCar.type,Au));let bm=Au;const Cm={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},fu=class fu extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_circleCustomPrimitive");L(this,"_cylinderCustomPrimitive");L(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new st(e,i));const{circleCustomPrimitive:o}=this;D0(o,{width:120,height:120}),o.fragmentShaderSource=`
|
|
2456
|
+
`;const s={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},a=Object.keys(s);for(const l of a)r[l]=s[l]}{const s=()=>{r.startScale=1*(e.scale[0]>0?e.scale[0]:1),r.endScale=10*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.d(d.track([r,"show"],[e,"show"])),this.d(d.bind([r,"position"],[e,"position"])),this.d(d.track([r,"translation"],[e,"translation"])),this.d(Bt([r,"rotation"],[e,"rotation"])),this.d(d.track([r,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBlastParticeSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,On,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(lu,"type",lu.register("ESCesiumViewer",V.ESBlastParticleSystem.type,lu));let ym=lu;function s5(t,n,e){const i=t,o=n,r=[[i[0],i[1],i[2]],[o[0],i[1],i[2]],[o[0],o[1],i[2]],[i[0],o[1],i[2]],[i[0],i[1],o[2]],[o[0],i[1],o[2]],[o[0],o[1],o[2]],[i[0],o[1],o[2]]],s=C.Math.toDegrees,a=r.map(u=>{const h=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...u),new C.Cartesian3),c=C.Cartographic.fromCartesian(h);return[s(c.longitude),s(c.latitude),c.height]});return[[a[0],a[1],a[2],a[3],a[0]],[a[4],a[5],a[6],a[7],a[4]],[a[0],a[4]],[a[1],a[5]],[a[2],a[6]],[a[3],a[7]]]}class es extends d.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(d.react(d.createGuid())));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_computedClippingPlanes",this.disposeVar(d.react(void 0)));L(this,"_polylines");i&&(this.id=i),this._polylines=this.disposeVar(new Tn(e,i)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof tt)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{e instanceof tt&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&i||"")};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(r.disposableOn(o)),this.ad(()=>{e instanceof tt&&e.sceneGlobeClippingPlanesId===i&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const s=this.minSize,a=this.maxSize,l=[a[0]-s[0],a[1]-s[1],a[2]-s[2]],u=this.reverse?-1:1,h=[...this.modelMatrix];let c=[];if(this.position){const A=at({position:this.position,rotation:this.rotation});if(A){const p=C.Matrix4.fromArray(this.modelMatrix),f=C.Matrix4.multiply(A,p,new C.Matrix4);C.Matrix4.toArray(f,h),c=s5(this.minSize,this.maxSize,f)}}this.polylines.positions=c,this._computedClippingPlanes.value={planes:[{normal:[-1*u,0,0],distance:(l[0]+s[0])*u},{normal:[1*u,0,0],distance:-s[0]*u},{normal:[0,-1*u,0],distance:(l[1]+s[1])*u},{normal:[0,1*u,0],distance:-s[1]*u},{normal:[0,0,-1*u],distance:(l[2]+s[2])*u},{normal:[0,0,1*u],distance:-s[2]*u}],enabled:this.enabled,modelMatrix:h,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(d.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(d.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(d.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}L(es,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,position:d.reactArrayWithUndefined(void 0),rotation:d.reactArray([0,0,0]),modelMatrix:d.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2,minSize:d.reactArray([-100,-100,-100]),maxSize:d.reactArray([100,100,100])})})(es||(es={})),d.extendClassProps(es.prototype,es.createDefaultProps);let l5=class extends d.Destroyable{constructor(n,e){super(),this._czmESBoxClippingPlanes=n,this._eS3DTileset=e;const i=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=i,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const uu=class uu extends Ge{constructor(e,i){super(e,i);L(this,"_czmBoxClippingPlanes");L(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=V.ESSceneObject.getSceneObject(e.targetID);o.value=a?(a.components.main??a).id:""})),this._czmBoxClippingPlanes=this.ad(new es(i,e.id)),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),V.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof V.ES3DTileset&&this.sceneObject.show)return new l5(this,l)}))}),!i.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:s}=this;{const a=()=>{s.enabled=e.show,s.showHelper=e.show};a(),this.dispose(e.showChanged.don(a))}{const a=()=>{s.reverse=!e.reverse};a(),this.dispose(e.reverseChanged.don(a))}{const a=()=>{e.targetID?s.applyOnTerrain=!1:s.applyOnTerrain=!0};a(),this.dispose(e.targetIDChanged.don(a))}{const a=()=>{const[l,u,h]=e.size;s.minSize=[-.5*l,-.5*u,-.5*h],s.maxSize=[.5*l,.5*u,.5*h]};a(),this.dispose(e.sizeChanged.don(a))}this.dispose(d.bind([s,"position"],[e,"position"])),this.dispose(d.bind([s,"rotation"],[e,"rotation"])),this.dispose(d.track([s,"edgeColor"],[e,"edgeColor"])),this.dispose(d.track([s,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Ln(r,o,i,o.position,Math.max(...o.size),e,!0),!0):!1}};L(uu,"type",uu.register("ESCesiumViewer",V.ESBoxClipping.type,uu));let vm=uu;const cu=class cu extends Ge{constructor(e,i){super(e,i);L(this,"_view");if(this._view=this.disposeVar(new pn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{view:r}=this;this.dispose(d.bind([r,"position"],[e,"position"])),this.dispose(d.bind([r,"rotation"],[e,"rotation"])),this.dispose(d.bind([r,"thumbnail"],[e,"thumbnail"])),this.dispose(d.bind([r,"duration"],[e,"duration"])),r.show=!1,this.dispose(e.flyInEvent.disposableOn((s,a,l="default")=>{r.flyTo(e.duration??s??1)})),!r.position&&!r.rotation&&r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((s,a)=>{r.capture(s??64,a??64)}))}get view(){return this._view}flyTo(e,i){const{sceneObject:o,czmViewer:r,view:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(cu,"type",cu.register("ESCesiumViewer",V.ESCameraView.type,cu));let wm=cu;const hu=class hu extends Ge{constructor(e,i){super(e,i);L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new st(i,e.id)),this._czmTexture=this.dv(new ht(i,e.id));const r=this._czmESCustomPrimitive,s=this._czmTexture;this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.track([r,"rotation"],[e,"rotation"])),this.dispose(d.track([r,"position"],[e,"position"])),this.dispose(d.track([r,"scale"],[e,"scale"]));{const a=()=>{const u=e.far*Math.tan(Math.PI*(e.fov/360))*2,h=u/e.aspectRatio,c=e.far,A=e.near*Math.tan(Math.PI*(e.fov/360))*2,p=A/e.aspectRatio,f=e.near,g=[f,-A/2,-p/2],v=[f,-A/2,p/2],y=[f,A/2,p/2],m=[f,A/2,-p/2],_=[c,-u/2,-h/2],b=[c,-u/2,h/2],E=[c,u/2,h/2],T=[c,u/2,-h/2],P=[...g,...v,...y,...m,..._,...b,...E,...T],k=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],D=[...k,...k.reverse()],B=[1,0],S=[1,1],I=[1,0],w=[1,1],x=[0,0],U=[0,1],F=[0,0],M=[0,1],R=[...B,...S,...I,...w,...x,...U,...F,...M];r.indexTypedArray=new Uint16Array(D),r.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},s.uri=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),r.uniformMap={u_image:{type:"texture",id:s.id},u_color:[1,1,1,1]};const O=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:z,max:Q}=O;r.setLocalAxisedBoundingBox(z,Q)};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(l.disposableOn(()=>a()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i),!0;{const s=Math.max(o.far,o.near)??V.ESCameraVisibleRange.defaults.far;return o.position?(Ln(r,o,i,o.position,s,e),!0):!1}}};L(hu,"type",hu.register("ESCesiumViewer",V.ESCameraVisibleRange.type,hu));let _m=hu;const Au=class Au extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Qt(i,e.id));const r=this._czmModelPrimitive;this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.bind([r,"position"],[e,"position"])),this.dispose(Bt([r,"rotation"],[e,"rotation"])),this.dispose(d.bind([r,"scale"],[e,"scale"]));{const l=this.dv(d.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};u(),this.d(l.don(u))}const s=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),a=()=>{switch(e.mode){case"policeCar":r.url=s;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>a())),a()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s):!1}};L(Au,"type",Au.register("ESCesiumViewer",V.ESCar.type,Au));let bm=Au;const Cm={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},fu=class fu extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_circleCustomPrimitive");L(this,"_cylinderCustomPrimitive");L(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new st(e,i));const{circleCustomPrimitive:o}=this;D0(o,{width:120,height:120}),o.fragmentShaderSource=`
|
|
2457
2457
|
in vec2 v_st;
|
|
2458
2458
|
uniform vec4 u_color;
|
|
2459
2459
|
void main()
|
|
@@ -2590,7 +2590,7 @@ ${Nb}
|
|
|
2590
2590
|
// out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
|
|
2591
2591
|
out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
|
|
2592
2592
|
}
|
|
2593
|
-
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let a=this.disposeVar(d.react(void 0));{const l=this.disposeVar(d.createProcessingFromAsyncFunc(async h=>{a.value=void 0;const c=e.url??V.ESDataMesh.defaults.url;if(!c)return;await h.promise(d.sleep(200));const A=(e.maxTime??23)|0;a.value=await h.promise(d5(V.ESSceneObject.context.getStrFromEnv(typeof c=="string"?c:c.url),A+1))}));l.start();const u=this.disposeVar(d.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(c){this._buffer=c}[Symbol.iterator](){return p5(this._buffer)}}const u=()=>{if(!a.value)return;const{vertexBuffer:h,propBuffers:c,indexBuffer:A}=a.value,{minPos:p,maxPos:f}=V.getMinMaxCorner(new l(h));r.setLocalAxisedBoundingBox(p,f);const g=(e.maxTime??23)|0;let v=(e.currentTime??V.ESDataMesh.defaults.currentTime)/g;v=v<0?0:v>1?1:v;const y=v*g;let m=v*g|0,_=y-m;if(m>=g&&(m=g-1,_=1),!Number.isFinite(_)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=A,!c[m]||!c[m+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:h,componentsPerAttribute:3},a_prop:{typedArray:c[m],componentsPerAttribute:3},a_prop2:{typedArray:c[m+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${s.id}`},u_stripMinMaxValue:[e.minPropValue??V.ESDataMesh.defaults.minPropValue,e.maxPropValue??V.ESDataMesh.defaults.maxPropValue],u_ratio:_}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(a.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s,!0),!0):!1}};L(yu,"type",yu.register("ESCesiumViewer",V.ESDataMesh.type,yu));let Pm=yu;const Yo=class Yo extends d.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new d.Event));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_heading",this.disposeVar(d.react(0)));L(this,"_textFunc",this.disposeVar(d.react(void 0)));const o=this;{const a=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=V.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=V.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=V.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?V.clampN180_180(u):V.clamp0_360(u)}};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(a))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(d.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(d.bind([r,"arcType"],[o,"arcType"])),this.dispose(d.bind([r,"color"],[o,"color"])),this.dispose(d.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(d.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(d.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(d.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(d.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(d.bind([r,"positions"],[o,"positions"])),this.dispose(d.bind([r,"show"],[o,"show"])),this.dispose(d.bind([r,"width"],[o,"width"])),this.dispose(d.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(d.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(a=>{e.actived&&r.flyTo(a)}));const s=this.disposeVar(new vt(e,i));this.dispose(d.bind([s,"shadowDom"],[o,"shadowDom"])),this.dispose(d.bind([s,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(d.bind([s,"show"],[o,"show"]));{const a=()=>{o.positions&&o.positions.length>=2?s.position=o.positions[1]:s.position=void 0};a(),this.dispose(o.positionsChanged.disposableOn(a))}{const a=()=>{const{heading:u}=o,h=(o.textFunc??Yo.defaultTextFunc_度格式)(u);s.innerHTML=po(`方向: ${h}`,24)};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(a))}this.ad(s.pickedEvent.don(a=>{zi(a)===0&&this.pickedEvent.emit(a)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};L(Yo,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(Yo,"defaultTextFunc_度分格式",e=>`${zs(e,!0)}`),L(Yo,"defaultTextFunc_度分秒格式",e=>`${zs(e,!1)}`),L(Yo,"defaults",{positions:[]});let Lo=Yo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:d.reactPositions(void 0),width:8,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Lo||(Lo={})),d.extendClassProps(Lo.prototype,Lo.createDefaultProps);const vu=class vu extends en{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Lo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const c=h.materialParams;Reflect.has(c,"gapColor")&&(r.gapColor=c.gapColor??[0,0,0,0]),Reflect.has(c,"dashLength")&&(r.dashLength=c.dashLength),Reflect.has(c,"dashPattern")&&(r.dashPattern=c.dashPattern)}catch(c){console.error(c)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(d.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{zi(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(vu,"type",vu.register("ESCesiumViewer",V.ESDirectionMeasurement.type,vu));let Tm=vu;class ns extends d.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new d.Event));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_distances",this.disposeVar(d.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await L0(e.viewer,this.positions??[]):this._distances.value=V.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const s=this.disposeVar(new Ye(e,i));s.loop=!1,this.dispose(d.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(d.bind([s,"arcType"],[this,"arcType"])),this.dispose(d.bind([s,"color"],[this,"color"])),this.dispose(d.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(d.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(d.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(d.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(d.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(d.bind([s,"positions"],[this,"positions"])),this.dispose(d.bind([s,"show"],[this,"show"])),this.dispose(d.bind([s,"width"],[this,"width"])),this.dispose(d.bind([s,"depthTest"],[this,"depthTest"])),this.dispose(d.bind([s,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&s.flyTo(a)}));{const a=[],l=()=>{for(let h of a)h.destroy();a.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const c=rd("起点",this.positions[0],e,i);c.dispose(d.track([c,"show"],[this,"show"])),c.dispose(d.track([c,"shadowDom"],[this,"shadowDom"])),c.dispose(d.track([c,"cssAllInitial"],[this,"cssAllInitial"])),a.push(c)}const h=this.distances.length;for(let c=0;c<h;++c){const A=this.distances[c],p=this.positions[c+1],f=rd(`长度: ${rh(A)}`,p,e,i);f.dispose(d.track([f,"show"],[this,"show"])),f.dispose(d.track([f,"shadowDom"],[this,"shadowDom"])),f.dispose(d.track([f,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(f.pickedEvent.don(g=>{zi(g)===0&&this.pickedEvent.emit(g)})),a.push(f)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>V.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}L(ns,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:d.reactPositions(void 0),width:1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(ns||(ns={})),d.extendClassProps(ns.prototype,ns.createDefaultProps);const wu=class wu extends en{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.track([r,"width"],[e,"strokeWidth"])),this.dispose(d.track([r,"color"],[e,"strokeColor"])),this.dispose(d.track([r,"ground"],[e,"strokeGround"]));{const s=()=>{r.show=e.show&&e.stroked};s();const a=this.disposeVar(d.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(wu,"type",wu.register("ESCesiumViewer",V.ESGeoLineString.type,wu));let is=wu;const _u=class _u extends is{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new ns(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const c=h.materialParams;Reflect.has(c,"gapColor")&&(r.gapColor=c.gapColor??[0,0,0,0]),Reflect.has(c,"dashLength")&&(r.dashLength=c.dashLength),Reflect.has(c,"dashPattern")&&(r.dashPattern=c.dashPattern)}catch(c){console.error(c)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(d.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{zi(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(_u,"type",_u.register("ESCesiumViewer",V.ESDistanceMeasurement.type,_u));let Im=_u;class rs extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_id",this.disposeVar(d.react(d.createGuid())));i&&(this.id=i)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:d.reactPositions(void 0),reverse:!1,edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2})})(rs||(rs={})),d.extendClassProps(rs.prototype,rs.createDefaultProps);class m5 extends d.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];V.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class g5 extends d.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];V.ESSceneObject.getSceneObjById(i)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const bu=class bu extends kn{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new rs(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=V.ESSceneObject.getSceneObject(e.targetID);o.value=a?a.mainClass.id:""})),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const s=this._czmPolygonClipping;s.showHelper=!1,this.dispose(d.bind([s,"positions"],[e,"points"])),this.dispose(d.track([s,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.reverse=e.mode!=="in"};a(),this.dispose(e.modeChanged.disposableOn(a))}V.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new g5(this):!l||!(l instanceof V.ES3DTileset)?void 0:new m5(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(bu,"type",bu.register("ESCesiumViewer",V.ESExcavate.type,bu));let km=bu;const Cu=class Cu extends Ge{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new fi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const s=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.dispose(d.bind([r,"position"],[e,"position"])),this.dispose(d.track([r,"translation"],[e,"translation"])),this.dispose(Bt([r,"rotation"],[e,"rotation"])),this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,On,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Cu,"type",Cu.register("ESCesiumViewer",V.ESFireParticleSystem.type,Cu));let Fm=Cu;class os extends d.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_currentDistance",this.disposeVar(d.react(0)));L(this,"_ratio",this.disposeVar(V.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new V.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new vr(e,i)),this._player=this.disposeVar(new V.Player),this.dispose(d.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(d.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(d.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(d.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(d.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(d.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(d.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(d.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(d.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(d.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(d.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(d.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(d.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(d.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(d.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(d.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(d.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(d.track([this._geoPath,"show"],[this,"show"])),this.dispose(d.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(d.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const s=this.granularity*Math.PI/180,a=qf(this.positions,this.arcType??"GEODESIC",s);if(a){this._geoPath.timePosRots=a.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(d.bind([this._player,"loop"],[this,"loop"])),this.dispose(d.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(d.bind([this._player,"duration"],[this,"duration"])),this.dispose(d.bind([this._player,"playing"],[this,"playing"])),this.dispose(d.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:d.reactPositions(void 0),width:1,ground:!1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(os||(os={})),d.extendClassProps(os.prototype,os.createDefaultProps);class kl extends d.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_currentDistance",this.disposeVar(d.react(0)));this._geoPolylinePath=this.disposeVar(new os(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(d.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(d.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(d.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(d.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(d.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(d.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(d.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(d.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(d.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(d.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(d.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(d.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(d.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(d.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(d.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(d.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(d.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(d.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(d.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(d.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(d.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(d.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const s=od(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=s}else this._geoPolylinePath.positions=void 0}catch(s){console.error(s),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(s=>{this._geoPolylinePath.flyTo(s)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:d.reactPositions(void 0),width:1,ground:!1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(kl||(kl={})),d.extendClassProps(kl.prototype,kl.createDefaultProps);const y5=[["256",256],["512",512],["1024",1024]],v5=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Cn=class Cn extends V.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new d.Event));this.ad(d.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(d.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new V.StringProperty([this,"accessToken"],"令牌",Cn.defaults.accessToken),new V.Number4Property([this,"rectangle"],"矩形范围",Cn.defaults.rectangle),new V.JsonProperty([this,"url"],"服务地址",Cn.defaults.url),new V.JsonProperty([this,"style"],"样式配置",Cn.defaults.style),new V.NumberProperty([this,"zIndex"],"层级序号",Cn.defaults.zIndex),new V.EnumProperty([this,"tileSize"],y5,"瓦片大小",256),new V.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Cn.defaults.maximumLevel),new V.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Cn.defaults.minimumLevel),new V.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Cn.defaults.scheme)],more:[...e.more,new V.GroupProperty([],"通用","通用"),new V.EnumProperty([this,"splitDirection"],v5,"splitDirection","NONE"),new V.GroupProperty([],"czm","czm"),new V.NumberProperty([this,"czmAlpha"],"透明度"),new V.NumberProperty([this,"czmBrightness"],"亮度"),new V.NumberProperty([this,"czmContrast"],"对比度"),new V.NumberProperty([this,"czmHue"],"色相"),new V.NumberProperty([this,"czmSaturation"],"饱和度"),new V.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(Cn,"createDefaultProps",()=>({...V.ESVisualObject.createDefaultProps(),rectangle:d.reactJsonWithUndefined([-180,-90,180,90]),url:d.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:d.reactArrayWithUndefined([]),scheme:d.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(Cn,"type",Cn.register("ESMVTLayer",Cn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let qA=Cn;const w5=t=>{const n=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:i}of n)if(t>=e)return i;return 20},_5=async(t,n,e)=>(await fetch(`https://tileser.giiiis.com/xyzinfo/${e}/${t}/${n}`)).json(),b5=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=w5(o);let s=Math.floor((e+180)/360*Math.pow(2,r+1)),a=Math.floor((90-i)/180*Math.pow(2,r));return await _5(s,a,r)};class C5 extends V.Destroyable{constructor(n,e,i){super();const o=async()=>{const s=await b5(n);e.datesEvent.emit(s,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const s=()=>{const a=e.currentDate?e.currentDate:0;i.url=`https://tileser.giiiis.com/timetile/tms/${a}/tilemapresource.xml`};s(),this.d(e.currentDateChanged.don(s))}}}const Ts=class Ts extends V.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new V.ESImageryLayer));L(this,"_datesEvent",this.dv(new d.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(d.track([i,"show"],[this,"show"])),this.d(d.track([i,"zIndex"],[this,"zIndex"])),this.d(d.track([i,"rectangle"],[this,"rectangle"])),this.d(d.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(d.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new C5(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new V.StringProperty([this,"currentDate"],"时间","0"),new V.NumberProperty([this,"zIndex"],"层级",0),new V.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(Ts,"createDefaultProps",()=>({...V.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:d.reactArray([-180,-90,180,90])})),L(Ts,"type",Ts.register("ESGeHistoryImagery",Ts,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let KA=Ts;const Gb=`async (dataSource, viewer) => {
|
|
2593
|
+
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let a=this.disposeVar(d.react(void 0));{const l=this.disposeVar(d.createProcessingFromAsyncFunc(async h=>{a.value=void 0;const c=e.url??V.ESDataMesh.defaults.url;if(!c)return;await h.promise(d.sleep(200));const A=(e.maxTime??23)|0;a.value=await h.promise(d5(V.ESSceneObject.context.getStrFromEnv(typeof c=="string"?c:c.url),A+1))}));l.start();const u=this.disposeVar(d.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(c){this._buffer=c}[Symbol.iterator](){return p5(this._buffer)}}const u=()=>{if(!a.value)return;const{vertexBuffer:h,propBuffers:c,indexBuffer:A}=a.value,{minPos:p,maxPos:f}=V.getMinMaxCorner(new l(h));r.setLocalAxisedBoundingBox(p,f);const g=(e.maxTime??23)|0;let v=(e.currentTime??V.ESDataMesh.defaults.currentTime)/g;v=v<0?0:v>1?1:v;const y=v*g;let m=v*g|0,_=y-m;if(m>=g&&(m=g-1,_=1),!Number.isFinite(_)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=A,!c[m]||!c[m+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:h,componentsPerAttribute:3},a_prop:{typedArray:c[m],componentsPerAttribute:3},a_prop2:{typedArray:c[m+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${s.id}`},u_stripMinMaxValue:[e.minPropValue??V.ESDataMesh.defaults.minPropValue,e.maxPropValue??V.ESDataMesh.defaults.maxPropValue],u_ratio:_}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(a.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s,!0),!0):!1}};L(yu,"type",yu.register("ESCesiumViewer",V.ESDataMesh.type,yu));let Pm=yu;const Yo=class Yo extends d.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new d.Event));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_heading",this.disposeVar(d.react(0)));L(this,"_textFunc",this.disposeVar(d.react(void 0)));const o=this;{const a=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=V.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=V.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=V.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?V.clampN180_180(u):V.clamp0_360(u)}};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(a))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(d.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(d.bind([r,"arcType"],[o,"arcType"])),this.dispose(d.bind([r,"color"],[o,"color"])),this.dispose(d.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(d.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(d.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(d.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(d.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(d.bind([r,"positions"],[o,"positions"])),this.dispose(d.bind([r,"show"],[o,"show"])),this.dispose(d.bind([r,"width"],[o,"width"])),this.dispose(d.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(d.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(a=>{e.actived&&r.flyTo(a)}));const s=this.disposeVar(new vt(e,i));this.dispose(d.bind([s,"shadowDom"],[o,"shadowDom"])),this.dispose(d.bind([s,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(d.bind([s,"show"],[o,"show"]));{const a=()=>{o.positions&&o.positions.length>=2?s.position=o.positions[1]:s.position=void 0};a(),this.dispose(o.positionsChanged.disposableOn(a))}{const a=()=>{const{heading:u}=o,h=(o.textFunc??Yo.defaultTextFunc_度格式)(u);s.innerHTML=po(`方向: ${h}`,24)};a();const l=this.disposeVar(d.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(a))}this.ad(s.pickedEvent.don(a=>{zi(a)===0&&this.pickedEvent.emit(a)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};L(Yo,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(Yo,"defaultTextFunc_度分格式",e=>`${zs(e,!0)}`),L(Yo,"defaultTextFunc_度分秒格式",e=>`${zs(e,!1)}`),L(Yo,"defaults",{positions:[]});let Lo=Yo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:d.reactPositions(void 0),width:8,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Lo||(Lo={})),d.extendClassProps(Lo.prototype,Lo.createDefaultProps);const vu=class vu extends en{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Lo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const c=h.materialParams;Reflect.has(c,"gapColor")&&(r.gapColor=c.gapColor??[0,0,0,0]),Reflect.has(c,"dashLength")&&(r.dashLength=c.dashLength),Reflect.has(c,"dashPattern")&&(r.dashPattern=c.dashPattern)}catch(c){console.error(c)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(d.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{zi(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(vu,"type",vu.register("ESCesiumViewer",V.ESDirectionMeasurement.type,vu));let Tm=vu;class ns extends d.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new d.Event));L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_distances",this.disposeVar(d.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await L0(e.viewer,this.positions??[]):this._distances.value=V.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const s=this.disposeVar(new Ye(e,i));s.loop=!1,this.dispose(d.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(d.bind([s,"arcType"],[this,"arcType"])),this.dispose(d.bind([s,"color"],[this,"color"])),this.dispose(d.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(d.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(d.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(d.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(d.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(d.bind([s,"positions"],[this,"positions"])),this.dispose(d.bind([s,"show"],[this,"show"])),this.dispose(d.bind([s,"width"],[this,"width"])),this.dispose(d.bind([s,"depthTest"],[this,"depthTest"])),this.dispose(d.bind([s,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&s.flyTo(a)}));{const a=[],l=()=>{for(let h of a)h.destroy();a.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const c=rd("起点",this.positions[0],e,i);c.dispose(d.track([c,"show"],[this,"show"])),c.dispose(d.track([c,"shadowDom"],[this,"shadowDom"])),c.dispose(d.track([c,"cssAllInitial"],[this,"cssAllInitial"])),a.push(c)}const h=this.distances.length;for(let c=0;c<h;++c){const A=this.distances[c],p=this.positions[c+1],f=rd(`长度: ${rh(A)}`,p,e,i);f.dispose(d.track([f,"show"],[this,"show"])),f.dispose(d.track([f,"shadowDom"],[this,"shadowDom"])),f.dispose(d.track([f,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(f.pickedEvent.don(g=>{zi(g)===0&&this.pickedEvent.emit(g)})),a.push(f)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>V.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}L(ns,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:d.reactPositions(void 0),width:1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(ns||(ns={})),d.extendClassProps(ns.prototype,ns.createDefaultProps);const wu=class wu extends en{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.track([r,"width"],[e,"strokeWidth"])),this.dispose(d.track([r,"color"],[e,"strokeColor"])),this.dispose(d.track([r,"ground"],[e,"strokeGround"]));{const s=()=>{r.show=e.show&&e.stroked};s();const a=this.disposeVar(d.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(wu,"type",wu.register("ESCesiumViewer",V.ESGeoLineString.type,wu));let is=wu;const _u=class _u extends is{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new ns(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(d.bind([r,"positions"],[e,"points"])),this.dispose(d.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const c=h.materialParams;Reflect.has(c,"gapColor")&&(r.gapColor=c.gapColor??[0,0,0,0]),Reflect.has(c,"dashLength")&&(r.dashLength=c.dashLength),Reflect.has(c,"dashPattern")&&(r.dashPattern=c.dashPattern)}catch(c){console.error(c)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(d.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{zi(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(_u,"type",_u.register("ESCesiumViewer",V.ESDistanceMeasurement.type,_u));let Im=_u;class rs extends d.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_id",this.disposeVar(d.react(d.createGuid())));i&&(this.id=i)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:d.reactPositions(void 0),reverse:!1,edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2})})(rs||(rs={})),d.extendClassProps(rs.prototype,rs.createDefaultProps);class m5 extends d.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];V.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class g5 extends d.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];V.ESSceneObject.getSceneObjById(i)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const bu=class bu extends kn{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new rs(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new V.ESSceneObjectWithId);const o=this.ad(d.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=V.ESSceneObject.getSceneObject(e.targetID);o.value=a?(a.components.main??a).id:""})),this.dispose(d.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const s=this._czmPolygonClipping;s.showHelper=!1,this.dispose(d.bind([s,"positions"],[e,"points"])),this.dispose(d.track([s,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.reverse=e.mode!=="in"};a(),this.dispose(e.modeChanged.disposableOn(a))}V.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(d.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new d.ObjResettingWithEvent(a,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new g5(this):!l||!(l instanceof V.ES3DTileset)?void 0:new m5(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(bu,"type",bu.register("ESCesiumViewer",V.ESExcavate.type,bu));let km=bu;const Cu=class Cu extends Ge{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new fi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const s=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.dispose(d.bind([r,"position"],[e,"position"])),this.dispose(d.track([r,"translation"],[e,"translation"])),this.dispose(Bt([r,"rotation"],[e,"rotation"])),this.dispose(d.track([r,"show"],[e,"show"])),this.dispose(d.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,On,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Cu,"type",Cu.register("ESCesiumViewer",V.ESFireParticleSystem.type,Cu));let Fm=Cu;class os extends d.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_currentDistance",this.disposeVar(d.react(0)));L(this,"_ratio",this.disposeVar(V.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new V.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new vr(e,i)),this._player=this.disposeVar(new V.Player),this.dispose(d.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(d.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(d.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(d.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(d.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(d.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(d.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(d.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(d.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(d.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(d.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(d.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(d.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(d.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(d.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(d.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(d.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(d.track([this._geoPath,"show"],[this,"show"])),this.dispose(d.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(d.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const s=this.granularity*Math.PI/180,a=qf(this.positions,this.arcType??"GEODESIC",s);if(a){this._geoPath.timePosRots=a.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(d.bind([this._player,"loop"],[this,"loop"])),this.dispose(d.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(d.bind([this._player,"duration"],[this,"duration"])),this.dispose(d.bind([this._player,"playing"],[this,"playing"])),this.dispose(d.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:d.reactPositions(void 0),width:1,ground:!1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(os||(os={})),d.extendClassProps(os.prototype,os.createDefaultProps);class kl extends d.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new d.Event));L(this,"_currentDistance",this.disposeVar(d.react(0)));this._geoPolylinePath=this.disposeVar(new os(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(d.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(d.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(d.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(d.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(d.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(d.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(d.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(d.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(d.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(d.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(d.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(d.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(d.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(d.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(d.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(d.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(d.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(d.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(d.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(d.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(d.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(d.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(d.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const s=od(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=s}else this._geoPolylinePath.positions=void 0}catch(s){console.error(s),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(s=>{this._geoPolylinePath.flyTo(s)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:d.reactPositions(void 0),width:1,ground:!1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(kl||(kl={})),d.extendClassProps(kl.prototype,kl.createDefaultProps);const y5=[["256",256],["512",512],["1024",1024]],v5=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Cn=class Cn extends V.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new d.Event));this.ad(d.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(d.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new V.StringProperty([this,"accessToken"],"令牌",Cn.defaults.accessToken),new V.Number4Property([this,"rectangle"],"矩形范围",Cn.defaults.rectangle),new V.JsonProperty([this,"url"],"服务地址",Cn.defaults.url),new V.JsonProperty([this,"style"],"样式配置",Cn.defaults.style),new V.NumberProperty([this,"zIndex"],"层级序号",Cn.defaults.zIndex),new V.EnumProperty([this,"tileSize"],y5,"瓦片大小",256),new V.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Cn.defaults.maximumLevel),new V.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Cn.defaults.minimumLevel),new V.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Cn.defaults.scheme)],more:[...e.more,new V.GroupProperty([],"通用","通用"),new V.EnumProperty([this,"splitDirection"],v5,"splitDirection","NONE"),new V.GroupProperty([],"czm","czm"),new V.NumberProperty([this,"czmAlpha"],"透明度"),new V.NumberProperty([this,"czmBrightness"],"亮度"),new V.NumberProperty([this,"czmContrast"],"对比度"),new V.NumberProperty([this,"czmHue"],"色相"),new V.NumberProperty([this,"czmSaturation"],"饱和度"),new V.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(Cn,"createDefaultProps",()=>({...V.ESVisualObject.createDefaultProps(),rectangle:d.reactJsonWithUndefined([-180,-90,180,90]),url:d.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:d.reactArrayWithUndefined([]),scheme:d.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(Cn,"type",Cn.register("ESMVTLayer",Cn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let qA=Cn;const w5=t=>{const n=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:i}of n)if(t>=e)return i;return 20},_5=async(t,n,e)=>(await fetch(`https://tileser.giiiis.com/xyzinfo/${e}/${t}/${n}`)).json(),b5=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=w5(o);let s=Math.floor((e+180)/360*Math.pow(2,r+1)),a=Math.floor((90-i)/180*Math.pow(2,r));return await _5(s,a,r)};class C5 extends V.Destroyable{constructor(n,e,i){super();const o=async()=>{const s=await b5(n);e.datesEvent.emit(s,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const s=()=>{const a=e.currentDate?e.currentDate:0;i.url=`https://tileser.giiiis.com/timetile/tms/${a}/tilemapresource.xml`};s(),this.d(e.currentDateChanged.don(s))}}}const Ts=class Ts extends V.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new V.ESImageryLayer));L(this,"_datesEvent",this.dv(new d.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(d.track([i,"show"],[this,"show"])),this.d(d.track([i,"zIndex"],[this,"zIndex"])),this.d(d.track([i,"rectangle"],[this,"rectangle"])),this.d(d.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(d.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new C5(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new V.StringProperty([this,"currentDate"],"时间","0"),new V.NumberProperty([this,"zIndex"],"层级",0),new V.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(Ts,"createDefaultProps",()=>({...V.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:d.reactArray([-180,-90,180,90])})),L(Ts,"type",Ts.register("ESGeHistoryImagery",Ts,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let KA=Ts;const Gb=`async (dataSource, viewer) => {
|
|
2594
2594
|
viewer.clock.shouldAnimate = false;
|
|
2595
2595
|
const rider = dataSource.entities.getById("tour");
|
|
2596
2596
|
await viewer.flyTo(rider)
|
|
@@ -3197,7 +3197,7 @@ ${eC}
|
|
|
3197
3197
|
</div>
|
|
3198
3198
|
</div>
|
|
3199
3199
|
</div>
|
|
3200
|
-
`,J5=async(t,n)=>{const e=(n==null?void 0:n.fontSize)??V.ESPoi2D.defaults.style.fontSize,i=(n==null?void 0:n.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(n==null?void 0:n.imageSize)??V.ESPoi2D.defaults.style.imageSize,r=(n==null?void 0:n.text)??V.ESPoi2D.defaults.style.text,s=(n==null?void 0:n.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",a=(n==null?void 0:n.textBackgroundColor)??V.ESPoi2D.defaults.style.textBackgroundColor,l=(n==null?void 0:n.textBackgroundSize)??V.ESPoi2D.defaults.style.textBackgroundSize,u=(n==null?void 0:n.textColor)??V.ESPoi2D.defaults.style.textColor,h=(n==null?void 0:n.textOffset)??V.ESPoi2D.defaults.style.textOffset;let c=Y5;c=c.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),c=c.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),c=c.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),c=c.replace(/{{FONT_SIZE}}/g,e+"px"),c=c.replace(/{{IMAGE_SRC}}/g,V.ESSceneObject.context.getStrFromEnv(i)),c=c.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),c=c.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),c=c.replace(/{{TEXT}}/g,r),c=c.replace(/{{TEXT_BACKGROUND}}/g,V.ESSceneObject.context.getStrFromEnv(s)),c=c.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${a.map(p=>p*255).join(",")})`),c=c.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,l[0]+"px"),c=c.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,l[1]+"px"),c=c.replace(/{{TEXT_COLOR}}/g,`rgb(${u.map(p=>p*255).join(",")})`),c=c.replace(/{{TEXT_OFFSET_X}}/g,h[0]+"px"),c=c.replace(/{{TEXT_OFFSET_Y}}/g,h[1]+"px");const A=document.createElement("div");return A.innerHTML=c,[A.children[0].children[0],A.children[0].children[1]]},bt=class bt extends Tl{constructor(e,i){super(e,i);L(this,"_widgetComponent");L(this,"_customWidgetComponent");L(this,"_textBox",[]);L(this,"_iconBox");L(this,"_icon");L(this,"_anchor");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.ad(new d.Event),s=this.ad(new d.Event);{let l;const u=this.ad(d.createNextAnimateFrameEvent(e.screenRenderChanged,s));this.customWidgetComponent=this.disposeVar(new d.ObjResettingWithEvent(u,()=>{if(!(!l||e.mode!="Custom"))return e.screenRender?new wr(e,i,l[1],!0,!1):new oA(e,i,l[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new d.ObjResettingWithEvent(u,()=>{if(l)return e.screenRender?new wr(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1):new oA(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const h=this.dv(d.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,r));this.ad(h.don(async()=>{var c;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const A=e.style[Object.keys(e.style).filter(g=>g.toUpperCase()=="TEXT")[0]]??e.name,{div:p,styleObj:f}=H5(e.mode,A,this._textBox,this._iconBox,this._icon,this._anchor);l=p,l.innerHTML=X5(l.innerHTML,f)}else{const A=await J5(e.id,{...e.style,text:((c=e.style)==null?void 0:c.text)??e.name});l=[A[0],A[1]]}s.emit()}))}{const l=this.ad(d.createProcessingFromAsyncFunc(async A=>{const p=e.mode;bt.modeCache.value={...bt.modeCache.value,[p]:void 0},await A.promise(N5(p)).then(f=>{bt.modeCache.value={...bt.modeCache.value,[p]:f},this._icon=f.icon,this._anchor=f.anchor,this._iconBox=f.iconBox,this._textBox=f.textBox,r.emit()})}));let u=null,h=null;const c=()=>{var A,p,f,g;if(e.mode=="Custom"){r.emit();return}if(Reflect.has(bt.modeCache.value,e.mode))if(bt.modeCache.value[e.mode])this._icon=(A=bt.modeCache.value[e.mode])==null?void 0:A.icon,this._anchor=(p=bt.modeCache.value[e.mode])==null?void 0:p.anchor,this._iconBox=(f=bt.modeCache.value[e.mode])==null?void 0:f.iconBox,this._textBox=((g=bt.modeCache.value[e.mode])==null?void 0:g.textBox)??[],r.emit();else{if(u)return;u=bt.modeCache.changed.don(()=>{var v,y,m,_;bt.modeCache.value[e.mode]&&(this._icon=(v=bt.modeCache.value[e.mode])==null?void 0:v.icon,this._anchor=(y=bt.modeCache.value[e.mode])==null?void 0:y.anchor,this._iconBox=(m=bt.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((_=bt.modeCache.value[e.mode])==null?void 0:_.textBox)??[],r.emit(),u&&u(),u=null)})}else if(!l.isRunning)l.restart();else{if(h)return;h=l.completeEvent.donce(()=>{h&&h(),h=null,l.restart()})}};c(),this.d(e.modeChanged.don(c))}const a=this.ad(new d.Event);{const l=this.dv(d.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),u=()=>{const h=this.widgetComponent.obj,c=e.autoAnchor?h.defaultAnchor:e.anchor,A=e.offset;if(h instanceof wr)c?(h.czmGeoCustomDivPoi.originRatioAndOffset=[...c,-A[0],-A[1]],h.widgetInfo.style.transformOrigin=`${c[0]*100}% ${c[1]*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let p=100,f=100;e.sizeByContent&&h.domSize?(p=h.domSize.width/100,f=h.domSize.height/100):(p=e.size[0]/100,f=e.size[1]/100),c?h.czmCustomPrimitive.localPosition=[c[0]*p-A[0]/100,0,c[1]*f-A[1]/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&a.emit()};this.d(l.don(u)),this.ad(new d.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const h=new d.Destroyable;return u(),h.d(this.widgetComponent.obj.defaultAnchorChanged.don(u)),h}))}{const l=this.dv(d.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,a)),u=()=>{var y,m,_;if(e.mode!="Custom")return;const h=this.customWidgetComponent.obj;if(!h)return;const c=((y=e.style)==null?void 0:y.imageSize)??V.ESPoi2D.defaults.style.imageSize,A=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,p=((m=e.style)==null?void 0:m.textBoxAlign)??V.ESPoi2D.defaults.style.textBoxAlign,f=p=="start"?0:p=="center"?.5:1,g=((_=e.style)==null?void 0:_.textBoxOffset)??V.ESPoi2D.defaults.style.textBoxOffset,v=e.offset;if(h instanceof wr)A?(h.czmGeoCustomDivPoi.originRatioAndOffset=[f,.5,-v[0]-g[0]+c[0]*(A[0]-.5),-v[1]-g[1]+c[1]*(A[1]-.5)],h.widgetInfo.style.transformOrigin=`${f*100}% ${.5*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let b=100,E=100;e.sizeByContent&&h.domSize?(b=h.domSize.width/100,E=h.domSize.height/100):(b=e.size[0]/100,E=e.size[1]/100),A?h.czmCustomPrimitive.localPosition=[f*b+(-v[0]-g[0]+c[0]*(A[0]-.5))/100,0,.5*E+(-v[1]-g[1]+c[1]*(A[1]-.5))/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(l.don(u));{const h=this.ad(d.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new d.ObjResettingWithEvent(h,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const c=new d.Destroyable,A=this.customWidgetComponent.obj,p=()=>{var f,g,v,y;A&&(A instanceof wr?(((f=e.style)==null?void 0:f.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(m=>{var b,E;const _=(b=mo(m,"pickResult"))==null?void 0:b.pointerEvent;_&&(A.czmGeoCustomDivPoi.show=e.show&&(((E=e.style)==null?void 0:E.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow)&&_.type=="mouseenter")}))):A.czmGeoCustomDivPoi.show=e.show&&(((g=e.style)==null?void 0:g.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow):(((v=e.style)==null?void 0:v.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(m=>{var _;m&&(A.czmCustomPrimitive.show=e.show&&(((_=e.style)==null?void 0:_.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow)&&m.type=="mouseEnter")}))):A.czmCustomPrimitive.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow))};return p(),c.ad(e.styleChanged.don(p)),c}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetComponent:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.obj)s.obj.flyTo(e,i);else{const a=setTimeout(()=>{clearTimeout(a),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}visibleDistance(e,i){var o,r,s,a,l;if((o=i.viewer)!=null&&o.camera&&e.show){const u=V.getDistancesFromPositions([e.position,Sn(i.viewer.camera)],"NONE")[0];let h=!1;e.minVisibleDistance<e.maxVisibleDistance?h=e.minVisibleDistance<u&&u<e.maxVisibleDistance:e.maxVisibleDistance==0&&(h=u>e.minVisibleDistance);const c=this.widgetComponent.obj,A=this.customWidgetComponent.obj;if(!c)return;c instanceof wr?(c.czmGeoCustomDivPoi.show=e.show&&h,(((r=e.style)==null?void 0:r.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmGeoCustomDivPoi.show=e.show&&h&&(((s=e.style)==null?void 0:s.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow))):(c.czmCustomPrimitive.show=e.show&&h,(((a=e.style)==null?void 0:a.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmCustomPrimitive.show=e.show&&h&&(((l=e.style)==null?void 0:l.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow)))}}};L(bt,"type",bt.register("ESCesiumViewer",V.ESPoi2D.type,bt)),L(bt,"modeCache",d.react({}));let Zm=bt;const Uu=class Uu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPoi3D");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(d.createNextAnimateFrameEvent(e.modeChanged));this.dv(new d.ObjResettingWithEvent(r,()=>{let{mode:s}=e;const a=V.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${s}/SM_POI_${s.charAt(0).toUpperCase()+s.slice(1)}.gltf`);return this._czmModelPoi3D=new j5(e,i,a)}))}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=V.getDistancesFromPositions([e.position,Sn(i.viewer.camera)],"NONE")[0];let s=!1;if(e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&s)}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,i),!0):!1:!1}};L(Uu,"type",Uu.register("ESCesiumViewer",V.ESPoi3D.type,Uu));let Xm=Uu;class j5 extends d.Destroyable{constructor(e,i,o){super();L(this,"czmModel");this._sceneObject=e,this._czmViewer=i,this._modelUrl=o,this.czmModel=this.ad(new Qt(this._czmViewer,this._sceneObject.id)),this.d(this.czmModel.readyEvent.don(l=>{this.czmModel.gltf.animations&&(this.czmModel.activeAnimationsJson=this.czmModel.gltf.animations.map((u,h)=>({index:h,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),this._updateMaterial(this._sceneObject,this.czmModel)})),this.ad(new nh(i.viewer,this.czmModel));const r=this._sceneObject,s=this.czmModel;s.url=this._modelUrl,this.d(d.bind([s,"position"],[r,"position"])),this.d(Bt([s,"rotation"],[r,"rotation"])),this.d(d.track([s,"scale"],[r,"scale"])),this.d(d.track([s,"show"],[r,"show"]));{const l=this.dv(d.createNextAnimateFrameEvent(r.allowPickingChanged,r.editingChanged)),u=()=>{r.allowPicking&&!r.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(l.don(u))}const a=this.dv(d.createNextAnimateFrameEvent(r.nameChanged,r.styleChanged));this.d(a.don(()=>this._updateMaterial(r,s)))}async _updateMaterial(e,i){var s,a;const o=document.createElement("div");o.style.position="absolute",o.style.zIndex="-1",o.style.bottom="108px",o.style.right="0px";const r=e.style[Object.keys(e.style).filter(l=>l.toUpperCase()==="TEXT")[0]]??e.name;o.innerHTML=`<div style="width: 512px; height: 128px;color: #fff;text-align: center;line-height: 128px;font-size: 50px;margin: 0 auto;">
|
|
3200
|
+
`,J5=async(t,n)=>{const e=(n==null?void 0:n.fontSize)??V.ESPoi2D.defaults.style.fontSize,i=(n==null?void 0:n.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(n==null?void 0:n.imageSize)??V.ESPoi2D.defaults.style.imageSize,r=(n==null?void 0:n.text)??V.ESPoi2D.defaults.style.text,s=(n==null?void 0:n.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",a=(n==null?void 0:n.textBackgroundColor)??V.ESPoi2D.defaults.style.textBackgroundColor,l=(n==null?void 0:n.textBackgroundSize)??V.ESPoi2D.defaults.style.textBackgroundSize,u=(n==null?void 0:n.textColor)??V.ESPoi2D.defaults.style.textColor,h=(n==null?void 0:n.textOffset)??V.ESPoi2D.defaults.style.textOffset;let c=Y5;c=c.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),c=c.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),c=c.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),c=c.replace(/{{FONT_SIZE}}/g,e+"px"),c=c.replace(/{{IMAGE_SRC}}/g,V.ESSceneObject.context.getStrFromEnv(i)),c=c.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),c=c.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),c=c.replace(/{{TEXT}}/g,r),c=c.replace(/{{TEXT_BACKGROUND}}/g,V.ESSceneObject.context.getStrFromEnv(s)),c=c.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${a.map(p=>p*255).join(",")})`),c=c.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,l[0]+"px"),c=c.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,l[1]+"px"),c=c.replace(/{{TEXT_COLOR}}/g,`rgb(${u.map(p=>p*255).join(",")})`),c=c.replace(/{{TEXT_OFFSET_X}}/g,h[0]+"px"),c=c.replace(/{{TEXT_OFFSET_Y}}/g,h[1]+"px");const A=document.createElement("div");return A.innerHTML=c,[A.children[0].children[0],A.children[0].children[1]]},bt=class bt extends Tl{constructor(e,i){super(e,i);L(this,"_widgetComponent");L(this,"_customWidgetComponent");L(this,"_textBox",[]);L(this,"_iconBox");L(this,"_icon");L(this,"_anchor");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.ad(new d.Event),s=this.ad(new d.Event);{let l;const u=this.ad(d.createNextAnimateFrameEvent(e.screenRenderChanged,s));this.customWidgetComponent=this.disposeVar(new d.ObjResettingWithEvent(u,()=>{if(!(!l||e.mode!="Custom"))return e.screenRender?new wr(e,i,l[1],!0,!1):new oA(e,i,l[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new d.ObjResettingWithEvent(u,()=>{if(l)return e.screenRender?new wr(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1):new oA(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const h=this.dv(d.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,r));this.ad(h.don(async()=>{var c;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const A=e.style[Object.keys(e.style).filter(g=>g.toUpperCase()=="TEXT")[0]]??e.name,{div:p,styleObj:f}=H5(e.mode,A,this._textBox,this._iconBox,this._icon,this._anchor);l=p,l.innerHTML=X5(l.innerHTML,f)}else{const A=await J5(e.id,{...e.style,text:((c=e.style)==null?void 0:c.text)??e.name});l=[A[0],A[1]]}s.emit()}))}{const l=this.ad(d.createProcessingFromAsyncFunc(async A=>{const p=e.mode;bt.modeCache.value={...bt.modeCache.value,[p]:void 0},await A.promise(N5(p)).then(f=>{bt.modeCache.value={...bt.modeCache.value,[p]:f},this._icon=f.icon,this._anchor=f.anchor,this._iconBox=f.iconBox,this._textBox=f.textBox,r.emit()})}));let u=null,h=null;const c=()=>{var A,p,f,g;if(e.mode=="Custom"){r.emit();return}if(Reflect.has(bt.modeCache.value,e.mode))if(bt.modeCache.value[e.mode])this._icon=(A=bt.modeCache.value[e.mode])==null?void 0:A.icon,this._anchor=(p=bt.modeCache.value[e.mode])==null?void 0:p.anchor,this._iconBox=(f=bt.modeCache.value[e.mode])==null?void 0:f.iconBox,this._textBox=((g=bt.modeCache.value[e.mode])==null?void 0:g.textBox)??[],r.emit();else{if(u)return;u=bt.modeCache.changed.don(()=>{var v,y,m,_;bt.modeCache.value[e.mode]&&(this._icon=(v=bt.modeCache.value[e.mode])==null?void 0:v.icon,this._anchor=(y=bt.modeCache.value[e.mode])==null?void 0:y.anchor,this._iconBox=(m=bt.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((_=bt.modeCache.value[e.mode])==null?void 0:_.textBox)??[],r.emit(),u&&u(),u=null)})}else if(!l.isRunning)l.restart();else{if(h)return;h=l.completeEvent.donce(()=>{h&&h(),h=null,l.restart()})}};c(),this.d(e.modeChanged.don(c))}const a=this.ad(new d.Event);{const l=this.dv(d.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),u=()=>{const h=this.widgetComponent.obj,c=e.autoAnchor?h.defaultAnchor:e.anchor,A=e.offset;if(h instanceof wr)c?(h.czmGeoCustomDivPoi.originRatioAndOffset=[...c,-A[0],-A[1]],h.widgetInfo.style.transformOrigin=`${c[0]*100}% ${c[1]*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let p=100,f=100;e.sizeByContent&&h.domSize?(p=h.domSize.width/100,f=h.domSize.height/100):(p=e.size[0]/100,f=e.size[1]/100),c?h.czmCustomPrimitive.localPosition=[c[0]*p-A[0]/100,0,c[1]*f-A[1]/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&a.emit()};this.d(l.don(u)),this.ad(new d.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const h=new d.Destroyable;return u(),h.d(this.widgetComponent.obj.defaultAnchorChanged.don(u)),h}))}{const l=this.dv(d.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,a)),u=()=>{var y,m,_;if(e.mode!="Custom")return;const h=this.customWidgetComponent.obj;if(!h)return;const c=((y=e.style)==null?void 0:y.imageSize)??V.ESPoi2D.defaults.style.imageSize,A=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,p=((m=e.style)==null?void 0:m.textBoxAlign)??V.ESPoi2D.defaults.style.textBoxAlign,f=p=="start"?0:p=="center"?.5:1,g=((_=e.style)==null?void 0:_.textBoxOffset)??V.ESPoi2D.defaults.style.textBoxOffset,v=e.offset;if(h instanceof wr)A?(h.czmGeoCustomDivPoi.originRatioAndOffset=[f,.5,-v[0]-g[0]+c[0]*(A[0]-.5),-v[1]-g[1]+c[1]*(A[1]-.5)],h.widgetInfo.style.transformOrigin=`${f*100}% ${.5*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let b=100,E=100;e.sizeByContent&&h.domSize?(b=h.domSize.width/100,E=h.domSize.height/100):(b=e.size[0]/100,E=e.size[1]/100),A?h.czmCustomPrimitive.localPosition=[f*b+(-v[0]-g[0]+c[0]*(A[0]-.5))/100,0,.5*E+(-v[1]-g[1]+c[1]*(A[1]-.5))/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(l.don(u));{const h=this.ad(d.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new d.ObjResettingWithEvent(h,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const c=new d.Destroyable,A=this.customWidgetComponent.obj,p=()=>{var f,g,v,y;A&&(A instanceof wr?(((f=e.style)==null?void 0:f.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(m=>{var b,E;const _=(b=mo(m,"pickResult"))==null?void 0:b.pointerEvent;_&&(A.czmGeoCustomDivPoi.show=e.show&&(((E=e.style)==null?void 0:E.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow)&&_.type=="mouseenter")}))):A.czmGeoCustomDivPoi.show=e.show&&(((g=e.style)==null?void 0:g.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow):(((v=e.style)==null?void 0:v.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(m=>{var _;m&&(A.czmCustomPrimitive.show=e.show&&(((_=e.style)==null?void 0:_.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow)&&m.type=="mouseEnter")}))):A.czmCustomPrimitive.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow))};return p(),c.ad(e.styleChanged.don(p)),c}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetComponent:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.obj)s.obj.flyTo(e,i);else{const a=setTimeout(()=>{clearTimeout(a),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}visibleDistance(e,i){var o,r,s,a,l;if((o=i.viewer)!=null&&o.camera&&e.show){const u=V.getDistancesFromPositions([e.position,Sn(i.viewer.camera)],"NONE")[0];let h=!1;e.minVisibleDistance<e.maxVisibleDistance?h=e.minVisibleDistance<u&&u<e.maxVisibleDistance:e.maxVisibleDistance==0&&(h=u>e.minVisibleDistance);const c=this.widgetComponent.obj,A=this.customWidgetComponent.obj;if(!c)return;c instanceof wr?(c.czmGeoCustomDivPoi.show=e.show&&h,(((r=e.style)==null?void 0:r.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmGeoCustomDivPoi.show=e.show&&h&&(((s=e.style)==null?void 0:s.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow))):(c.czmCustomPrimitive.show=e.show&&h,(((a=e.style)==null?void 0:a.textBoxMode)??V.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmCustomPrimitive.show=e.show&&h&&(((l=e.style)==null?void 0:l.textBoxShow)??V.ESPoi2D.defaults.style.textBoxShow)))}}};L(bt,"type",bt.register("ESCesiumViewer",V.ESPoi2D.type,bt)),L(bt,"modeCache",d.react({}));let Zm=bt;const Uu=class Uu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPoi3D");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(d.createNextAnimateFrameEvent(e.modeChanged));this.dv(new d.ObjResettingWithEvent(r,()=>{let{mode:s}=e;const a=V.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${s.charAt(0).toLocaleLowerCase()+s.slice(1)}/SM_${["triangle","diamond"].includes(s)?"POI":"3dPoi"}_${s.charAt(0).toUpperCase()+s.slice(1)}.glb`);return this._czmModelPoi3D=new j5(e,i,a)}))}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=V.getDistancesFromPositions([e.position,Sn(i.viewer.camera)],"NONE")[0];let s=!1;if(e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&s)}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,i),!0):!1:!1}};L(Uu,"type",Uu.register("ESCesiumViewer",V.ESPoi3D.type,Uu));let Xm=Uu;class j5 extends d.Destroyable{constructor(e,i,o){super();L(this,"czmModel");this._sceneObject=e,this._czmViewer=i,this._modelUrl=o,this.czmModel=this.ad(new Qt(this._czmViewer,this._sceneObject.id)),this.d(this.czmModel.readyEvent.don(l=>{this.czmModel.gltf.animations&&(this.czmModel.activeAnimationsJson=this.czmModel.gltf.animations.map((u,h)=>({index:h,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),this._updateMaterial(this._sceneObject,this.czmModel)})),this.ad(new nh(i.viewer,this.czmModel));const r=this._sceneObject,s=this.czmModel;s.url=this._modelUrl,this.d(d.bind([s,"position"],[r,"position"])),this.d(Bt([s,"rotation"],[r,"rotation"])),this.d(d.track([s,"scale"],[r,"scale"])),this.d(d.track([s,"show"],[r,"show"]));{const l=this.dv(d.createNextAnimateFrameEvent(r.allowPickingChanged,r.editingChanged)),u=()=>{r.allowPicking&&!r.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(l.don(u))}const a=this.dv(d.createNextAnimateFrameEvent(r.nameChanged,r.styleChanged));this.d(a.don(()=>this._updateMaterial(r,s)))}async _updateMaterial(e,i){var s,a;const o=document.createElement("div");o.style.position="absolute",o.style.zIndex="-1",o.style.bottom="108px",o.style.right="0px";const r=e.style[Object.keys(e.style).filter(l=>l.toUpperCase()==="TEXT")[0]]??e.name;o.innerHTML=`<div style="width: 512px; height: 128px;color: #fff;text-align: center;line-height: 128px;font-size: 50px;margin: 0 auto;">
|
|
3201
3201
|
<span style="display: inline-block;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: 512px;">${r}</span>
|
|
3202
3202
|
</div>`,document.body.contains(o)||document.body.appendChild(o);try{const l=await Ap(o,{backgroundColor:null,allowTaint:!1,useCORS:!0});document.body.contains(o)&&document.body.removeChild(o),i.setMaterial({Text:{baseColorTexture:{value:l.toDataURL("image/png",1)}},lambert5:{baseColorFactor:((s=e.style)==null?void 0:s.UI_Color)??[1,1,1,1]},default:{baseColorFactor:((a=e.style)==null?void 0:a.FX_Color)??[1,1,1,1]}})}catch(l){console.error(l),document.body.contains(o)&&document.body.removeChild(o)}}flyTo(e,i){const{_czmViewer:o,_sceneObject:r,czmModel:s}=this;dn(o,r,i,e,s,!0)}}const Ou=class Ou extends Ge{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");L(this,"_causticsTexture");L(this,"_foamTexture");L(this,"_heightMapTexture");L(this,"_normalMapTexture");L(this,"isTimestamp",e=>{if(e.toString().length!==13||isNaN(e))return console.log("时间戳格式错误"),!1;const o=new Date(e);return isNaN(o.getTime())?(console.log("时间戳格式错误"),!1):!0});L(this,"getClosestTimestampIndex",(e,i)=>{for(var o=0,r=1/0,s=0;s<i.length;s++){var a=Math.abs(e-i[s]);a<r&&(r=a,o=s)}return o});if(this._czmCustomPrimitive=this.dv(new st(i,e.id)),this._causticsTexture=this.dv(new ht(i)),this._foamTexture=this.dv(new ht(i)),this._heightMapTexture=this.dv(new ht(i)),this._normalMapTexture=this.dv(new ht(i)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.czmCustomPrimitive,s=this.causticsTexture,a=this.foamTexture,l=this.heightMapTexture,u=this.normalMapTexture;s.uri=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/caustics.jpg"),a.uri=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/foam.jpg"),l.uri=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/heightmap.jpg"),u.uri=V.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/water_normalmap.png"),this.d(d.track([r,"show"],[e,"show"])),this.d(d.track([r,"allowPicking"],[e,"allowPicking"])),this.d(d.bind([r,"position"],[e,"position"])),this.d(d.bind([r,"rotation"],[e,"rotation"])),this.d(d.bind([r,"scale"],[e,"scale"])),r.pass="TRANSLUCENT",r.primitiveType="TRIANGLES",r.renderState={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!0,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},r.vertexShaderSource=`
|
|
3203
3203
|
in vec3 position;
|
|
@@ -4106,10 +4106,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4106
4106
|
`;function mV(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4107
4107
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4108
4108
|
gitee地址:${t}
|
|
4109
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends V.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(d.react(0)));L(this,"_viewer",this.dv(d.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(d.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(d.react(0)));L(this,"_editingSystem",_f);L(this,"_moveObjectsProcess",this.ad(WS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new $z(this)),this.ad(new Yz(this)),this.dv(new d.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new t6(this)})),this._viewerLegend=this.dv(new cV(this)),this._viewerInstance=this.dv(new d.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Xv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Ie([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new d.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new jQ(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Dn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=C.Cartographic.fromDegrees(e[0],e[1],e[2],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const s=C.Cartesian3.fromDegrees(...e),a=C.Cartesian3.distance(o.positionWC,s),l=C.Cartesian3.subtract(s,r,new C.Cartesian3);C.Cartesian3.normalize(l,l);const u=C.Transforms.rotationMatrixFromPositionVelocity(r,l,C.Ellipsoid.WGS84),h=C.Matrix4.fromRotationTranslation(u,r);var c=C.Transforms.eastNorthUpToFixedFrame(C.Matrix4.getTranslation(h,new C.Cartesian3),C.Ellipsoid.WGS84,new C.Matrix4),A=C.Matrix4.multiply(C.Matrix4.inverse(c,new C.Matrix4),h,new C.Matrix4),p=C.Matrix4.getMatrix3(A,new C.Matrix3),f=C.Quaternion.fromRotationMatrix(p),g=C.HeadingPitchRoll.fromQuaternion(f);const v=aa(o);return{distance:a,heading:C.Math.toDegrees(g.heading)+90,pitch:C.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(C.Math.toDegrees(g.heading)+90)),pDelta:v[1]-C.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;if(!i)return;i[0]=-i[0];const s={position:e,rotation:i,duration:(o??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&Vs(a,s)}flyTo(e,i,o="default"){var p;const{distance:r,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,c={position:i,viewDistance:r,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},A=(p=this.viewer)==null?void 0:p.camera;return A&&Vs(A,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=V.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},h=(c=this.viewer)==null?void 0:c.camera;return h&&Vs(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,s,a){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){return window.g_XE3CopyRights??{}}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=C.Cartographic.fromDegrees(e,i,void 0,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await O0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.mainClass;r&&(console.log(i,"这是Cesium的模式"),i!=null&&(r.editingID=`${o.callSource}_${d.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch)))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=d.createGuid();for(let r=0;r<e.length;r++){const a=e[r].mainClass;a.editingID=o,a&&i.push(a)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return fn(e,i)}localPositionsToPositions(e,i){return mr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new C.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new V.GroupProperty([],"通用","通用"),new V.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",pV,dV,!0),new V.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new V.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new V.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new V.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new V.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new V.GroupProperty([],"Viewer","Viewer"),new V.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new V.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new V.BooleanProperty([this,"shadows"]),new V.GroupProperty([],"比例尺","比例尺(Legend)"),new V.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new V.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new V.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new V.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new V.GroupProperty([],"场景","场景(Scene)"),new V.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new V.GroupProperty([],"Globe","Globe"),new V.BooleanProperty([this,"depthTestAgainstTerrain"],"depthTestAgainstTerrain",i.depthTestAgainstTerrain,!0),new V.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new V.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new V.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new V.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new V.BooleanProperty([this,"sceneGlobeShowSkirts"]),new V.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new V.ColorProperty([this,"sceneGlobeBaseColor"]),new V.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new V.JsonProperty([this,"sceneGlobeClippingPlanes"]),new V.StringProperty([this,"sceneGlobeClippingPlanesId"]),new V.JsonProperty([this,"sceneGlobeClippingPolygons"]),new V.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new V.GroupProperty([],"underground","underground"),new V.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new V.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new V.GroupProperty([],"Translucency","Translucency"),new V.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",i.sceneGlobeTranslucencyEnabled,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",i.sceneGlobeTranslucencyBackFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",i.sceneGlobeTranslucencyFrontFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new V.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new V.GroupProperty([],"Sun","Sun"),new V.BooleanProperty([this,"sun"],"sun",i.sun,!0),new V.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new V.GroupProperty([],"Moon","Moon"),new V.BooleanProperty([this,"moon"],"moon",i.moon,!0),new V.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new V.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new V.GroupProperty([],"SkyBox","SkyBox"),new V.BooleanProperty([this,"sceneSkyBoxShow"]),new V.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new V.GroupProperty([],"Background","Background"),new V.BooleanProperty([this,"xbsjUseBackground"]),new V.StringProperty([this,"xbsjBackgroundImageUri"]),new V.ColorProperty([this,"xbsjBackgroundColor"]),new V.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new V.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new V.ColorProperty([this,"sceneBackgroundColor"]),new V.GroupProperty([],"Fog","Fog"),new V.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new V.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new V.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new V.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new V.GroupProperty([],"Sscc","Sscc"),new V.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new V.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new V.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new V.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new V.GroupProperty([],"后处理","后处理"),new V.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new V.GroupProperty([],"环境遮蔽","环境遮蔽"),new V.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new V.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new V.GroupProperty([],"Bloom","Bloom"),new V.BooleanProperty([this,"scenePpsBloomEnabled"]),new V.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new V.NumberProperty([this,"scenePpsBloomContrast"]),new V.NumberProperty([this,"scenePpsBloomBrightness"]),new V.NumberProperty([this,"scenePpsBloomDelta"]),new V.NumberProperty([this,"scenePpsBloomSigma"]),new V.NumberProperty([this,"scenePpsBloomStepSize"]),new V.GroupProperty([],"调试","调试"),new V.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new V.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new V.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new V.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new V.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new V.GroupProperty([],"Inspector","Inspector"),new V.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new V.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new V.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(zt,"type",zt.register("ESCesiumViewer",zt)),L(zt,"getCesiumIonToken",mV),L(zt,"currentDefaultAccessToken",C.Ion.defaultAccessToken),L(zt,"latestDefaultAccessToken"),L(zt,"ObjectsToExcludeWrapper",e6),L(zt,"defaults",{...V.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,depthTestAgainstTerrain:!1,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha:1,sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:C.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(zt,"getHeightsScartchCarto",new C.Cartographic);let tt=zt;(t=>{t.createDefaultProps=()=>({...V.ESViewer.createDefaultProps(),...fV()})})(tt||(tt={})),d.extendClassProps(tt.prototype,tt.createDefaultProps),ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.4.0-beta.6",e="2025-09-02T06:26:49.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="1c85a7938326029bfd0efde53b240e71da26ae46",a=((Date.now()-1756794409e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4109
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const zt=class zt extends V.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(d.react(0)));L(this,"_viewer",this.dv(d.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(d.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(d.react(0)));L(this,"_editingSystem",_f);L(this,"_moveObjectsProcess",this.ad(WS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new $z(this)),this.ad(new Yz(this)),this.dv(new d.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new t6(this)})),this._viewerLegend=this.dv(new cV(this)),this._viewerInstance=this.dv(new d.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Xv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Ie([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new d.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new jQ(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Dn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=C.Cartographic.fromDegrees(e[0],e[1],e[2],zt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const s=C.Cartesian3.fromDegrees(...e),a=C.Cartesian3.distance(o.positionWC,s),l=C.Cartesian3.subtract(s,r,new C.Cartesian3);C.Cartesian3.normalize(l,l);const u=C.Transforms.rotationMatrixFromPositionVelocity(r,l,C.Ellipsoid.WGS84),h=C.Matrix4.fromRotationTranslation(u,r);var c=C.Transforms.eastNorthUpToFixedFrame(C.Matrix4.getTranslation(h,new C.Cartesian3),C.Ellipsoid.WGS84,new C.Matrix4),A=C.Matrix4.multiply(C.Matrix4.inverse(c,new C.Matrix4),h,new C.Matrix4),p=C.Matrix4.getMatrix3(A,new C.Matrix3),f=C.Quaternion.fromRotationMatrix(p),g=C.HeadingPitchRoll.fromQuaternion(f);const v=aa(o);return{distance:a,heading:C.Math.toDegrees(g.heading)+90,pitch:C.Math.toDegrees(g.pitch),flyDuration:1,hDelta:-(v[0]-(C.Math.toDegrees(g.heading)+90)),pDelta:v[1]-C.Math.toDegrees(g.pitch)}}flyIn(e,i,o,r="default"){var l;if(!i)return;i[0]=-i[0];const s={position:e,rotation:i,duration:(o??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&Vs(a,s)}flyTo(e,i,o="default"){var p;const{distance:r,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,c={position:i,viewDistance:r,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},A=(p=this.viewer)==null?void 0:p.camera;return A&&Vs(A,c)}flyToBoundingSphere(e,i,o=1){var c;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=V.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},h=(c=this.viewer)==null?void 0:c.camera;return h&&Vs(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Sn(e),rotation:aa(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,s,a){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=C.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=C.Cartographic.fromDegrees(e,i,void 0,zt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await O0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${d.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=d.createGuid();for(let r=0;r<e.length;r++){const s=e[r],a=s.components.main??s;a.editingID=o,a&&i.push(a)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=zt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!zt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=zt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return fn(e,i)}localPositionsToPositions(e,i){return mr(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new C.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=zt.defaults;return{...e,more:[...e.more,new V.GroupProperty([],"通用","通用"),new V.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",pV,dV,!0),new V.FunctionProperty([],()=>zt.getCesiumIonToken(),[],"获取官方token"),new V.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new V.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new V.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new V.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new V.GroupProperty([],"Viewer","Viewer"),new V.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new V.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new V.BooleanProperty([this,"shadows"]),new V.GroupProperty([],"比例尺","比例尺(Legend)"),new V.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new V.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new V.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new V.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new V.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new V.GroupProperty([],"场景","场景(Scene)"),new V.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new V.GroupProperty([],"Globe","Globe"),new V.BooleanProperty([this,"depthTestAgainstTerrain"],"depthTestAgainstTerrain",i.depthTestAgainstTerrain,!0),new V.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new V.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new V.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new V.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new V.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new V.BooleanProperty([this,"sceneGlobeShowSkirts"]),new V.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new V.ColorProperty([this,"sceneGlobeBaseColor"]),new V.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new V.JsonProperty([this,"sceneGlobeClippingPlanes"]),new V.StringProperty([this,"sceneGlobeClippingPlanesId"]),new V.JsonProperty([this,"sceneGlobeClippingPolygons"]),new V.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new V.GroupProperty([],"underground","underground"),new V.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new V.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new V.GroupProperty([],"Translucency","Translucency"),new V.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",i.sceneGlobeTranslucencyEnabled,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",i.sceneGlobeTranslucencyBackFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new V.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",i.sceneGlobeTranslucencyFrontFaceAlpha,!0),new V.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new V.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new V.GroupProperty([],"Sun","Sun"),new V.BooleanProperty([this,"sun"],"sun",i.sun,!0),new V.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new V.GroupProperty([],"Moon","Moon"),new V.BooleanProperty([this,"moon"],"moon",i.moon,!0),new V.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new V.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new V.GroupProperty([],"SkyBox","SkyBox"),new V.BooleanProperty([this,"sceneSkyBoxShow"]),new V.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new V.GroupProperty([],"Background","Background"),new V.BooleanProperty([this,"xbsjUseBackground"]),new V.StringProperty([this,"xbsjBackgroundImageUri"]),new V.ColorProperty([this,"xbsjBackgroundColor"]),new V.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new V.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new V.ColorProperty([this,"sceneBackgroundColor"]),new V.GroupProperty([],"Fog","Fog"),new V.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new V.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new V.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new V.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new V.GroupProperty([],"Sscc","Sscc"),new V.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new V.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new V.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new V.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new V.GroupProperty([],"后处理","后处理"),new V.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new V.GroupProperty([],"环境遮蔽","环境遮蔽"),new V.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new V.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new V.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new V.GroupProperty([],"Bloom","Bloom"),new V.BooleanProperty([this,"scenePpsBloomEnabled"]),new V.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new V.NumberProperty([this,"scenePpsBloomContrast"]),new V.NumberProperty([this,"scenePpsBloomBrightness"]),new V.NumberProperty([this,"scenePpsBloomDelta"]),new V.NumberProperty([this,"scenePpsBloomSigma"]),new V.NumberProperty([this,"scenePpsBloomStepSize"]),new V.GroupProperty([],"调试","调试"),new V.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new V.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new V.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new V.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new V.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new V.GroupProperty([],"Inspector","Inspector"),new V.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new V.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new V.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(zt,"type",zt.register("ESCesiumViewer",zt)),L(zt,"getCesiumIonToken",mV),L(zt,"currentDefaultAccessToken",C.Ion.defaultAccessToken),L(zt,"latestDefaultAccessToken"),L(zt,"ObjectsToExcludeWrapper",e6),L(zt,"defaults",{...V.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,depthTestAgainstTerrain:!1,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha:1,sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:C.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:C.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(zt,"getHeightsScartchCarto",new C.Cartographic);let tt=zt;(t=>{t.createDefaultProps=()=>({...V.ESViewer.createDefaultProps(),...fV()})})(tt||(tt={})),d.extendClassProps(tt.prototype,tt.createDefaultProps),ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.4.0-beta.8",e="2025-09-04T08:27:38.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="231b182a7d40241080224d74ac33fc6a2203810a",a=((Date.now()-1756974458e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4110
4110
|
%c${o?o+`
|
|
4111
4111
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4112
|
-
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4112
|
+
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","231b182a7d40241080224d74ac33fc6a2203810a")},get info(){return l},get date(){return"2025-09-04T08:27:38.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.8"},get name(){return"earthsdk3-cesium"},get commitId(){return"231b182a7d40241080224d74ac33fc6a2203810a"},print(){console.info(this.info,`
|
|
4113
4113
|
font-size: 18px;
|
|
4114
4114
|
font-weight: 1000;
|
|
4115
4115
|
line-height: 1;
|