earthsdk3 3.2.0-beta.8 → 3.2.0
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.iife.js +2 -2
- package/dist/earthsdk3.js +5 -5
- package/dist/earthsdk3.umd.cjs +19 -19
- package/package.json +1 -1
package/dist/earthsdk3.iife.js
CHANGED
|
@@ -534,10 +534,10 @@ ${K0}
|
|
|
534
534
|
`,Q0=Date.now();new Date(Q0).toISOString(),new Date(Q0+864e5).toISOString();const Ge=class Ge extends ft{constructor(e){super(e);p(this,"_flyToEvent",this.disposeVar(new d.Event));p(this,"_resetClockEvent",this.disposeVar(new d.Event))}get typeName(){return"ESCzml"}get defaultProps(){return Ge.createDefaultProps()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Y("数据","数据",!0,!1,[this,"data"],Ge.defaults.data,Ge.defaults.dataMd),new Y("路径","路径",!1,!1,[this,"uri"],""),new U("启用","启用",!1,!1,[this,"clockEnabled"],!1),new C("倍速","倍速.",!1,!1,[this,"multiplier"],Ge.defaults.multiplier),new U("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"],!0),new Gi("开始时间","开始时间",!0,!1,[this,"startTime"],Ge.defaults.startTime),new Gi("结束时间","结束时间",!0,!1,[this,"stopTime"],Ge.defaults.stopTime),new Gi("当前时间","当前时间",!0,!1,[this,"currentTime"],Ge.defaults.currentTime),new tt("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"SYSTEM_CLOCK_MULTIPLIER"),new tt("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"UNBOUNDED"),new U("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"],!1)],general:[...e.general,new nt("唯一标识","id",!1,!0,[this,"id"]),new nt("名称","name",!0,!1,[this,"name"]),new U("是否显示","show",!1,!1,[this,"show"],!0),new U("开启碰撞","collision",!1,!1,[this,"collision"],!1),new U("允许拾取","allowPicking",!1,!1,[this,"allowPicking"],!1)]}}getProperties(e){return[...super.getProperties(e),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new U("允许拾取","是否允许拾取",!1,!1,[this,"allowPicking"]),new mt("飞入","飞入",["number"],n=>this.flyTo(n),[1e3]),new Y("数据","数据",!0,!1,[this,"data"],Ge.defaults.data,Ge.defaults.dataMd),new Y("路径","路径",!1,!1,[this,"uri"]),new U("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"]),new mt("重设时钟","根据当前加载的数据重设始终",[],()=>this.resetClock(),[]),new Fi("loadFnStr","loadFnStr",!0,!1,[this,"loadFuncStr"],Ge.defaults.defaultLoadFuncStr,Ge.defaults.defaultLoadFuncDocStr)]),new H("时钟","时钟",[new U("启用","启用",!1,!1,[this,"clockEnabled"]),new Gi("开始时间","开始时间",!0,!1,[this,"startTime"],Ge.defaults.startTime),new Gi("结束时间","结束时间",!0,!1,[this,"stopTime"],Ge.defaults.stopTime),new Gi("当前时间","当前时间",!0,!1,[this,"currentTime"],Ge.defaults.currentTime),new C("倍速","倍速.",!1,!1,[this,"multiplier"],Ge.defaults.multiplier),new tt("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]]),new tt("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]]),new U("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"])])]}};p(Ge,"type",Ge.register("ESCzml",Ge,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"})),p(Ge,"defaults",{...ft.defaults,show:!0,allowPicking:!0,data:pI,dataMd:gI,autoResetClock:!0,clockEnabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+864e5,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:K0,defaultLoadFuncDocStr:mI});let ul=Ge;(r=>{r.createDefaultProps=()=>({show:!0,uri:"",allowPicking:!1,data:d.reactJsonWithUndefined(void 0),autoResetClock:!0,clockEnabled:!1,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ft.createDefaultProps()})})(ul||(ul={})),d.extendClassProps(ul.prototype,ul.createDefaultProps);const Gl=class Gl extends ft{get typeName(){return"ESNavigator"}get defaultProps(){return Gl.createDefaultProps()}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new C("尺寸","尺寸",!1,!1,[this,"cssSize"]),new se("位置","位置(top,right)",!1,!1,[this,"cssPosition"]),new ku("图片地址","图片地址",!1,!1,[this,"imgUrl"])])]}};p(Gl,"type",Gl.register("ESNavigator",Gl,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"})),p(Gl,"defaults",{...ft.defaults,show:!0,cssPosition:[170,30],cssSize:100,imgUrl:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")});let hl=Gl;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:r.defaults.imgUrl})})(hl||(hl={})),d.extendClassProps(hl.prototype,hl.createDefaultProps);const Li=class Li extends ft{get typeName(){return"ESViewerStatusBar"}get defaultProps(){return Li.createDefaultProps()}constructor(t){super(t)}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],Li.defaults.show),new C("高度","height",!0,!1,[this,"height"],Li.defaults.height),new C("文字大小","fontSize",!0,!1,[this,"fontSize"],Li.defaults.fontSize),new it("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],Li.defaults.bgColor)])]}};p(Li,"type",Li.register("ESViewerStatusBar",Li,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),p(Li,"defaults",{...ft.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let cl=Li;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})})(cl||(cl={})),d.extendClassProps(cl.prototype,cl.createDefaultProps);const Ri=class Ri extends ft{get typeName(){return"ESViewerStatusBarScale"}get defaultProps(){return Ri.createDefaultProps()}constructor(t){super(t)}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],Ri.defaults.show),new C("高度","height",!0,!1,[this,"height"],Ri.defaults.height),new C("文字大小","fontSize",!0,!1,[this,"fontSize"],Ri.defaults.fontSize),new it("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],Ri.defaults.bgColor)])]}};p(Ri,"type",Ri.register("ESViewerStatusBarScale",Ri,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),p(Ri,"defaults",{...ft.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let fl=Ri;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})})(fl||(fl={})),d.extendClassProps(fl.prototype,fl.createDefaultProps);const kl=class kl extends ${get typeName(){return"ESGaussianSplatting"}get defaultProps(){return kl.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new nt("路径","url",!0,!1,[this,"url"]),new C("进度","progress",!1,!0,[this,"progress"],0)]}}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new nt("路径","url",!0,!1,[this,"url"]),new C("进度","progress",!1,!0,[this,"progress"],0)])]}};p(kl,"type",kl.register("ESGaussianSplatting",kl,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"})),p(kl,"defaults",{...$.defaults});let dl=kl;(r=>{r.createDefaultProps=()=>({...$.createDefaultProps(),url:"",progress:0})})(dl||(dl={})),d.extendClassProps(dl.prototype,dl.createDefaultProps);const Xs=class Xs extends ${get typeName(){return"ESStaticMesh"}get defaultProps(){return Xs.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()},e=[new nt("mesh地址","mesh地址",!1,!1,[this,"mesh"],Xs.defaults.mesh)];return t.basic.push(...e),t}getProperties(t){return[...super.getProperties(t),new H("ESStaticMesh","ESStaticMesh",[new nt("mesh地址","mesh地址",!1,!1,[this,"mesh"],Xs.defaults.mesh)])]}};p(Xs,"type",Xs.register("ESStaticMesh",Xs,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"})),p(Xs,"defaults",{...$.defaults,mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"});let pl=Xs;(r=>{r.createDefaultProps=()=>({...$.createDefaultProps(),mesh:""})})(pl||(pl={})),d.extendClassProps(pl.prototype,pl.createDefaultProps);const zl=class zl extends Et{constructor(e){super(e);p(this,"_startEvent",this.dv(new d.Event));p(this,"_clearEvent",this.dv(new d.Event));p(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Os),this._eSGeoExtrudedPolygon.parentID=this.id,this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(d.track([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get typeName(){return"ESSkylineAnalysis"}get defaultProps(){return zl.createDefaultProps()}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt("开始分析","开始分析",[],()=>this.start(),[]),new mt("清除分析","清除分析",[],()=>this.clear(),[]),new Y("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new Y("深度值","depths",!1,!0,[this,"depths"]),new C("半径","半径",!0,!1,[this,"radius"],1e4)]}}getProperties(e){return[...super.getProperties(e),new H("通用","通用",[new mt("开始分析","开始分析",[],()=>this.start(),[]),new mt("清除分析","清除分析",[],()=>this.clear(),[]),new Y("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new Y("深度值","depths",!1,!0,[this,"depths"]),new C("半径","半径",!0,!1,[this,"radius"],1e4)])]}};p(zl,"type",zl.register("ESSkylineAnalysis",zl,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"})),p(zl,"defaults",{...Et.defaults,windowPositions:[],depths:[],radius:1e4});let gl=zl;(r=>{r.createDefaultProps=()=>({...Et.createDefaultProps(),windowPositions:gf(void 0),depths:d.reactArrayWithUndefined(void 0),radius:d.react(void 0)})})(gl||(gl={})),d.extendClassProps(gl.prototype,gl.createDefaultProps);const Rn=class Rn extends Ot{get typeName(){return"ESHeatMap"}get defaultProps(){return Rn.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Y("data","数据",!0,!1,[this,"data"]),new Y("gradient","渐变",!0,!1,[this,"gradient"],Rn.defaults.gradient),new C("radius","半径",!0,!1,[this,"radius"],Rn.defaults.radius),new C("blur","模糊",!0,!1,[this,"blur"],Rn.defaults.blur),new U("is3D","3D",!0,!1,[this,"is3D"])]}}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new Y("data","数据",!0,!1,[this,"data"]),new Y("gradient","渐变",!0,!1,[this,"gradient"],Rn.defaults.gradient),new C("radius","半径",!0,!1,[this,"radius"],Rn.defaults.radius),new C("blur","模糊",!0,!1,[this,"blur"],Rn.defaults.blur),new U("is3D","3D",!0,!1,[this,"is3D"])])]}};p(Rn,"type",Rn.register("ESHeatMap",Rn,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"})),p(Rn,"defaults",{...Ot.defaults,is3D:!1,data:[],radius:10,gradient:{".5":"green",".7":"yellow",".95":"red"},blur:.85});let ml=Rn;(r=>{r.createDefaultProps=()=>({...Ot.createDefaultProps(),is3D:d.react(void 0),data:d.reactPositions(void 0),gradient:d.reactJsonWithUndefined(void 0),radius:d.react(void 0),blur:d.react(void 0)})})(ml||(ml={})),d.extendClassProps(ml.prototype,ml.createDefaultProps);function B0(r){return typeof r=="string"?document.getElementById(r):r}function Ud(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(t),t}class Z0 extends d.Destroyable{constructor(e,n){super();p(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(a,o)=>{if(a)for(let l of a){const u=i.get(l);u&&(u.destroy(),i.delete(l))}if(o)for(let l of o){if(i.get(l)){console.warn(`listeningSceneObjects已存在某对象:${l.name}`,l);debugger}const c=this.createSceneObjectListeningFunc(l);c&&i.set(l,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let a of this._listeningSceneObjects.values())a.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class vI extends d.Destroyable{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class n extends d.Destroyable{constructor(s){super(),this._esPath=s,this.dv(new d.ObjResettingWithEvent(e.activeViewerChanged,()=>{const a=e.activeViewer;if(!a)return;class o extends d.Destroyable{constructor(u){if(super(),this._esPath=u,!a)throw new Error("!viewer");const c=()=>{const h=e.activeViewer;h&&(this._esPath.path.currentTime=h.simulationTime)};c(),this.d(a.simulationTimeChanged.don(c))}}return new o(this._esPath)}))}}this.dv(new Z0(e.sceneObjectsManager,i=>{if(i instanceof Ls)return new n(i)}))}{const e=this._esObjectsManager;class n extends d.Destroyable{constructor(s){super();const a=()=>{const o=e.activeViewer;o&&(o.simulationTime=s.currentTime??0)};a(),this.d(s.currentTimeChanged.don(a))}}this.dv(new Z0(e.sceneObjectsManager,i=>{if(i instanceof As)return new n(i)}))}}}class yI extends d.Destroyable{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(e.path.currentRotationChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class _I extends d.Destroyable{constructor(e){super();p(this,"_player");p(this,"_channels",this.dv(d.reactArray([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new d.ObjResettingWithEvent(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],a=ft.getSceneObjById(s.pathId);if(!a||!(a instanceof Ls))continue;const l=s.sceneObjectIds.map(u=>ft.getSceneObjById(u)).filter(u=>u!==void 0);l.length!==0&&n.push({path:a,sceneObjects:l})}if(n.length!==0)return new yI(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function $c(r){if(r.data){const{type:t,value:e}=r.data;if(t==="UITreeA"&&e instanceof Or){const{sceneObject:n}=e;if(n)return n.id}}}function wI(r,t){const{property:e,customEventName:n,otherParams:i}=t,{dragstartDataMananger:s}=r;if(!(e instanceof li)){if(!(e instanceof sp)){if(e instanceof nt){const[a,o]=d.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;$c(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const u=$c(s);u!==void 0&&o(u)}}else if(e instanceof tp){const[a,o]=d.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;$c(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const l=i[0].$event,u=i[0].strinsPropDom,c=i[0].index;l.preventDefault();const h=$c(s);if(h!==void 0){u[c].firstChild.value=h;const f=new Event("input",{bubbles:!0,cancelable:!0});u[c].firstChild.dispatchEvent(f)}}}else if(e instanceof ep){const[a,o]=d.getReactFuncs(e.reactVar)}}}}function $0(r,t,e,n){if(e)n.currentActiveEditing=[r,t];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===t&&(e||(n.currentActiveEditing=void 0))}}const EI=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class SI extends d.Destroyable{constructor(t,e){super(),this._sceneObject=t;const n=this._sceneObject;for(let i of EI){const s=i+"Changed",a=n[s];if(a){{const o=n[i];$0(n,i,o,e)}this.dispose(a.disposableOn(o=>$0(n,i,o,e)))}}}get sceneObject(){return this._sceneObject}}class PI extends d.Destroyable{constructor(){super();p(this,"_currentActiveEditing",this.disposeVar(d.reactArrayWithUndefined(void 0)));p(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(e){const[i,s]=e;i[s]=!0}})),ft.context.sceneObjCreatedEvent.don(e=>{e.dv(new SI(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class CI extends d.Destroyable{constructor(){super();p(this,"_sceneObjects",new Set);p(this,"_sceneObjectsToChange",this.dv(new d.Event));this.d(()=>{const e=d.length(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){if(this._sceneObjects.has(e))return console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e);while(!1);return!0}deleteSceneObject(e){if(!this._sceneObjects.has(e))return console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e);while(!1);return!0}createSceneObject(e,n){const i=ft.context.createSceneObject(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(e,n){const i=ft.context.createSceneObjectFromClass(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(e){const n=ft.context.createSceneObjectFromJson(e);return n&&this.addSceneObject(n),n}}function j0(r,t){return r.length===t.length&&r.every((e,n)=>e===t[n])}class II extends d.Destroyable{constructor(t){super(),this._viewer=t,this.d(d.track([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class MI extends d.Destroyable{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const n=Di.createCommonProps(),i=[];Object.keys(n).forEach(l=>{const u=this._activeViewer[l+"Changed"];i.push(u)});const s=this.dv(d.createNextAnimateFrameEvent(...i)),a=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(l=>{this._viewer[l]=this._activeViewer[l]})};this.d(s.don(a));const o=this.dv(d.createAnimateFrame());o.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const l=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!l)return;const{position:c,rotation:h}=l;u&&j0(c,u.position)&&j0(h,u.rotation)||this._viewer.flyIn(c,h,0)}),this.d(()=>o.cancel())}}const NI=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
|
|
535
535
|
<animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
|
|
536
536
|
</circle><g></g></g></svg>
|
|
537
|
-
`,bI='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',TI='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Vl=class Vl extends d.Destroyable{constructor(t){super();const e=()=>{const n=this.dv(new wa);this.d(d.track([n,"show"],[t,"useDefaultStatusDiv"]));{const i=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};i(),this.d(t.useDefaultStatusDivChanged.don(i)),this.d(t.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends d.Destroyable{constructor(a,o,l){super();p(this,"_div",document.createElement("div"));if(this._subContainer=a,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const m=()=>{o.show?this._div.style.opacity="1":this._div.style.opacity="0"};m(),this.d(o.showChanged.don(m))}let u,c,h,f,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Vl.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",g=document.createElement("div"),h.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const m=()=>{let E="Raw";l.status==="Raw"?E="初始状态":l.status==="Creating"?E="正在创建":l.status==="Created"?E="创建完成":l.status==="Error"?E="创建失败":l.status==="Reconnecting"&&(E="重新连接"),f.innerText=`${E}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(c.innerHTML=Vl.defaultsSvg.loadingSvg),l.status==="Created"&&(c.innerHTML=Vl.defaultsSvg.successSvg),l.status==="Error"&&(c.innerHTML=Vl.defaultsSvg.warnSvg)};m();const _=this.dv(d.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(_.don(m))}}update(){const a=255*Math.random()|0,o=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${a}, ${o}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};p(Vl,"defaultsSvg",{loadingSvg:NI,successSvg:bI,warnSvg:TI});let qd=Vl;class DI extends d.Destroyable{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,a=this._viewer,o=()=>{const c=a.zIndex??"";i.style.zIndex=c,s.style.zIndex=c};o(),this.d(a.zIndexChanged.don(o));const l=()=>{i.style.display=a.show??!0?"block":"none"};l(),this.d(a.showChanged.don(l));const u=()=>{i.style.opacity=`${a.opacity??1}`};u(),this.d(a.opacityChanged.don(u))}}function jc(r){let t=d.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),d.setExtProp(r,"_relativeContainer",t)),t}class xI extends d.Destroyable{constructor(e,n){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new DI(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),jc(this._container).appendChild(i),this.d(()=>jc(this._container).removeChild(i)),jc(this._container).appendChild(s),this.d(()=>jc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class OI extends d.Destroyable{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type,i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(e)}}class tv extends d.Destroyable{constructor(t,e,n=!1,i=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(d.DomElementEvent.create(e,"pointerdown")),a=this.dv(d.DomElementEvent.create(e,"pointermove")),o=this.dv(d.DomElementEvent.create(e,"pointerup")),l=this.dv(d.DomElementEvent.create(e,"pointerout")),u=this.dv(d.DomElementEvent.create(e,"pointerover")),c=this.dv(new d.PointerClick),h=this.dv(new d.PointerHover),f=()=>{const v=this._viewer.hoverTime*1e3;h.delayTime=v};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(v=>c.pointerDown(v))),this.d(a.don(v=>c.pointerMove(v))),this.d(o.don(v=>c.pointerUp(v))),this.d(l.don(v=>c.pointerOut(v))),this.d(s.don(v=>h.pointerDown(v))),this.d(a.don(v=>h.pointerMove(v))),this.d(o.don(v=>h.pointerUp(v))),this.d(l.don(v=>h.pointerOut(v)));const{x:g,y:m}=e.getBoundingClientRect(),_=i?g:0,E=i?m:0;this.d(h.hoverEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.hoverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.clickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.clickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.dbclickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(s.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(o.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(a.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(u.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(l.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})}));const M=this.dv(d.DomElementEvent.create(e,"keydown"));this.d(M.don(v=>this._viewer.keyDownEvent.emit(v)));const y=this.dv(d.DomElementEvent.create(e,"keyup"));this.d(y.don(v=>this._viewer.keyUpEvent.emit(v)));const w=this.dv(d.DomElementEvent.create(e,"wheel"));this.d(w.don(v=>this._viewer.wheelEvent.emit(v)))}}class AI extends d.Destroyable{constructor(e){super();p(this,"viewer");const n=this.viewer=e;this.ad(new d.ObjResettingWithEvent(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new d.Destroyable;this.viewer.splitPosition=.5;let a=this.getRollerShutterDIV();return i.appendChild(a),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(a)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const n=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const a=i.x/e.parentElement.offsetWidth;e.style.left=`${100*a}%`,this.viewer.splitPosition=a};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",n)}),e}}class LI extends d.Destroyable{constructor(e){super();p(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new AI(e))}}const fs=class fs extends d.Destroyable{constructor(e){super();p(this,"_forceRecreateEvent",this.dv(new d.Event));p(this,"_container",this.dv(d.react(void 0)));p(this,"_containerSize",this.dv(d.react(void 0)));p(this,"_editingEvent",this.disposeVar(new d.Event));p(this,"_status",this.dv(d.react("Raw")));p(this,"_statusLog",this.dv(d.react("")));p(this,"_statusContainer",this.dv(new qd(this)));p(this,"_useCustomInteraction",this.dv(d.react(!0)));p(this,"_resetInteractionEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new d.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new tv(this,this.container)})));p(this,"_viewerChanged",this.dv(new d.Event));p(this,"_containerResetEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new d.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new xI(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_statusInfo",fs.defaults.statusInfo);p(this,"_navigationMode",this.dv(d.react("Map")));p(this,"_syncViewer",this.dv(d.react(void 0)));p(this,"_syncEventDon",this.dv(new d.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new MI(this,e)})));p(this,"_timeSyncdon",this.dv(new d.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new II(this)})));p(this,"_hoverEvent",this.dv(new d.Event));p(this,"_pointerOverEvent",this.dv(new d.Event));p(this,"_pointerMoveEvent",this.dv(new d.Event));p(this,"_pointerDownEvent",this.dv(new d.Event));p(this,"_pointerUpEvent",this.dv(new d.Event));p(this,"_pointerOutEvent",this.dv(new d.Event));p(this,"_clickEvent",this.dv(new d.Event));p(this,"_dblclickEvent",this.dv(new d.Event));p(this,"_keyDownEvent",this.dv(new d.Event));p(this,"_keyUpEvent",this.dv(new d.Event));p(this,"_wheelEvent",this.dv(new d.Event));p(this,"_actived",this.dv(d.react(!1)));this._id=e.id??d.createGuid();const n=B0(e.container);if(n)this._container.value=Ud(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[o,l]of i.entries())if(!l&&o){const u=Oa.context.createEngineObject(o,this);u&&i.set(o,u)}},a=()=>{for(let[o,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(o,void 0)};this.d(a),this.d(this.viewerChanged.don(o=>{a(),o&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(a){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${a}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||d.createAnimateFrame(),s.restart(void 0,a=>{this.updateFunc&&this.updateFunc(this,a)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new LI(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=Ud(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Ud(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){ft.context.addSceneObject(n);const i=Oa.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),ft.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return fs.createDefaultProps()}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[i];a instanceof d.ReactiveVariable?s=a.equals(this[i]):s=a===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(i??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(e){return[new H("ESViewer","ESViewer",[new mt("强制刷新","重载",[],()=>this.forceRecreate(),[]),new U("debug","debug",!0,!1,[this,"debug"],fs.defaults.debug),new U("是否可见","是否可见",!0,!1,[this,"show"]),new tt("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new U("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new nt("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new C("时钟","时钟",!1,!1,[this,"currentTime"]),new U("globeShow","globeShow",!0,!1,[this,"globeShow"]),new U("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new C("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new C("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new H("Globe","Globe",[new Y("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}};p(fs,"context",new OI),p(fs,"register",fs.context.register.bind(fs.context)),p(fs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Di=fs;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:d.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:d.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:d.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:d.react(void 0),rollerShutter:!1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(Di||(Di={})),d.extendClassProps(Di.prototype,Di.createDefaultProps);function ev(r,t){const e=r._lastCameraInfo;if(e){const n=t.viewerChanged.don(i=>{if(!i||!e)return;const{position:s,rotation:a}=e;t.flyIn(s,a,0),r._lastCameraInfo=void 0,n()})}}const RI=r=>{const t=Di.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=r[n]})}catch(n){console.warn(n)}return e},rv=(r,t)=>{const e=Di.createCommonProps();try{Object.keys(e).forEach(n=>{r[n]=t[n]})}catch(n){console.warn(n)}};class FI extends d.Destroyable{constructor(e){super();p(this,"_viewersChanged",this.disposeVar(new d.Event));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new d.Event));this._sceneObjectsManager=e,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?console.warn(`${s.typeName}中已存${a.typeName},检查逻辑是否有问题!`):s.add(a))}),n.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?s.delete(a):console.warn(`${s.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(a=>{a.has(s)&&a.delete(s),console.log("sceneObjectsToChange",a.devTags,s.devTags,Ds(a.devTags,s.devTags)),Ds(a.devTags,s.devTags)&&(a.has(s)?console.warn(`${a.typeName}中已存${s.typeName},检查逻辑是否有问题!`):a.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?console.warn(`${a.typeName}中已存${o.typeName},检查逻辑是否有问题!`):a.add(o))}),n.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?a.delete(o):console.warn(`${a.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(a=>{a.d(a.devTagsChanged.don(()=>{a.clearAllSceneObjects();const o=this._sceneObjectsManager.sceneObjects;for(let l of o)console.log("viewersChanged",a.devTags,l.devTags,Ds(a.devTags,l.devTags)),Ds(a.devTags,l.devTags)&&(a.has(l)?console.warn(`${a.typeName}中已存${l.typeName},检查逻辑是否有问题!`):a.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=Di.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Sa extends d.Destroyable{constructor(...e){super();p(this,"_drgm",this.dv(new d0));p(this,"_sobjm",this.dv(new CI));p(this,"_vrm",this.dv(new FI(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new PI));p(this,"_activeViewer",this.dv(d.react(void 0)));p(this,"_syncOtherViewersToActived",this.dv(d.react(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(ya));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Ah("default",this.dragstartDataMananger,24,this)));p(this,"_propUiTreeManager",this.dv(new Du(24)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new d.Event));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"syncEvent",this.dv(d.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));p(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(As));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new vI(this)));p(this,"_pathAnimationManager",this.dv(new _I(this)))}static get envs(){return ft.context.environmentVariables}getSceneObjectById(e){return ft.getSceneObjectById(e)}getSceneObject(e){return ft.getSceneObject(e)}get $refs(){return ft.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var h;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",a={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:i},o=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:a,viewers:u,sceneTree:o,viewCollection:l,lastView:c}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=e.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return wI(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new Ah(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?RI(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const a=e.id,o=a?[...this.getViewers()].find(c=>c.id===a):[...this.getViewers()].find(c=>c.typeName===e.type);if(o)if(a&&o.typeName!==e.type)console.warn(`id为${a}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(o);else return console.log("ESViewer exists, will be used"),n&&ev(this,o),i&&this._lastActiveViewerJson&&(rv(o,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),o.container===B0(e.container)?(o.containerOrId=e.container,o.forceRecreate()):o.containerOrId=e.container,this.activeViewer=o,o;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return n&&ev(this,l),i&&this._lastActiveViewerJson&&(rv(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:a,id:o}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:o},i??!0,s??!0,a??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:s,attributeSync:a,destroy:o,id:l}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,a,o)}}switchToUEViewer(...e){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:c,token:h,viewSync:f,attributeSync:g,destroy:m,id:_}=e[0];n={type:"ESUeViewer",container:l,id:_,options:{uri:u,app:c,token:h}},i={viewSync:f??!0,attributeSync:g??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:a,destroy:o}=i;return this.switchViewer(n,s,a,o)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}p(Sa,"getSceneObjById",ft.context.getSceneObjectById.bind(ft.context)),p(Sa,"getEnv",ft.context.getEnv.bind(ft.context)),p(Sa,"setEnv",ft.context.setEnv.bind(ft.context)),(r=>{r.createDefaultProps=()=>({})})(Sa||(Sa={})),d.extendClassProps(Sa.prototype,Sa.createDefaultProps);function GI(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const kI=Date.now();function nv(r){const{os:t,arch:e}=GI(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-kI)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},a=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${a}`,s).then(o=>o.text()).then(o=>console.log(o)).catch(o=>console.log("error",o))}N.copyright=void 0;try{const r="earthsdk3",t="3.2.0-beta.8",e="2025-07-10T02:26:15.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="438106fa287696ea5a7360fbf8419c12016c53b4",o=((Date.now()-1752114375e3)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${o}个小时)
|
|
537
|
+
`,bI='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',TI='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Vl=class Vl extends d.Destroyable{constructor(t){super();const e=()=>{const n=this.dv(new wa);this.d(d.track([n,"show"],[t,"useDefaultStatusDiv"]));{const i=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};i(),this.d(t.useDefaultStatusDivChanged.don(i)),this.d(t.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends d.Destroyable{constructor(a,o,l){super();p(this,"_div",document.createElement("div"));if(this._subContainer=a,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const m=()=>{o.show?this._div.style.opacity="1":this._div.style.opacity="0"};m(),this.d(o.showChanged.don(m))}let u,c,h,f,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Vl.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",g=document.createElement("div"),h.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const m=()=>{let E="Raw";l.status==="Raw"?E="初始状态":l.status==="Creating"?E="正在创建":l.status==="Created"?E="创建完成":l.status==="Error"?E="创建失败":l.status==="Reconnecting"&&(E="重新连接"),f.innerText=`${E}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(c.innerHTML=Vl.defaultsSvg.loadingSvg),l.status==="Created"&&(c.innerHTML=Vl.defaultsSvg.successSvg),l.status==="Error"&&(c.innerHTML=Vl.defaultsSvg.warnSvg)};m();const _=this.dv(d.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(_.don(m))}}update(){const a=255*Math.random()|0,o=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${a}, ${o}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};p(Vl,"defaultsSvg",{loadingSvg:NI,successSvg:bI,warnSvg:TI});let qd=Vl;class DI extends d.Destroyable{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,a=this._viewer,o=()=>{const c=a.zIndex??"";i.style.zIndex=c,s.style.zIndex=c};o(),this.d(a.zIndexChanged.don(o));const l=()=>{i.style.display=a.show??!0?"block":"none"};l(),this.d(a.showChanged.don(l));const u=()=>{i.style.opacity=`${a.opacity??1}`};u(),this.d(a.opacityChanged.don(u))}}function jc(r){let t=d.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),d.setExtProp(r,"_relativeContainer",t)),t}class xI extends d.Destroyable{constructor(e,n){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new DI(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),jc(this._container).appendChild(i),this.d(()=>jc(this._container).removeChild(i)),jc(this._container).appendChild(s),this.d(()=>jc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class OI extends d.Destroyable{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type,i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(e)}}class tv extends d.Destroyable{constructor(t,e,n=!1,i=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(d.DomElementEvent.create(e,"pointerdown")),a=this.dv(d.DomElementEvent.create(e,"pointermove")),o=this.dv(d.DomElementEvent.create(e,"pointerup")),l=this.dv(d.DomElementEvent.create(e,"pointerout")),u=this.dv(d.DomElementEvent.create(e,"pointerover")),c=this.dv(new d.PointerClick),h=this.dv(new d.PointerHover),f=()=>{const v=this._viewer.hoverTime*1e3;h.delayTime=v};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(v=>c.pointerDown(v))),this.d(a.don(v=>c.pointerMove(v))),this.d(o.don(v=>c.pointerUp(v))),this.d(l.don(v=>c.pointerOut(v))),this.d(s.don(v=>h.pointerDown(v))),this.d(a.don(v=>h.pointerMove(v))),this.d(o.don(v=>h.pointerUp(v))),this.d(l.don(v=>h.pointerOut(v)));const{x:g,y:m}=e.getBoundingClientRect(),_=i?g:0,E=i?m:0;this.d(h.hoverEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.hoverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.clickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.clickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.dbclickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(s.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(o.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(a.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(u.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(l.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})}));const M=this.dv(d.DomElementEvent.create(e,"keydown"));this.d(M.don(v=>this._viewer.keyDownEvent.emit(v)));const y=this.dv(d.DomElementEvent.create(e,"keyup"));this.d(y.don(v=>this._viewer.keyUpEvent.emit(v)));const w=this.dv(d.DomElementEvent.create(e,"wheel"));this.d(w.don(v=>this._viewer.wheelEvent.emit(v)))}}class AI extends d.Destroyable{constructor(e){super();p(this,"viewer");const n=this.viewer=e;this.ad(new d.ObjResettingWithEvent(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new d.Destroyable;this.viewer.splitPosition=.5;let a=this.getRollerShutterDIV();return i.appendChild(a),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(a)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const n=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const a=i.x/e.parentElement.offsetWidth;e.style.left=`${100*a}%`,this.viewer.splitPosition=a};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",n)}),e}}class LI extends d.Destroyable{constructor(e){super();p(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new AI(e))}}const fs=class fs extends d.Destroyable{constructor(e){super();p(this,"_forceRecreateEvent",this.dv(new d.Event));p(this,"_container",this.dv(d.react(void 0)));p(this,"_containerSize",this.dv(d.react(void 0)));p(this,"_editingEvent",this.disposeVar(new d.Event));p(this,"_status",this.dv(d.react("Raw")));p(this,"_statusLog",this.dv(d.react("")));p(this,"_statusContainer",this.dv(new qd(this)));p(this,"_useCustomInteraction",this.dv(d.react(!0)));p(this,"_resetInteractionEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new d.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new tv(this,this.container)})));p(this,"_viewerChanged",this.dv(new d.Event));p(this,"_containerResetEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new d.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new xI(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_statusInfo",fs.defaults.statusInfo);p(this,"_navigationMode",this.dv(d.react("Map")));p(this,"_syncViewer",this.dv(d.react(void 0)));p(this,"_syncEventDon",this.dv(new d.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new MI(this,e)})));p(this,"_timeSyncdon",this.dv(new d.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new II(this)})));p(this,"_hoverEvent",this.dv(new d.Event));p(this,"_pointerOverEvent",this.dv(new d.Event));p(this,"_pointerMoveEvent",this.dv(new d.Event));p(this,"_pointerDownEvent",this.dv(new d.Event));p(this,"_pointerUpEvent",this.dv(new d.Event));p(this,"_pointerOutEvent",this.dv(new d.Event));p(this,"_clickEvent",this.dv(new d.Event));p(this,"_dblclickEvent",this.dv(new d.Event));p(this,"_keyDownEvent",this.dv(new d.Event));p(this,"_keyUpEvent",this.dv(new d.Event));p(this,"_wheelEvent",this.dv(new d.Event));p(this,"_actived",this.dv(d.react(!1)));this._id=e.id??d.createGuid();const n=B0(e.container);if(n)this._container.value=Ud(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[o,l]of i.entries())if(!l&&o){const u=Oa.context.createEngineObject(o,this);u&&i.set(o,u)}},a=()=>{for(let[o,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(o,void 0)};this.d(a),this.d(this.viewerChanged.don(o=>{a(),o&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(a){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${a}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||d.createAnimateFrame(),s.restart(void 0,a=>{this.updateFunc&&this.updateFunc(this,a)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new LI(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=Ud(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Ud(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){ft.context.addSceneObject(n);const i=Oa.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),ft.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return fs.createDefaultProps()}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[i];a instanceof d.ReactiveVariable?s=a.equals(this[i]):s=a===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(i??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(e){return[new H("ESViewer","ESViewer",[new mt("强制刷新","重载",[],()=>this.forceRecreate(),[]),new U("debug","debug",!0,!1,[this,"debug"],fs.defaults.debug),new U("是否可见","是否可见",!0,!1,[this,"show"]),new tt("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new U("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new nt("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new C("时钟","时钟",!1,!1,[this,"currentTime"]),new U("globeShow","globeShow",!0,!1,[this,"globeShow"]),new U("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new C("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new C("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new H("Globe","Globe",[new Y("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}};p(fs,"context",new OI),p(fs,"register",fs.context.register.bind(fs.context)),p(fs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Di=fs;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:d.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:d.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:d.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:d.react(void 0),rollerShutter:!1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(Di||(Di={})),d.extendClassProps(Di.prototype,Di.createDefaultProps);function ev(r,t){const e=r._lastCameraInfo;if(e){const n=t.viewerChanged.don(i=>{if(!i||!e)return;const{position:s,rotation:a}=e;t.flyIn(s,a,0),r._lastCameraInfo=void 0,n()})}}const RI=r=>{const t=Di.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=r[n]})}catch(n){console.warn(n)}return e},rv=(r,t)=>{const e=Di.createCommonProps();try{Object.keys(e).forEach(n=>{r[n]=t[n]})}catch(n){console.warn(n)}};class FI extends d.Destroyable{constructor(e){super();p(this,"_viewersChanged",this.disposeVar(new d.Event));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new d.Event));this._sceneObjectsManager=e,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?console.warn(`${s.typeName}中已存${a.typeName},检查逻辑是否有问题!`):s.add(a))}),n.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?s.delete(a):console.warn(`${s.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(a=>{a.has(s)&&a.delete(s),console.log("sceneObjectsToChange",a.devTags,s.devTags,Ds(a.devTags,s.devTags)),Ds(a.devTags,s.devTags)&&(a.has(s)?console.warn(`${a.typeName}中已存${s.typeName},检查逻辑是否有问题!`):a.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?console.warn(`${a.typeName}中已存${o.typeName},检查逻辑是否有问题!`):a.add(o))}),n.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?a.delete(o):console.warn(`${a.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(a=>{a.d(a.devTagsChanged.don(()=>{a.clearAllSceneObjects();const o=this._sceneObjectsManager.sceneObjects;for(let l of o)console.log("viewersChanged",a.devTags,l.devTags,Ds(a.devTags,l.devTags)),Ds(a.devTags,l.devTags)&&(a.has(l)?console.warn(`${a.typeName}中已存${l.typeName},检查逻辑是否有问题!`):a.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=Di.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Sa extends d.Destroyable{constructor(...e){super();p(this,"_drgm",this.dv(new d0));p(this,"_sobjm",this.dv(new CI));p(this,"_vrm",this.dv(new FI(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new PI));p(this,"_activeViewer",this.dv(d.react(void 0)));p(this,"_syncOtherViewersToActived",this.dv(d.react(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(ya));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Ah("default",this.dragstartDataMananger,24,this)));p(this,"_propUiTreeManager",this.dv(new Du(24)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new d.Event));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"syncEvent",this.dv(d.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));p(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(As));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new vI(this)));p(this,"_pathAnimationManager",this.dv(new _I(this)))}static get envs(){return ft.context.environmentVariables}getSceneObjectById(e){return ft.getSceneObjectById(e)}getSceneObject(e){return ft.getSceneObject(e)}get $refs(){return ft.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var h;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",a={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:i},o=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:a,viewers:u,sceneTree:o,viewCollection:l,lastView:c}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=e.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return wI(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new Ah(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?RI(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const a=e.id,o=a?[...this.getViewers()].find(c=>c.id===a):[...this.getViewers()].find(c=>c.typeName===e.type);if(o)if(a&&o.typeName!==e.type)console.warn(`id为${a}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(o);else return console.log("ESViewer exists, will be used"),n&&ev(this,o),i&&this._lastActiveViewerJson&&(rv(o,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),o.container===B0(e.container)?(o.containerOrId=e.container,o.forceRecreate()):o.containerOrId=e.container,this.activeViewer=o,o;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return n&&ev(this,l),i&&this._lastActiveViewerJson&&(rv(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:a,id:o}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:o},i??!0,s??!0,a??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:s,attributeSync:a,destroy:o,id:l}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,a,o)}}switchToUEViewer(...e){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:c,token:h,viewSync:f,attributeSync:g,destroy:m,id:_}=e[0];n={type:"ESUeViewer",container:l,id:_,options:{uri:u,app:c,token:h}},i={viewSync:f??!0,attributeSync:g??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:a,destroy:o}=i;return this.switchViewer(n,s,a,o)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}p(Sa,"getSceneObjById",ft.context.getSceneObjectById.bind(ft.context)),p(Sa,"getEnv",ft.context.getEnv.bind(ft.context)),p(Sa,"setEnv",ft.context.setEnv.bind(ft.context)),(r=>{r.createDefaultProps=()=>({})})(Sa||(Sa={})),d.extendClassProps(Sa.prototype,Sa.createDefaultProps);function GI(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const kI=Date.now();function nv(r){const{os:t,arch:e}=GI(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-kI)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},a=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${a}`,s).then(o=>o.text()).then(o=>console.log(o)).catch(o=>console.log("error",o))}N.copyright=void 0;try{const r="earthsdk3",t="3.2.0",e="2025-07-15T07:25:20.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="cafbc70a1827be9781b593faa191b035dbdf5482",o=((Date.now()-175256432e4)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${o}个小时)
|
|
538
538
|
%c${i?i+`
|
|
539
539
|
`:""}当前网站正在使用${r},此软件版权归${n}所有
|
|
540
|
-
`;N.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
540
|
+
`;N.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cafbc70a1827be9781b593faa191b035dbdf5482")},get info(){return l},get date(){return"2025-07-15T07:25:20.000Z"},get author(){return"suplyang"},get version(){return"3.2.0"},get name(){return"earthsdk3"},get commitId(){return"cafbc70a1827be9781b593faa191b035dbdf5482"},print(){console.info(this.info,`
|
|
541
541
|
font-size: 18px;
|
|
542
542
|
font-weight: 1000;
|
|
543
543
|
line-height: 1;
|
package/dist/earthsdk3.js
CHANGED
|
@@ -39449,7 +39449,7 @@ function hp(n) {
|
|
|
39449
39449
|
}
|
|
39450
39450
|
let Ql;
|
|
39451
39451
|
try {
|
|
39452
|
-
const n = "earthsdk3", e = "3.2.0
|
|
39452
|
+
const n = "earthsdk3", e = "3.2.0", t = "2025-07-15T07:25:20.000Z", r = "北京西部世界科技有限公司", i = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", s = "cafbc70a1827be9781b593faa191b035dbdf5482", a = ((Date.now() - 175256432e4) / 36e5).toFixed(1), l = `%c🌏 ${n}%c ${e}.${s.slice(0, 8)}.${t} (距今${a}个小时)
|
|
39453
39453
|
%c${i ? i + `
|
|
39454
39454
|
` : ""}当前网站正在使用${n},此软件版权归${r}所有
|
|
39455
39455
|
`;
|
|
@@ -39463,7 +39463,7 @@ try {
|
|
|
39463
39463
|
},
|
|
39464
39464
|
// @ts-ignore
|
|
39465
39465
|
get gituri() {
|
|
39466
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
39466
|
+
return GITURI_ && GITURI_.replace("${commitId}", "cafbc70a1827be9781b593faa191b035dbdf5482");
|
|
39467
39467
|
},
|
|
39468
39468
|
// @ts-ignore
|
|
39469
39469
|
get info() {
|
|
@@ -39471,7 +39471,7 @@ try {
|
|
|
39471
39471
|
},
|
|
39472
39472
|
// @ts-ignore
|
|
39473
39473
|
get date() {
|
|
39474
|
-
return "2025-07-
|
|
39474
|
+
return "2025-07-15T07:25:20.000Z";
|
|
39475
39475
|
},
|
|
39476
39476
|
// @ts-ignore
|
|
39477
39477
|
get author() {
|
|
@@ -39479,7 +39479,7 @@ try {
|
|
|
39479
39479
|
},
|
|
39480
39480
|
// @ts-ignore
|
|
39481
39481
|
get version() {
|
|
39482
|
-
return "3.2.0
|
|
39482
|
+
return "3.2.0";
|
|
39483
39483
|
},
|
|
39484
39484
|
// @ts-ignore
|
|
39485
39485
|
get name() {
|
|
@@ -39487,7 +39487,7 @@ try {
|
|
|
39487
39487
|
},
|
|
39488
39488
|
// @ts-ignore
|
|
39489
39489
|
get commitId() {
|
|
39490
|
-
return "
|
|
39490
|
+
return "cafbc70a1827be9781b593faa191b035dbdf5482";
|
|
39491
39491
|
},
|
|
39492
39492
|
/**
|
|
39493
39493
|
* 打印版权信息到控制台
|