cesium_dev_kit 1.1.23 → 1.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/three.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var T=class extends Error{constructor(n,d,h={}){super(`[cesium_dev_kit:${n}] ${d}`),this.name="CesiumDevKitError",this.code=n,this.details=h.details,this.cause=h.cause,Object.setPrototypeOf(this,new.target.prototype);}};function P(t,n){let d=n!=null&&n.scope?`[cesium_dev_kit:${n.scope}]`:"[cesium_dev_kit]";console.warn(d,t,n!=null?n:"");}var M=class{constructor(n){this.viewer=null;this.Cesium=n,this.init_data();}init_data(){this.viewer=null;}init({containerId:n,viewerConfig:d,extraConfig:h,MapImageryList:r,imageryProvider:a,viewer:e}){let i=n,s={contextOptions:{webgl:{alpha:false}},animation:false,timeline:false,fullscreenButton:false,geocoder:false,homeButton:false,selectionIndicator:false,shadow:true,sceneMode:this.Cesium.SceneMode.SCENE3D,infoBox:false,sceneModePicker:false,navigationHelpButton:false,projectionPicker:false,baseLayerPicker:false,shouldAnimate:true,navigation:false,showRenderLoopErrors:true},o=this.findCesiumProvider(a),c=h==null?void 0:h.AccessToken;c&&(this.Cesium.Ion.defaultAccessToken=c),s=Object.assign(s,d);let l=e||new this.Cesium.Viewer(i,{...s,...o});if(h&&!h.logo){let u=l.cesiumWidget.creditContainer;u.style.display="none";}if(h&&h.depthTest&&(l.scene.globe.depthTestAgainstTerrain=true),r&&r.length>0)for(let u=0;u<r.length;u++)this.addImageryProvider(l,r[u].type,r[u].option||r[u].classConfig);if(!e){let u=typeof document=="undefined"?null:i&&i.nodeType===1?i:document.getElementById(i);this.bindContainerResize(l,u);}return this.viewer=l,l}bindContainerResize(n,d){if(typeof ResizeObserver=="undefined"||!d)return;let h=()=>{try{(typeof n.isDestroyed!="function"||!n.isDestroyed())&&n.resize();}catch(e){P(e,{scope:"Controller.bindContainerResize"});}},r=new ResizeObserver(h);r.observe(d),typeof requestAnimationFrame=="function"&&requestAnimationFrame(h);let a=n.destroy.bind(n);n.destroy=function(){try{r.disconnect();}catch(e){P(e,{scope:"Controller.bindContainerResize.disconnect"});}return a()};}addImageryProvider(n,d,h){n.imageryLayers.addImageryProvider(this.createCesiumProvider({type:d,option:h}));}findCesiumProvider(n){let d={};if(!n)return d;for(let h in n){let r=n[h];if(r&&r.type){d[h]=this.createCesiumProvider(r);continue}d[h]=n[h];}return d}createCesiumProvider(n){switch(n.type){case "WebMapTileServiceImageryProvider":return new this.Cesium[n.type](n.option);case "UrlTemplateImageryProvider":return new this.Cesium[n.type](n.option);case "TileMapServiceImageryProvider":return new this.Cesium[n.type](n.option)}}};function U(t,n){if(!n)return "";if(/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(n)||n.startsWith("data:")||n.startsWith("/"))return n;let d=(t||"").replace(/\/+$/,"");return d?d+"/"+n.replace(/^\/+/,""):n}function V(t=""){return {baseService:t,skyBox:{one:{positiveX:"static/data/images/SkyBox/00h+00.jpg",negativeX:"static/data/images/SkyBox/12h+00.jpg",positiveY:"static/data/images/SkyBox/06h+00.jpg",negativeY:"static/data/images/SkyBox/18h+00.jpg",positiveZ:"static/data/images/SkyBox/06h+90.jpg",negativeZ:"static/data/images/SkyBox/06h-90.jpg"},two:{positiveX:"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:"static/data/images/SkyBox/Version2_dark_mz.jpg"},three:{positiveX:"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"},nearOne:{positiveX:"static/data/images/SkyBox/rightav9.jpg",negativeX:"static/data/images/SkyBox/leftav9.jpg",positiveY:"static/data/images/SkyBox/frontav9.jpg",negativeY:"static/data/images/SkyBox/backav9.jpg",positiveZ:"static/data/images/SkyBox/topav9.jpg",negativeZ:"static/data/images/SkyBox/bottomav9.jpg"},nearTwo:{positiveX:"static/data/images/SkyBox/SunSetRight.png",negativeX:"static/data/images/SkyBox/SunSetLeft.png",positiveY:"static/data/images/SkyBox/SunSetFront.png",negativeY:"static/data/images/SkyBox/SunSetBack.png",positiveZ:"static/data/images/SkyBox/SunSetUp.png",negativeZ:"static/data/images/SkyBox/SunSetDown.png"},nearThree:{positiveX:"static/data/images/SkyBox/Right.jpg",negativeX:"static/data/images/SkyBox/Left.jpg",positiveY:"static/data/images/SkyBox/Front.jpg",negativeY:"static/data/images/SkyBox/Back.jpg",positiveZ:"static/data/images/SkyBox/Up.jpg",negativeZ:"static/data/images/SkyBox/Down.jpg"}},drawPointGraphics:"static/data/images/file/location4.png",graphic:{craeteRotateCylinderGraphics:"static/data/images/file/cc2.png",craeteDynamicCricleGraphics:"static/data/images/Textures/circle_bg.png",craeteDynamicShadeWallGraphics:"static/data/images/Textures/fence.png",createCustomDefBillboardGraphics:"static/data/images/file/div1.png"},material:{PolylineCityLinkMaterialProperty:"static/data/images/Textures/meteor_01.png",WarnLinkMaterialProperty:"static/data/images/Textures/jsx2.png"},plugin:{Css3Renderer_one:"static/data/images/Textures/circle2.png",Css3Renderer_two:"static/data/images/Textures/circle1.png"},primitive:{TetrahedronPrimitive:"static/data/images/Textures/fence.png",WaterPrimitive:"static/data/images/Textures/river.png"},passEffect:{satellite:"static/data/images/file/satellite.svg"},amalysis:{createClipPlanAnalysis_wallImg:"static/data/images/file/excavate_side_min.jpg",createClipPlanAnalysis_bottomImg:"static/data/images/file/excavate_bottom_min.jpg",createSubmergedAnalysis:"static/data/images/file/water.png"}}}var ne=Object.assign((t,n)=>t!=null?t:n,{EMPTY_OBJECT:Object.freeze({})}),Y=ne;function j(t){function n(...d){let h=t();return new h(...d)}return n.prototype=t().prototype,Object.defineProperty(n,"__cesiumDevKitCreateModule",{value:t,enumerable:false,configurable:false,writable:false}),n}function E(t){let n=t==null?void 0:t.__cesiumDevKitCreateModule;return typeof n=="function"?n():t}function H(t){if(t)try{if(typeof t.isDestroyed=="function"&&t.isDestroyed())return;typeof t.destroy=="function"&&t.destroy();}catch(n){console.warn("[cesium_dev_kit] failed to dispose viewer:",n);}}var _=new WeakMap;function b(t,n){if(!t||typeof n!="function")return;let d=_.get(t);d?d.push(n):_.set(t,[n]);}function R(t,n){if(!t||!n||t===n)return;let d=_.get(t);if(!d||d.length===0)return;_.delete(t);let h=_.get(n);h?h.push(...d):_.set(n,d);}function A(t){if(!t||typeof t!="object"&&typeof t!="function")return;let n=_.get(t);if(n){_.delete(t);for(let d=n.length-1;d>=0;d--)try{n[d]();}catch(h){console.warn("[cesium_dev_kit] cleanup failed:",h);}}}function z(t){t&&typeof t.destroy!="function"&&Object.defineProperty(t,"destroy",{value:function(){A(this);},enumerable:false,configurable:true,writable:true});}function ae(){let t={},n;class d{constructor(r,a,e){if(r){this._viewer=r,t=a,n=e||V(),this._drawLayer=new t.CustomDataSource("drawLayer"),r&&r.dataSources.add(this._drawLayer);let i=this._drawLayer;z(this),b(this,()=>{this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._drawLayer===i&&(this._drawLayer=void 0));}),this.type="base",this.id="base",this.myname="BASE",this._installBaiduImageryProvider(),this._installGoogleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox();}}createGraphics(){return new t.Entity}_objHasOwnProperty(r,a,e){return r.hasOwnProperty(a)?r[a]:e}getDfSt(r){if(!n)return;let a=n,e=r.reduce((i,s)=>i?i[s]:a[s],void 0);if(e!=null)return typeof e!="string"?e:U(a.baseService,e)}setOneSkyBox(){return new t.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})}setTwoSkyBox(){return new t.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})}setThreeSkyBox(){return new t.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})}setOneGroundSkyBox(){return new t.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})}setTwoGroundSkyBox(){return new t.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})}setThreeGroundSkyBox(){return new t.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})}setDarkEffect(r){r=r||{};var a=`uniform sampler2D colorTexture;
1
+ 'use strict';var T=class extends Error{constructor(n,d,h={}){super(`[cesium_dev_kit:${n}] ${d}`),this.name="CesiumDevKitError",this.code=n,this.details=h.details,this.cause=h.cause,Object.setPrototypeOf(this,new.target.prototype);}};function P(t,n){let d=n!=null&&n.scope?`[cesium_dev_kit:${n.scope}]`:"[cesium_dev_kit]";console.warn(d,t,n!=null?n:"");}var E=class{constructor(n){this.viewer=null;this.Cesium=n,this.init_data();}init_data(){this.viewer=null;}init({containerId:n,viewerConfig:d,extraConfig:h,MapImageryList:r,imageryProvider:a,viewer:e}){let i=n,s={contextOptions:{webgl:{alpha:false}},animation:false,timeline:false,fullscreenButton:false,geocoder:false,homeButton:false,selectionIndicator:false,shadow:true,sceneMode:this.Cesium.SceneMode.SCENE3D,infoBox:false,sceneModePicker:false,navigationHelpButton:false,projectionPicker:false,baseLayerPicker:false,shouldAnimate:true,navigation:false,showRenderLoopErrors:true},o=this.findCesiumProvider(a),c=h==null?void 0:h.AccessToken;c&&(this.Cesium.Ion.defaultAccessToken=c),s=Object.assign(s,d);let l=e||new this.Cesium.Viewer(i,{...s,...o});if(h&&!h.logo){let u=l.cesiumWidget.creditContainer;u.style.display="none";}if(h&&h.depthTest&&(l.scene.globe.depthTestAgainstTerrain=true),r&&r.length>0)for(let u=0;u<r.length;u++)this.addImageryProvider(l,r[u].type,r[u].option||r[u].classConfig);if(!e){let u=typeof document=="undefined"?null:i&&i.nodeType===1?i:document.getElementById(i);this.bindContainerResize(l,u);}return this.viewer=l,l}bindContainerResize(n,d){if(typeof ResizeObserver=="undefined"||!d)return;let h=()=>{try{(typeof n.isDestroyed!="function"||!n.isDestroyed())&&n.resize();}catch(e){P(e,{scope:"Controller.bindContainerResize"});}},r=new ResizeObserver(h);r.observe(d),typeof requestAnimationFrame=="function"&&requestAnimationFrame(h);let a=n.destroy.bind(n);n.destroy=function(){try{r.disconnect();}catch(e){P(e,{scope:"Controller.bindContainerResize.disconnect"});}return a()};}addImageryProvider(n,d,h){n.imageryLayers.addImageryProvider(this.createCesiumProvider({type:d,option:h}));}findCesiumProvider(n){let d={};if(!n)return d;for(let h in n){let r=n[h];if(r&&r.type){d[h]=this.createCesiumProvider(r);continue}d[h]=n[h];}return d}createCesiumProvider(n){switch(n.type){case "WebMapTileServiceImageryProvider":return new this.Cesium[n.type](n.option);case "UrlTemplateImageryProvider":return new this.Cesium[n.type](n.option);case "TileMapServiceImageryProvider":return new this.Cesium[n.type](n.option)}}};function U(t,n){if(!n)return "";if(/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(n)||n.startsWith("data:")||n.startsWith("/"))return n;let d=(t||"").replace(/\/+$/,"");return d?d+"/"+n.replace(/^\/+/,""):n}function V(t=""){return {baseService:t,skyBox:{one:{positiveX:"static/data/images/SkyBox/00h+00.jpg",negativeX:"static/data/images/SkyBox/12h+00.jpg",positiveY:"static/data/images/SkyBox/06h+00.jpg",negativeY:"static/data/images/SkyBox/18h+00.jpg",positiveZ:"static/data/images/SkyBox/06h+90.jpg",negativeZ:"static/data/images/SkyBox/06h-90.jpg"},two:{positiveX:"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:"static/data/images/SkyBox/Version2_dark_mz.jpg"},three:{positiveX:"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"},nearOne:{positiveX:"static/data/images/SkyBox/rightav9.jpg",negativeX:"static/data/images/SkyBox/leftav9.jpg",positiveY:"static/data/images/SkyBox/frontav9.jpg",negativeY:"static/data/images/SkyBox/backav9.jpg",positiveZ:"static/data/images/SkyBox/topav9.jpg",negativeZ:"static/data/images/SkyBox/bottomav9.jpg"},nearTwo:{positiveX:"static/data/images/SkyBox/SunSetRight.png",negativeX:"static/data/images/SkyBox/SunSetLeft.png",positiveY:"static/data/images/SkyBox/SunSetFront.png",negativeY:"static/data/images/SkyBox/SunSetBack.png",positiveZ:"static/data/images/SkyBox/SunSetUp.png",negativeZ:"static/data/images/SkyBox/SunSetDown.png"},nearThree:{positiveX:"static/data/images/SkyBox/Right.jpg",negativeX:"static/data/images/SkyBox/Left.jpg",positiveY:"static/data/images/SkyBox/Front.jpg",negativeY:"static/data/images/SkyBox/Back.jpg",positiveZ:"static/data/images/SkyBox/Up.jpg",negativeZ:"static/data/images/SkyBox/Down.jpg"}},drawPointGraphics:"static/data/images/file/location4.png",graphic:{craeteRotateCylinderGraphics:"static/data/images/file/cc2.png",craeteDynamicCricleGraphics:"static/data/images/Textures/circle_bg.png",craeteDynamicShadeWallGraphics:"static/data/images/Textures/fence.png",createCustomDefBillboardGraphics:"static/data/images/file/div1.png"},material:{PolylineCityLinkMaterialProperty:"static/data/images/Textures/meteor_01.png",WarnLinkMaterialProperty:"static/data/images/Textures/jsx2.png"},plugin:{Css3Renderer_one:"static/data/images/Textures/circle2.png",Css3Renderer_two:"static/data/images/Textures/circle1.png"},primitive:{TetrahedronPrimitive:"static/data/images/Textures/fence.png",WaterPrimitive:"static/data/images/Textures/river.png"},passEffect:{satellite:"static/data/images/file/satellite.svg"},amalysis:{createClipPlanAnalysis_wallImg:"static/data/images/file/excavate_side_min.jpg",createClipPlanAnalysis_bottomImg:"static/data/images/file/excavate_bottom_min.jpg",createSubmergedAnalysis:"static/data/images/file/water.png"}}}var ne=Object.assign((t,n)=>t!=null?t:n,{EMPTY_OBJECT:Object.freeze({})}),Y=ne;function j(t){function n(...d){let h=t();return new h(...d)}return n.prototype=t().prototype,Object.defineProperty(n,"__cesiumDevKitCreateModule",{value:t,enumerable:false,configurable:false,writable:false}),n}function M(t){let n=t==null?void 0:t.__cesiumDevKitCreateModule;return typeof n=="function"?n():t}function H(t){if(t)try{if(typeof t.isDestroyed=="function"&&t.isDestroyed())return;typeof t.destroy=="function"&&t.destroy();}catch(n){console.warn("[cesium_dev_kit] failed to dispose viewer:",n);}}var _=new WeakMap;function b(t,n){if(!t||typeof n!="function")return;let d=_.get(t);d?d.push(n):_.set(t,[n]);}function R(t,n){if(!t||!n||t===n)return;let d=_.get(t);if(!d||d.length===0)return;_.delete(t);let h=_.get(n);h?h.push(...d):_.set(n,d);}function A(t){if(!t||typeof t!="object"&&typeof t!="function")return;let n=_.get(t);if(n){_.delete(t);for(let d=n.length-1;d>=0;d--)try{n[d]();}catch(h){console.warn("[cesium_dev_kit] cleanup failed:",h);}}}function z(t){t&&typeof t.destroy!="function"&&Object.defineProperty(t,"destroy",{value:function(){A(this);},enumerable:false,configurable:true,writable:true});}function ae(){let t={},n;class d{constructor(r,a,e){if(r){this._viewer=r,t=a,n=e||V(),this._drawLayer=new t.CustomDataSource("drawLayer"),r&&r.dataSources.add(this._drawLayer);let i=this._drawLayer;z(this),b(this,()=>{this._viewer&&i&&(this._viewer.dataSources.remove(i,true),this._drawLayer===i&&(this._drawLayer=void 0));}),this.type="base",this.id="base",this.myname="BASE",this._installBaiduImageryProvider(),this._installGoogleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox();}}createGraphics(){return new t.Entity}_objHasOwnProperty(r,a,e){return r.hasOwnProperty(a)?r[a]:e}getDfSt(r){if(!n)return;let a=n,e=r.reduce((i,s)=>i?i[s]:a[s],void 0);if(e!=null)return typeof e!="string"?e:U(a.baseService,e)}setOneSkyBox(){return new t.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})}setTwoSkyBox(){return new t.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})}setThreeSkyBox(){return new t.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})}setOneGroundSkyBox(){return new t.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})}setTwoGroundSkyBox(){return new t.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})}setThreeGroundSkyBox(){return new t.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})}setDarkEffect(r){r=r||{};var a=`uniform sampler2D colorTexture;
2
2
  in vec2 v_textureCoordinates;
3
3
  uniform float scale;
4
4
  uniform vec3 offset;
@@ -136,5 +136,5 @@ void main(void)
136
136
  gl_Position = czm_projection * vec4(p, 1.0);
137
137
  v_texCoord = position.xyz;
138
138
  }
139
- `,Q=typeof u.getRotation=="function"?u.getRotation.bind(u):u.getMatrix3.bind(u);function B(w){this.sources=w.sources,this._sources=void 0,this.show=e(w.show,true),this._command=new v({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var ee=new l;B.prototype.update=function(w,G){var k=this;if(this.show&&!(w.mode!==I.SCENE3D&&w.mode!==I.MORPHING)&&w.passes.render){var D=w.context;if(this._sources!==this.sources){this._sources=this.sources;var y=this.sources;if(!i(y.positiveX)||!i(y.negativeX)||!i(y.positiveY)||!i(y.negativeY)||!i(y.positiveZ)||!i(y.negativeZ))throw new o("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof y.positiveX!=typeof y.negativeX||typeof y.positiveX!=typeof y.positiveY||typeof y.positiveX!=typeof y.negativeY||typeof y.positiveX!=typeof y.positiveZ||typeof y.positiveX!=typeof y.negativeZ)throw new o("this.sources properties must all be the same type.");typeof y.positiveX=="string"?x(D,this._sources).then(function(ie){k._cubeMap=k._cubeMap&&k._cubeMap.destroy(),k._cubeMap=ie;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new S({context:D,source:y}));}var C=this._command;if(C.modelMatrix=m.eastNorthUpToFixedFrame(w.camera._positionWC),!i(C.vertexArray)){C.uniformMap={u_cubeMap(){return k._cubeMap},u_rotateMatrix(){return Q(C.modelMatrix,ee)}};var F=r.createGeometry(r.fromDimensions({dimensions:new a(2,2,2),vertexFormat:p.POSITION_ONLY})),te=this._attributeLocations=c.createAttributeLocations(F);C.vertexArray=O.fromGeometry({context:D,geometry:F,attributeLocations:te,bufferUsage:f._DRAW}),C.renderState=g.fromCache({blending:L.ALPHA_BLEND});}if(!i(C.shaderProgram)||this._useHdr!==G){var re=new K({defines:[G?"HDR":""],sources:[q]});C.shaderProgram=J.fromCache({context:D,vertexShaderSource:$,fragmentShaderSource:re,attributeLocations:this._attributeLocations}),this._useHdr=G;}if(i(this._cubeMap))return C}},B.prototype.isDestroyed=function(){return false},B.prototype.destroy=function(){var w=this._command;return w.vertexArray=w.vertexArray&&w.vertexArray.destroy(),w.shaderProgram=w.shaderProgram&&w.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),s(this)},t.Scene.GroundSkyBox=B;}removeHandlerByName(r=[]){r.forEach(a=>{this._viewer.screenSpaceEventHandler.removeInputAction(t.ScreenSpaceEventType[a]);});}}return d}j(ae);function se(t,n,d,h){function r(a,e){let i={},s=E(e),o=[];if(Array.isArray(a))a.forEach(l=>{let u=E(l),m=new u(t,n,d,h);c(u,s),o.push(m);}),i=new s(t,n,d,h),o.forEach(l=>Object.assign(i,l)),o.forEach(l=>R(l,i));else {let l=E(a),u=new l(t,n,d,h);c(l,s),i=new s(t,n,d,h),Object.assign(i,u),R(u,i);}function c(l,u){let m=Object.getOwnPropertyNames(l.prototype);for(let p=0,f=m.length;p<f;p++)m[p]!=="constructor"&&(u.prototype[m[p]]=l.prototype[m[p]]);}return i}return r}function oe({cesiumGlobal:t,threeGlobal:n,containerId:d,threeContainerId:h,viewerConfig:r={},extraConfig:a={},MapImageryList:e=[],defaultStatic:i,baseExtendsCom:s=[],extendsCom:o,extendsComName:c,viewer:l}){if(!t)throw new T("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!d&&!l)throw new T("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");let m=new M(t).init({containerId:d,viewerConfig:r,extraConfig:a,MapImageryList:e,viewer:l}),p=!l,v=se(m,t,i,n?{threeGlobal:n,containerId:d,threeContainerId:h}:"")(s,o),x=false;return {viewer:m,[c]:v,dispose:()=>{if(!x){x=true;try{typeof v.destroy=="function"?v.destroy():A(v);}catch(g){P(g,{scope:"singleImport.dispose"});}p&&H(m);}}}}function X(t,n,d){function h(r){return oe({...r,baseExtendsCom:t,extendsCom:n,extendsComName:d})}return h}function Z({THREE:t,Cesium:n,viewer:d}){function h(a,e){e||(e=new t.BufferGeometry);let i=a.attributes;for(let c in i)if(i.hasOwnProperty(c)&&i[c]){var s=i[c],o=s.values;o instanceof Float64Array&&(o=new Float32Array(o));let l=new t.BufferAttribute(o,s.componentsPerAttribute,s.normalize);e.setAttribute(c,l);}if(i.st&&(e.attributes.uv=e.attributes.st,e.deleteAttribute("st")),a.indices){let c=new t.BufferAttribute(a.indices,1,false);e.setIndex(c);}if(a.boundingSphere){let c=a.boundingSphere;e.boundingSphere||(e.boundingSphere=new t.Sphere),e.boundingSphere.center.copy(c.center),e.boundingSphere.radius=c.radius;}return e}class r extends t.Scene{constructor(e={}){if(super(),this.type="ThreeCesiumScene",!e.cesiumDom)throw new Error("THREE.ThreeCesiumScene not found cesiumDom.");if(!e.camera||!(e.camera instanceof t.PerspectiveCamera))throw new Error("THREE.ThreeCesiumScene (not found cesiumDom) OR ( not THREE.PerspectiveCamera ).");if(!e.renderer)throw new Error("THREE.ThreeCesiumScene not found THREE.WebGLRender.");this.options=e,this.cesiumViewer=d;let s=(typeof e.cesiumDom=="string"?document.getElementById(e.cesiumDom):e.cesiumDom).children[0].children;for(let g=0;g<s.length;g++)g!==0&&(s[g].style.zIndex="100");this.ellipsoid=this.cesiumViewer.scene.globe.ellipsoid,e.threeHabit&&(this.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes=[n.CameraEventType.LEFT_DRAG],this.cesiumViewer.scene.screenSpaceCameraController.zoomEventTypes=[n.CameraEventType.MIDDLE_DRAG,n.CameraEventType.WHEEL,n.CameraEventType.PINCH],this.cesiumViewer.scene.screenSpaceCameraController.rotateEventTypes=[n.CameraEventType.RIGHT_DRAG]),this.camera=e.camera,this.cameraOffset=new t.Vector3,this.renderer=e.renderer,this.lngLat=e.lngLat&&e.lngLat.length>1?e.lngLat:[114.23,31.55],this.cameraCenter=new t.Vector3(0,0,0);let o=new n.EllipsoidGeometry({vertexFormat:n.VertexFormat.POSITION_ONLY,radii:new n.Cartesian3(this.ellipsoid.maximumRadius-1,this.ellipsoid.maximumRadius-1,this.ellipsoid.minimumRadius-1),slicePartitions:1024,stackPartitions:1024}),c=h(n.EllipsoidGeometry.createGeometry(o)),l=new t.MeshBasicMaterial({color:"#ff00ff",blending:t.MultiplyBlending}),u=new t.Mesh(c,l);e.axesHelper&&u.add(new t.AxesHelper(8e6)),super.add(u),this.sphere=u;let m=new t.Group;super.add(m),this.syncGroup=m;let p=new t.SphereGeometry(this.ellipsoid.minimumRadius,512,256,0,Math.PI*2,3.1,Math.PI-3.1),f=new t.MeshBasicMaterial({color:"#fff00f",blending:t.MultiplyBlending}),S=new t.Mesh(p,f);S.rotateX(90*Math.PI/180),S.position.z=this.ellipsoid.minimumRadius,this.sphere3=S;let v=new t.Group;v.rotateX(-90*Math.PI/180),v.position.z=-1,this.syncGroup=m,this.childrenGroup=v,this.sunUp=new t.Group,this.sunLightColor=new t.Color,this.sunLightIntensity=1;let x=this.cesiumViewer.scene.light;if(this.sunLightColor.r=x.color.red,this.sunLightColor.g=x.color.green,this.sunLightColor.b=x.color.blue,this.sunLightIntensity=x.intensity,this.sun=new t.DirectionalLight(this.sunLightColor,this.sunLightIntensity),this.sun.castShadow=true,this.sun.shadow.camera.far=Math.pow(10,14),this.sun.position.set(0,0,this.ellipsoid.maximumRadius*2+1e3),this.sun.target=this.childrenGroup,this.sunUp.add(this.sun),m.add(S),m.add(v),m.add(this.sunUp),this._enableLighting=false,Object.defineProperty(this,"enableLighting",{get(){return this._enableLighting},set(g){if(this.cesiumViewer.scene.globe.enableLighting=g,this._enableLighting=g,g){this.sun.visible=true;return}this.sun.visible=false;}}),e.enableLighting!==void 0&&e.enableLighting!==null&&(this.enableLighting=e.enableLighting),e.cesiumLayers&&e.cesiumLayers.length>0)for(let g=0;g<e.cesiumLayers.length;g++)this.addImageryProvider(e.cesiumLayers[g].type,e.cesiumLayers[g].option);}renderCesium(){return this.cesiumViewer.isDestroyed()||this.cesiumViewer.resize(),this.cesiumViewer.render(),this}renderThree(){return this.renderer.render(this,this.camera),this}updateSunMatrix(){if(this.isColumbusViewMode())return this;let e=this.cesiumViewer.scene.sun._boundingVolume.center,i=this.cartesian3ToVector(e);return this.sunUp.lookAt(i.x-this.cameraOffset.x,i.y-this.cameraOffset.y,-(i.z-this.cameraOffset.z)),this}updateCameraMatrix(){this.camera.fov=n.Math.toDegrees(this.cesiumViewer.camera.frustum.fovy),this.camera.updateProjectionMatrix(),this.camera.matrixAutoUpdate=false;let e=this.cesiumViewer.camera.viewMatrix,i=this.cesiumViewer.camera.inverseViewMatrix;this.camera.lookAt(this.cameraCenter),this.camera.matrixWorld.set(i[0],i[4],i[8],i[12]-this.cameraOffset.x,i[1],i[5],i[9],i[13]-this.cameraOffset.y,i[2],i[6],i[10],i[14]-this.cameraOffset.z,i[3],i[7],i[11],i[15]),this.camera.matrixWorldInverse.set(e[0],e[4],e[8],e[12]-this.cameraOffset.x,e[1],e[5],e[9],e[13]-this.cameraOffset.y,e[2],e[6],e[10],e[14]-this.cameraOffset.z,e[3],e[7],e[11],e[15]);let s=this.cesiumViewer.scene.canvas.clientWidth,o=this.cesiumViewer.scene.canvas.clientHeight;return this.camera.aspect=s/o,this.camera.updateProjectionMatrix(),this.renderer.setSize(s,o),this}isColumbusViewMode(){return this.cesiumViewer.scene.mode===n.SceneMode.COLUMBUS_VIEW}isThreeRenderable(){let e=this.cesiumViewer.scene;return e.mode===n.SceneMode.SCENE2D?false:Math.abs(e.morphTime)<n.Math.EPSILON6||Math.abs(e.morphTime-1)<n.Math.EPSILON6}getSceneOriginPosition(){return this.isColumbusViewMode()?this.cartesianToCVWorld(n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)):n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)}cartesianToCVWorld(e){let i=this.cesiumViewer.scene.mapProjection.project(n.Cartographic.fromCartesian(e));return new t.Vector3(i.z,i.x,i.y)}updateGroupMatrixWorld(){if(this.isColumbusViewMode())return this.cameraOffset.copy(this.getSceneOriginPosition()),this.syncGroup.rotation.set(-Math.PI/2,-Math.PI/2,0),this.syncGroup.updateMatrix(),this.syncGroup.up.set(1,0,0),this.up.set(1,0,0),this.sphere.visible=false,this.sphere3.visible=false,this;this.sphere.visible=true,this.sphere3.visible=true;let e=this.cartesian3ToVector(n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)),i=this.cartesian3ToVector(n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],2)),s=new t.Vector3().subVectors(e,i).normalize();return this.syncGroup.up.set(0,0,-1),this.syncGroup.lookAt(s),this.syncGroup.up.copy(s),this.syncGroup.updateMatrix(),this.cameraOffset.copy(e),this.syncGroup.up.set(0,0,-1),this.up.set(0,0,-1),this}update(){this.updateSunMatrix(),this.updateGroupMatrixWorld(),this.updateCameraMatrix(),this.isThreeRenderable()?this.renderThree():this.renderer.clear(),this.renderCesium();}add(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.childrenGroup.add(arguments[i]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this.childrenGroup,this.childrenGroup.children.push(e),e.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.childrenGroup.remove(arguments[s]);return this}let i=this.childrenGroup.children.indexOf(e);return i!==-1&&(e.parent=null,this.childrenGroup.children.splice(i,1),e.dispatchEvent({type:"removed"})),this}clear(){for(let e=0;e<this.childrenGroup.children.length;e++){let i=this.childrenGroup.children[e];i.parent=null,i.dispatchEvent({type:"removed"});}return this.childrenGroup.children.length=0,this}traverse(e){e(this.childrenGroup);let i=this.childrenGroup.children;for(let s=0,o=i.length;s<o;s++)i[s].traverse(e);}traverseVisible(e){if(this.visible===false||this.childrenGroup.visible===false)return;e(this.childrenGroup);let i=this.childrenGroup.children;for(let s=0,o=i.length;s<o;s++)i[s].traverseVisible(e);}toJSON(e){let i=e===void 0||typeof e=="string",s={};i&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{},options:{}},s.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let o={};if(o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.castShadow===true&&(o.castShadow=true),this.receiveShadow===true&&(o.receiveShadow=true),this.visible===false&&(o.visible=false),this.frustumCulled===false&&(o.frustumCulled=false),this.renderOrder!==0&&(o.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(o.userData=this.userData),o.layers=this.layers.mask,o.matrix=this.matrix.toArray(),this.matrixAutoUpdate===false&&(o.matrixAutoUpdate=false),this.background&&(this.background.isColor?o.background=this.background.toJSON():this.background.isTexture&&(o.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(o.environment=this.environment.toJSON(e).uuid),this.fog!==null&&(o.fog=this.fog.toJSON()),this.options){o.options={};for(let l in this.options)["camera","renderer"].includes(l)||(o.options[l]=this.options[l]);}if(this.childrenGroup.children.length>0){o.children=[];for(let l=0;l<this.childrenGroup.children.length;l++)o.children.push(this.childrenGroup.children[l].toJSON(e).object);}if(i){let l=c(e.geometries),u=c(e.materials),m=c(e.textures),p=c(e.images),f=c(e.shapes),S=c(e.skeletons),v=c(e.animations),x=c(e.nodes);l.length>0&&(s.geometries=l),u.length>0&&(s.materials=u),m.length>0&&(s.textures=m),p.length>0&&(s.images=p),f.length>0&&(s.shapes=f),S.length>0&&(s.skeletons=S),v.length>0&&(s.animations=v),x.length>0&&(s.nodes=x);}return o.isGIS=true,s.object=o,s;function c(l){let u=[];for(let m in l){let p=l[m];delete p.metadata,u.push(p);}return u}}dispose(){this.update=()=>{},this.renderCesium=()=>{},this.renderThree=()=>{},this.updateSunMatrix=()=>{},this.updateCameraMatrix=()=>{},this.updateGroupMatrixWorld=()=>{},this.cesiumViewer.destroy();}cartesian3ToVector(e){return new t.Vector3(e.x,e.y,e.z)}positionToCartesian(e){if(Array.isArray(e))return n.Cartesian3.fromDegrees(e[0],e[1],e.length>2?e[2]:0);if(e&&typeof e=="object"){if(typeof e.longitude=="number"&&typeof e.latitude=="number")return n.Cartesian3.fromRadians(e.longitude,e.latitude,e.height||0);if(typeof e.x=="number"&&typeof e.y=="number"&&typeof e.z=="number")return new n.Cartesian3(e.x,e.y,e.z)}throw new Error("THREE.ThreeCesiumScene: invalid position, expect [lng, lat, height] | Cesium.Cartesian3 | Cesium.Cartographic.")}positionToWorldVector(e){let i=this.positionToCartesian(e),s=this.getSceneOriginPosition();if(this.isColumbusViewMode()){let o=this.cartesianToCVWorld(i);return new t.Vector3(o.x-s.x,o.y-s.y,o.z-s.z)}return new t.Vector3(i.x-s.x,i.y-s.y,i.z-s.z)}setObjectPosition(e,i){if(!e||!e.isObject3D)return console.error("THREE.ThreeCesiumScene.setObjectPosition: object must be an instance of THREE.Object3D.",e),this;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let s=this.positionToWorldVector(i);return e.position.copy(this.childrenGroup.worldToLocal(s)),this}getObjectPosition(e){if(!e||!e.isObject3D)return console.error("THREE.ThreeCesiumScene.getObjectPosition: object must be an instance of THREE.Object3D.",e),null;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let i=this.getSceneOriginPosition(),s=this.childrenGroup.localToWorld(e.position.clone()),o=new n.Cartesian3(s.x+i.x,s.y+i.y,s.z+i.z),c;return this.isColumbusViewMode()?c=this.cesiumViewer.scene.mapProjection.unproject(new n.Cartesian3(o.y,o.z,o.x)):c=n.Cartographic.fromCartesian(o),[n.Math.toDegrees(c.longitude),n.Math.toDegrees(c.latitude),c.height]}}return r.prototype.isScene=true,r.prototype.isGIS=true,r}function ce(){let t=null,n=null,d=function(h,r,a,e){if(h&&e){let{threeGlobal:i,containerId:s,threeContainerId:o}=e;t=r,n=i,this._viewer=h,this._containerId=s,this._threeContainerId=o,this._Scene=Z({THREE:n,Cesium:t,viewer:h}),this._initContainer(),z(this),b(this,()=>{this.destroyThreeJS();});}};return d.prototype={_initContainer:function(){if(this.cesiumContainer=void 0,this.threeContainer=void 0,this.cesiumContainer=document.getElementById(this._containerId),this.threeContainer=document.getElementById(this._threeContainerId),this.cesiumContainer)this.cesiumContainer.style.position!=="absolute"&&(this.cesiumContainer.style.position="absolute",this.cesiumContainer.style.top=0,this.cesiumContainer.style.left=0,this.cesiumContainer.style.height="100%",this.cesiumContainer.style.width="100%",this.cesiumContainer.style.margin=0,this.cesiumContainer.style.overflow="hidden",this.cesiumContainer.style.padding=0,this.cesiumContainer.style.fontFamily="sans-serif");else return alert("\u672A\u83B7\u53D6\u5230 cesiumContainer \u5BB9\u5668!"),false;if(!this.threeContainer){var h=document.getElementsByTagName("body")[0];h&&(this.threeContainer=document.createElement("div"),this.threeContainer.id=this._threeContainerId,this.threeContainer.style.position="absolute",this.threeContainer.style.top=0,this.threeContainer.style.left=0,this.threeContainer.style.height="100%",this.threeContainer.style.width="100%",this.threeContainer.style.margin=0,this.threeContainer.style.overflow="hidden",this.threeContainer.style.padding=0,this.threeContainer.style.fontFamily="sans-serif",this.threeContainer.style.pointerEvents="none",h.appendChild(this.threeContainer));}},initThree:function(h){var r=h.fov||45,a=window.innerWidth,e=window.innerHeight,i=h.aspect||a/e,s=h.near||1,o=h.far||10*1e3*1e3;return this._three={renderer:null,camera:null,scene:null},this._three.camera=new n.PerspectiveCamera(r,i,s,o),this._three.renderer=new n.WebGLRenderer({alpha:true,antialias:true,logarithmicDepthBuffer:true,stencil:true,depth:true}),this._three.renderer.outputEncoding=n.sRGBEncoding,this._three.renderer.shadowMap.enabled=true,this._three.renderer.shadowMap.type=n.PCFSoftShadowMap,this._three.scene=new this._Scene({cesiumDom:this._containerId,threeHabit:this._objHasOwnProperty(h,"threeHabit",true),enableLighting:this._objHasOwnProperty(h,"enableLighting",true),axesHelper:this._objHasOwnProperty(h,"axesHelper",false),camera:this._three.camera,renderer:this._three.renderer,lngLat:h.center||[104.081701757991,30.627042558105988]}),this.threeContainer&&this.threeContainer.appendChild(this._three.renderer.domElement),this._three},loop(h){let r=a=>{this._rafId=requestAnimationFrame(r),h&&h(a);};this._rafId=requestAnimationFrame(r);},setPosition(h,r){return !this._three||!this._three.scene?(console.error("ThreeJs.setPosition: please call initThree first."),this):(this._three.scene.setObjectPosition(h,r),this)},getPosition(h){return !this._three||!this._three.scene?(console.error("ThreeJs.getPosition: please call initThree first."),null):this._three.scene.getObjectPosition(h)},_objHasOwnProperty(h,r,a){return h.hasOwnProperty(r)?h[r]:a},destroyThreeJS(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._three&&this._three.scene&&typeof this._three.scene.dispose=="function"&&this._three.scene.dispose();}},d}var N=j(ce);var Me=X([],N,"threeJs");exports.ThreeJs=Me;//# sourceMappingURL=three.cjs.map
139
+ `,Q=typeof u.getRotation=="function"?u.getRotation.bind(u):u.getMatrix3.bind(u);function B(w){this.sources=w.sources,this._sources=void 0,this.show=e(w.show,true),this._command=new v({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0;}var ee=new l;B.prototype.update=function(w,G){var k=this;if(this.show&&!(w.mode!==I.SCENE3D&&w.mode!==I.MORPHING)&&w.passes.render){var D=w.context;if(this._sources!==this.sources){this._sources=this.sources;var y=this.sources;if(!i(y.positiveX)||!i(y.negativeX)||!i(y.positiveY)||!i(y.negativeY)||!i(y.positiveZ)||!i(y.negativeZ))throw new o("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof y.positiveX!=typeof y.negativeX||typeof y.positiveX!=typeof y.positiveY||typeof y.positiveX!=typeof y.negativeY||typeof y.positiveX!=typeof y.positiveZ||typeof y.positiveX!=typeof y.negativeZ)throw new o("this.sources properties must all be the same type.");typeof y.positiveX=="string"?x(D,this._sources).then(function(ie){k._cubeMap=k._cubeMap&&k._cubeMap.destroy(),k._cubeMap=ie;}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new S({context:D,source:y}));}var C=this._command;if(C.modelMatrix=m.eastNorthUpToFixedFrame(w.camera._positionWC),!i(C.vertexArray)){C.uniformMap={u_cubeMap(){return k._cubeMap},u_rotateMatrix(){return Q(C.modelMatrix,ee)}};var F=r.createGeometry(r.fromDimensions({dimensions:new a(2,2,2),vertexFormat:p.POSITION_ONLY})),te=this._attributeLocations=c.createAttributeLocations(F);C.vertexArray=O.fromGeometry({context:D,geometry:F,attributeLocations:te,bufferUsage:f._DRAW}),C.renderState=g.fromCache({blending:L.ALPHA_BLEND});}if(!i(C.shaderProgram)||this._useHdr!==G){var re=new K({defines:[G?"HDR":""],sources:[q]});C.shaderProgram=J.fromCache({context:D,vertexShaderSource:$,fragmentShaderSource:re,attributeLocations:this._attributeLocations}),this._useHdr=G;}if(i(this._cubeMap))return C}},B.prototype.isDestroyed=function(){return false},B.prototype.destroy=function(){var w=this._command;return w.vertexArray=w.vertexArray&&w.vertexArray.destroy(),w.shaderProgram=w.shaderProgram&&w.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),s(this)},t.Scene.GroundSkyBox=B;}removeHandlerByName(r=[]){r.forEach(a=>{this._viewer.screenSpaceEventHandler.removeInputAction(t.ScreenSpaceEventType[a]);});}}return d}j(ae);function se(t,n,d,h){function r(a,e){let i={},s=M(e),o=[];if(Array.isArray(a))a.forEach(l=>{let u=M(l),m=new u(t,n,d,h);c(u,s),o.push(m);}),i=new s(t,n,d,h),o.forEach(l=>Object.assign(i,l)),o.forEach(l=>R(l,i));else {let l=M(a),u=new l(t,n,d,h);c(l,s),i=new s(t,n,d,h),Object.assign(i,u),R(u,i);}function c(l,u){let m=Object.getOwnPropertyNames(l.prototype);for(let p=0,f=m.length;p<f;p++)m[p]!=="constructor"&&(u.prototype[m[p]]=l.prototype[m[p]]);}return i}return r}function oe({cesiumGlobal:t,threeGlobal:n,containerId:d,threeContainerId:h,viewerConfig:r={},extraConfig:a={},MapImageryList:e=[],defaultStatic:i,baseExtendsCom:s=[],extendsCom:o,extendsComName:c,viewer:l}){if(!t)throw new T("MISSING_CESIUM","\u7F3A\u5C11 Cesium \u5168\u5C40\u5BF9\u8C61\uFF0C\u8BF7\u4F20\u5165 cesiumGlobal\uFF08\u6216\u522B\u540D Cesium\uFF09\u3002");if(!d&&!l)throw new T("MISSING_VIEWER","\u7F3A\u5C11 containerId \u6216 viewer\uFF1A\u8BF7\u4F20\u5165\u6302\u8F7D\u5BB9\u5668 id\uFF0C\u6216\u76F4\u63A5\u4F20\u5165\u5DF2\u521B\u5EFA\u7684 viewer\u3002");let m=new E(t).init({containerId:d,viewerConfig:r,extraConfig:a,MapImageryList:e,viewer:l}),p=!l,v=se(m,t,i,n?{threeGlobal:n,containerId:d,threeContainerId:h}:"")(s,o),x=false;return {viewer:m,[c]:v,dispose:()=>{if(!x){x=true;try{typeof v.destroy=="function"?v.destroy():A(v);}catch(g){P(g,{scope:"singleImport.dispose"});}p&&H(m);}}}}function X(t,n,d){function h(r){return oe({...r,baseExtendsCom:t,extendsCom:n,extendsComName:d})}return h}function Z({THREE:t,Cesium:n,viewer:d}){function h(a,e){e||(e=new t.BufferGeometry);let i=a.attributes;for(let c in i)if(i.hasOwnProperty(c)&&i[c]){var s=i[c],o=s.values;o instanceof Float64Array&&(o=new Float32Array(o));let l=new t.BufferAttribute(o,s.componentsPerAttribute,s.normalize);e.setAttribute(c,l);}if(i.st&&(e.attributes.uv=e.attributes.st,e.deleteAttribute("st")),a.indices){let c=new t.BufferAttribute(a.indices,1,false);e.setIndex(c);}if(a.boundingSphere){let c=a.boundingSphere;e.boundingSphere||(e.boundingSphere=new t.Sphere),e.boundingSphere.center.copy(c.center),e.boundingSphere.radius=c.radius;}return e}class r extends t.Scene{constructor(e={}){if(super(),this.type="ThreeCesiumScene",!e.cesiumDom)throw new Error("THREE.ThreeCesiumScene not found cesiumDom.");if(!e.camera||!(e.camera instanceof t.PerspectiveCamera))throw new Error("THREE.ThreeCesiumScene (not found cesiumDom) OR ( not THREE.PerspectiveCamera ).");if(!e.renderer)throw new Error("THREE.ThreeCesiumScene not found THREE.WebGLRender.");this.options=e,this.cesiumViewer=d;let s=(typeof e.cesiumDom=="string"?document.getElementById(e.cesiumDom):e.cesiumDom).children[0].children;for(let g=0;g<s.length;g++)g!==0&&(s[g].style.zIndex="100");this.ellipsoid=this.cesiumViewer.scene.globe.ellipsoid,e.threeHabit&&(this.cesiumViewer.scene.screenSpaceCameraController.tiltEventTypes=[n.CameraEventType.LEFT_DRAG],this.cesiumViewer.scene.screenSpaceCameraController.zoomEventTypes=[n.CameraEventType.MIDDLE_DRAG,n.CameraEventType.WHEEL,n.CameraEventType.PINCH],this.cesiumViewer.scene.screenSpaceCameraController.rotateEventTypes=[n.CameraEventType.RIGHT_DRAG]),this.camera=e.camera,this.cameraOffset=new t.Vector3,this.renderer=e.renderer,this.lngLat=e.lngLat&&e.lngLat.length>1?e.lngLat:[114.23,31.55],this.cameraCenter=new t.Vector3(0,0,0);let o=new n.EllipsoidGeometry({vertexFormat:n.VertexFormat.POSITION_ONLY,radii:new n.Cartesian3(this.ellipsoid.maximumRadius-1,this.ellipsoid.maximumRadius-1,this.ellipsoid.minimumRadius-1),slicePartitions:1024,stackPartitions:1024}),c=h(n.EllipsoidGeometry.createGeometry(o)),l=new t.MeshBasicMaterial({color:"#ff00ff",blending:t.MultiplyBlending}),u=new t.Mesh(c,l);e.axesHelper&&u.add(new t.AxesHelper(8e6)),super.add(u),this.sphere=u;let m=new t.Group;super.add(m),this.syncGroup=m;let p=new t.SphereGeometry(this.ellipsoid.minimumRadius,512,256,0,Math.PI*2,3.1,Math.PI-3.1),f=new t.MeshBasicMaterial({color:"#fff00f",blending:t.MultiplyBlending}),S=new t.Mesh(p,f);S.rotateX(90*Math.PI/180),S.position.z=this.ellipsoid.minimumRadius,this.sphere3=S;let v=new t.Group;v.rotateX(-90*Math.PI/180),v.position.z=-1,this.syncGroup=m,this.childrenGroup=v,this.sunUp=new t.Group,this.sunLightColor=new t.Color,this.sunLightIntensity=1;let x=this.cesiumViewer.scene.light;if(this.sunLightColor.r=x.color.red,this.sunLightColor.g=x.color.green,this.sunLightColor.b=x.color.blue,this.sunLightIntensity=x.intensity,this.sun=new t.DirectionalLight(this.sunLightColor,this.sunLightIntensity),this.sun.castShadow=true,this.sun.shadow.camera.far=Math.pow(10,14),this.sun.position.set(0,0,this.ellipsoid.maximumRadius*2+1e3),this.sun.target=this.childrenGroup,this.sunUp.add(this.sun),m.add(S),m.add(v),m.add(this.sunUp),this._enableLighting=false,Object.defineProperty(this,"enableLighting",{get(){return this._enableLighting},set(g){if(this.cesiumViewer.scene.globe.enableLighting=g,this._enableLighting=g,g){this.sun.visible=true;return}this.sun.visible=false;}}),e.enableLighting!==void 0&&e.enableLighting!==null&&(this.enableLighting=e.enableLighting),e.cesiumLayers&&e.cesiumLayers.length>0)for(let g=0;g<e.cesiumLayers.length;g++)this.addImageryProvider(e.cesiumLayers[g].type,e.cesiumLayers[g].option);}renderCesium(){return this.cesiumViewer.isDestroyed()||this.cesiumViewer.resize(),this.cesiumViewer.render(),this}renderThree(){return this.renderer.render(this,this.camera),this}updateSunMatrix(){if(this.isColumbusViewMode())return this;let e=this.cesiumViewer.scene.sun._boundingVolume.center,i=this.cartesian3ToVector(e);return this.sunUp.lookAt(i.x-this.cameraOffset.x,i.y-this.cameraOffset.y,-(i.z-this.cameraOffset.z)),this}updateCameraMatrix(){this.camera.fov=n.Math.toDegrees(this.cesiumViewer.camera.frustum.fovy),this.camera.updateProjectionMatrix(),this.camera.matrixAutoUpdate=false;let e=this.cesiumViewer.camera.viewMatrix,i=this.cesiumViewer.camera.inverseViewMatrix;this.camera.lookAt(this.cameraCenter),this.camera.matrixWorld.set(i[0],i[4],i[8],i[12]-this.cameraOffset.x,i[1],i[5],i[9],i[13]-this.cameraOffset.y,i[2],i[6],i[10],i[14]-this.cameraOffset.z,i[3],i[7],i[11],i[15]),this.camera.matrixWorldInverse.set(e[0],e[4],e[8],e[12]-this.cameraOffset.x,e[1],e[5],e[9],e[13]-this.cameraOffset.y,e[2],e[6],e[10],e[14]-this.cameraOffset.z,e[3],e[7],e[11],e[15]);let s=this.cesiumViewer.scene.canvas.clientWidth,o=this.cesiumViewer.scene.canvas.clientHeight;return this.camera.aspect=s/o,this.camera.updateProjectionMatrix(),this.renderer.setSize(s,o),this}isColumbusViewMode(){return this.cesiumViewer.scene.mode===n.SceneMode.COLUMBUS_VIEW}isThreeRenderable(){let e=this.cesiumViewer.scene;return e.mode===n.SceneMode.SCENE2D?false:Math.abs(e.morphTime)<n.Math.EPSILON6||Math.abs(e.morphTime-1)<n.Math.EPSILON6}getSceneOriginPosition(){return this.isColumbusViewMode()?this.cartesianToCVWorld(n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)):n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)}cartesianToCVWorld(e){let i=this.cesiumViewer.scene.mapProjection.project(n.Cartographic.fromCartesian(e));return new t.Vector3(i.z,i.x,i.y)}updateGroupMatrixWorld(){if(this.isColumbusViewMode())return this.cameraOffset.copy(this.getSceneOriginPosition()),this.syncGroup.rotation.set(-Math.PI/2,-Math.PI/2,0),this.syncGroup.updateMatrix(),this.syncGroup.up.set(1,0,0),this.up.set(1,0,0),this.sphere.visible=false,this.sphere3.visible=false,this;this.sphere.visible=true,this.sphere3.visible=true;let e=this.cartesian3ToVector(n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],0)),i=this.cartesian3ToVector(n.Cartesian3.fromDegrees(this.lngLat[0],this.lngLat[1],2)),s=new t.Vector3().subVectors(e,i).normalize();return this.syncGroup.up.set(0,0,-1),this.syncGroup.lookAt(s),this.syncGroup.up.copy(s),this.syncGroup.updateMatrix(),this.cameraOffset.copy(e),this.syncGroup.up.set(0,0,-1),this.up.set(0,0,-1),this}update(){this.updateSunMatrix(),this.updateGroupMatrixWorld(),this.renderCesium(),this.updateCameraMatrix(),this.isThreeRenderable()?this.renderThree():this.renderer.clear();}add(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.childrenGroup.add(arguments[i]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this.childrenGroup,this.childrenGroup.children.push(e),e.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.childrenGroup.remove(arguments[s]);return this}let i=this.childrenGroup.children.indexOf(e);return i!==-1&&(e.parent=null,this.childrenGroup.children.splice(i,1),e.dispatchEvent({type:"removed"})),this}clear(){for(let e=0;e<this.childrenGroup.children.length;e++){let i=this.childrenGroup.children[e];i.parent=null,i.dispatchEvent({type:"removed"});}return this.childrenGroup.children.length=0,this}traverse(e){e(this.childrenGroup);let i=this.childrenGroup.children;for(let s=0,o=i.length;s<o;s++)i[s].traverse(e);}traverseVisible(e){if(this.visible===false||this.childrenGroup.visible===false)return;e(this.childrenGroup);let i=this.childrenGroup.children;for(let s=0,o=i.length;s<o;s++)i[s].traverseVisible(e);}toJSON(e){let i=e===void 0||typeof e=="string",s={};i&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{},options:{}},s.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let o={};if(o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.castShadow===true&&(o.castShadow=true),this.receiveShadow===true&&(o.receiveShadow=true),this.visible===false&&(o.visible=false),this.frustumCulled===false&&(o.frustumCulled=false),this.renderOrder!==0&&(o.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(o.userData=this.userData),o.layers=this.layers.mask,o.matrix=this.matrix.toArray(),this.matrixAutoUpdate===false&&(o.matrixAutoUpdate=false),this.background&&(this.background.isColor?o.background=this.background.toJSON():this.background.isTexture&&(o.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(o.environment=this.environment.toJSON(e).uuid),this.fog!==null&&(o.fog=this.fog.toJSON()),this.options){o.options={};for(let l in this.options)["camera","renderer"].includes(l)||(o.options[l]=this.options[l]);}if(this.childrenGroup.children.length>0){o.children=[];for(let l=0;l<this.childrenGroup.children.length;l++)o.children.push(this.childrenGroup.children[l].toJSON(e).object);}if(i){let l=c(e.geometries),u=c(e.materials),m=c(e.textures),p=c(e.images),f=c(e.shapes),S=c(e.skeletons),v=c(e.animations),x=c(e.nodes);l.length>0&&(s.geometries=l),u.length>0&&(s.materials=u),m.length>0&&(s.textures=m),p.length>0&&(s.images=p),f.length>0&&(s.shapes=f),S.length>0&&(s.skeletons=S),v.length>0&&(s.animations=v),x.length>0&&(s.nodes=x);}return o.isGIS=true,s.object=o,s;function c(l){let u=[];for(let m in l){let p=l[m];delete p.metadata,u.push(p);}return u}}dispose(){this.update=()=>{},this.renderCesium=()=>{},this.renderThree=()=>{},this.updateSunMatrix=()=>{},this.updateCameraMatrix=()=>{},this.updateGroupMatrixWorld=()=>{},this.cesiumViewer.destroy();}cartesian3ToVector(e){return new t.Vector3(e.x,e.y,e.z)}positionToCartesian(e){if(Array.isArray(e))return n.Cartesian3.fromDegrees(e[0],e[1],e.length>2?e[2]:0);if(e&&typeof e=="object"){if(typeof e.longitude=="number"&&typeof e.latitude=="number")return n.Cartesian3.fromRadians(e.longitude,e.latitude,e.height||0);if(typeof e.x=="number"&&typeof e.y=="number"&&typeof e.z=="number")return new n.Cartesian3(e.x,e.y,e.z)}throw new Error("THREE.ThreeCesiumScene: invalid position, expect [lng, lat, height] | Cesium.Cartesian3 | Cesium.Cartographic.")}positionToWorldVector(e){let i=this.positionToCartesian(e),s=this.getSceneOriginPosition();if(this.isColumbusViewMode()){let o=this.cartesianToCVWorld(i);return new t.Vector3(o.x-s.x,o.y-s.y,o.z-s.z)}return new t.Vector3(i.x-s.x,i.y-s.y,i.z-s.z)}setObjectPosition(e,i){if(!e||!e.isObject3D)return console.error("THREE.ThreeCesiumScene.setObjectPosition: object must be an instance of THREE.Object3D.",e),this;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let s=this.positionToWorldVector(i);return e.position.copy(this.childrenGroup.worldToLocal(s)),this}getObjectPosition(e){if(!e||!e.isObject3D)return console.error("THREE.ThreeCesiumScene.getObjectPosition: object must be an instance of THREE.Object3D.",e),null;this.updateGroupMatrixWorld(),this.updateMatrixWorld(true);let i=this.getSceneOriginPosition(),s=this.childrenGroup.localToWorld(e.position.clone()),o=new n.Cartesian3(s.x+i.x,s.y+i.y,s.z+i.z),c;return this.isColumbusViewMode()?c=this.cesiumViewer.scene.mapProjection.unproject(new n.Cartesian3(o.y,o.z,o.x)):c=n.Cartographic.fromCartesian(o),[n.Math.toDegrees(c.longitude),n.Math.toDegrees(c.latitude),c.height]}}return r.prototype.isScene=true,r.prototype.isGIS=true,r}function ce(){let t=null,n=null,d=function(h,r,a,e){if(h&&e){let{threeGlobal:i,containerId:s,threeContainerId:o}=e;t=r,n=i,this._viewer=h,this._containerId=s,this._threeContainerId=o,this._Scene=Z({THREE:n,Cesium:t,viewer:h}),this._initContainer(),z(this),b(this,()=>{this.destroyThreeJS();});}};return d.prototype={_initContainer:function(){if(this.cesiumContainer=void 0,this.threeContainer=void 0,this.cesiumContainer=document.getElementById(this._containerId),this.threeContainer=document.getElementById(this._threeContainerId),this.cesiumContainer)this.cesiumContainer.style.position!=="absolute"&&(this.cesiumContainer.style.position="absolute",this.cesiumContainer.style.top=0,this.cesiumContainer.style.left=0,this.cesiumContainer.style.height="100%",this.cesiumContainer.style.width="100%",this.cesiumContainer.style.margin=0,this.cesiumContainer.style.overflow="hidden",this.cesiumContainer.style.padding=0,this.cesiumContainer.style.fontFamily="sans-serif");else return alert("\u672A\u83B7\u53D6\u5230 cesiumContainer \u5BB9\u5668!"),false;if(!this.threeContainer){var h=document.getElementsByTagName("body")[0];h&&(this.threeContainer=document.createElement("div"),this.threeContainer.id=this._threeContainerId,this.threeContainer.style.position="absolute",this.threeContainer.style.top=0,this.threeContainer.style.left=0,this.threeContainer.style.height="100%",this.threeContainer.style.width="100%",this.threeContainer.style.margin=0,this.threeContainer.style.overflow="hidden",this.threeContainer.style.padding=0,this.threeContainer.style.fontFamily="sans-serif",this.threeContainer.style.pointerEvents="none",h.appendChild(this.threeContainer));}},initThree:function(h){var r=h.fov||45,a=window.innerWidth,e=window.innerHeight,i=h.aspect||a/e,s=h.near||1,o=h.far||10*1e3*1e3;return this._three={renderer:null,camera:null,scene:null},this._three.camera=new n.PerspectiveCamera(r,i,s,o),this._three.renderer=new n.WebGLRenderer({alpha:true,antialias:true,logarithmicDepthBuffer:true,stencil:true,depth:true}),this._three.renderer.outputEncoding=n.sRGBEncoding,this._three.renderer.shadowMap.enabled=true,this._three.renderer.shadowMap.type=n.PCFSoftShadowMap,this._three.scene=new this._Scene({cesiumDom:this._containerId,threeHabit:this._objHasOwnProperty(h,"threeHabit",true),enableLighting:this._objHasOwnProperty(h,"enableLighting",true),axesHelper:this._objHasOwnProperty(h,"axesHelper",false),camera:this._three.camera,renderer:this._three.renderer,lngLat:h.center||[104.081701757991,30.627042558105988]}),this.threeContainer&&this.threeContainer.appendChild(this._three.renderer.domElement),this._three},loop(h){let r=a=>{this._rafId=requestAnimationFrame(r),h&&h(a);};this._rafId=requestAnimationFrame(r);},setPosition(h,r){return !this._three||!this._three.scene?(console.error("ThreeJs.setPosition: please call initThree first."),this):(this._three.scene.setObjectPosition(h,r),this)},getPosition(h){return !this._three||!this._three.scene?(console.error("ThreeJs.getPosition: please call initThree first."),null):this._three.scene.getObjectPosition(h)},_objHasOwnProperty(h,r,a){return h.hasOwnProperty(r)?h[r]:a},destroyThreeJS(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._three&&this._three.scene&&typeof this._three.scene.dispose=="function"&&this._three.scene.dispose();}},d}var N=j(ce);var Ee=X([],N,"threeJs");exports.ThreeJs=Ee;//# sourceMappingURL=three.cjs.map
140
140
  //# sourceMappingURL=three.cjs.map