Skip to content

Commit

Permalink
상단의control 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiliaBaek committed Jul 19, 2024
1 parent c694540 commit 5fb6675
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,4 +428,4 @@
}`;function j(s){const t=document.createElement("style");t.innerHTML=s;const e=document.querySelector("head link[rel=stylesheet], head style");e?document.head.insertBefore(t,e):document.head.appendChild(t)}let L=!1;class k{constructor({parent:t,autoPlace:e=t===void 0,container:i,width:n,title:l="Controls",closeFolders:a=!1,injectStyles:c=!0,touchStyles:m=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(l),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),m&&this.domElement.classList.add("allow-touch-styles"),!L&&c&&(j(X),L=!0),i?i.appendChild(this.domElement):e&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this._closeFolders=a}add(t,e,i,n,l){if(Object(i)===i)return new J(this,t,e,i);const a=t[e];switch(typeof a){case"number":return new P(this,t,e,i,n,l);case"boolean":return new V(this,t,e);case"string":return new G(this,t,e);case"function":return new $(this,t,e)}console.error(`gui.add failed
property:`,e,`
object:`,t,`
value:`,a)}addColor(t,e,i=1){return new Y(this,t,e,i)}addFolder(t){const e=new k({parent:this,title:t});return this.root._closeFolders&&e.close(),e}load(t,e=!0){return t.controllers&&this.controllers.forEach(i=>{i instanceof $||i._name in t.controllers&&i.load(t.controllers[i._name])}),e&&t.folders&&this.folders.forEach(i=>{i._title in t.folders&&i.load(t.folders[i._title])}),this}save(t=!0){const e={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof $)){if(i._name in e.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);e.controllers[i._name]=i.save()}}),t&&this.folders.forEach(i=>{if(i._title in e.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);e.folders[i._title]=i.save()}),e}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const e=this.$children.clientHeight;this.$children.style.height=e+"px",this.domElement.classList.add("transition");const i=l=>{l.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.textContent=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(e=>{t=t.concat(e.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(e=>{t=t.concat(e.foldersRecursive())}),t}}const R=k;Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlZjExOWQwMC1kYzAxLTRkMWItODlkYi1lZTBlZDMwODUxMDkiLCJpZCI6MTc0MDU5LCJpYXQiOjE3MDI0Mjk2OTd9.kXkbjmi5g_uc2C1W792H1eyzEYFcD7MJ2btivj4For0";const A=new Cesium.Viewer("container",{homeButton:!1,sceneModePicker:!1,terrainShadows:!0,scene3DOnly:!0,contextOptions:{webgl:{depth:!0,failIfMajorPerformanceCaveat:!0,powerPreference:"high-performance",webgl2:!0}}});A._cesiumWidget._creditContainer.style.display="none";A.scene.globe.enableLighting=!0;const N=A.scene;N.globe.depthTestAgainstTerrain=!0;const W=async()=>{A.terrainProvider=await Cesium.CesiumTerrainProvider.fromIonAssetId(2670083,{requestVertexNormals:!0})};W();const K=[2669366,2669368,2669363,2669376,2669354,2669355,2669356,2669357,2669358,2669359,2669360,2669361,2669370,2669371,2669372,2669373,2669374,2669375,2669377,2669378,2669379,2669380,2669382,2669383,2669384,2669385,2669386,2669387,2669388,2669389,2669390,2669391,2669392,2669393,2669394,2669395,2669396,2669397,2669398,2669399,2669400,2669401,2669403,2669405,2669406,2669407,2669408,2669409,2669410,2669411,2669412,2669413,2669414,2669415,2669416,2669417,2669418,2669489,2669490,2669491,2669492,2669493,2669494,2669495,2669496,2669498,2669500,2669501,2669502,2669503,2669504,2669506,2669507,2669509,2669510,2669511,2669513,2669514,2669515,2669516,2669517,2669518,2669519,2669522,2669523,2669524,2669525,2669526,2669527,2669528,2669529,2669531,2669533,2669534,2669535,2669537,2669539,2669540,2669541,2669542,2669543,2669544,2669545,2669546,2669547,2669548,2669549,2669551,2669552,2669553,2669554,2669555];function U(s,t){var e=parseInt(s.slice(1,3),16),i=parseInt(s.slice(3,5),16),n=parseInt(s.slice(5,7),16);return"rgba("+e+", "+i+", "+n+", "+t+")"}const D=(s,t)=>{let e=U(s,t);M.forEach(i=>{i.style=new Cesium.Cesium3DTileStyle({color:`color("${e}")`})})};let Z=280;const F=new R,_={color:"#ffffff",opacity:1};F.add(_,"opacity",0,1,.001).onChange(s=>{D(_.color,s)});F.addColor(_,"color").onChange(s=>{D(s,_.opacity)});let S=[];const M=[];try{S=K.map(async(s,t)=>{const e=await Cesium.IonResource.fromAssetId(s),i=await Cesium.Cesium3DTileset.fromUrl(e,{skipLevelOfDetail:!0,baseScreenSpaceError:8e3,skipScreenSpaceErrorFactor:8,skipLevels:1,maximumScreenSpaceError:8}),n=i.asset.extras;return Cesium.defined(n)&&Cesium.defined(n.ion)&&Cesium.defined(n.ion.defaultStyle)&&(i.style=new Cesium.Cesium3DTileStyle(n.ion.defaultStyle)),M.push(i),A.scene.primitives.add(i)});try{Promise.all(S)}catch(s){console.error("promise-all",s)}}catch(s){console.log(s)}setTimeout(()=>A.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(127.147117,37.511847,800),orientation:{heading:Cesium.Math.toRadians(Z),pitch:Cesium.Math.toRadians(-35),roll:0}}),5e3);
value:`,a)}addColor(t,e,i=1){return new Y(this,t,e,i)}addFolder(t){const e=new k({parent:this,title:t});return this.root._closeFolders&&e.close(),e}load(t,e=!0){return t.controllers&&this.controllers.forEach(i=>{i instanceof $||i._name in t.controllers&&i.load(t.controllers[i._name])}),e&&t.folders&&this.folders.forEach(i=>{i._title in t.folders&&i.load(t.folders[i._title])}),this}save(t=!0){const e={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof $)){if(i._name in e.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);e.controllers[i._name]=i.save()}}),t&&this.folders.forEach(i=>{if(i._title in e.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);e.folders[i._title]=i.save()}),e}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const e=this.$children.clientHeight;this.$children.style.height=e+"px",this.domElement.classList.add("transition");const i=l=>{l.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.textContent=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(e=>{t=t.concat(e.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(e=>{t=t.concat(e.foldersRecursive())}),t}}const R=k;Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlZjExOWQwMC1kYzAxLTRkMWItODlkYi1lZTBlZDMwODUxMDkiLCJpZCI6MTc0MDU5LCJpYXQiOjE3MDI0Mjk2OTd9.kXkbjmi5g_uc2C1W792H1eyzEYFcD7MJ2btivj4For0";const A=new Cesium.Viewer("container",{baseLayerPicker:!1,homeButton:!1,sceneModePicker:!1,terrainShadows:!0,scene3DOnly:!0,contextOptions:{webgl:{depth:!0,failIfMajorPerformanceCaveat:!0,powerPreference:"high-performance",webgl2:!0}}});A._cesiumWidget._creditContainer.style.display="none";A.scene.globe.enableLighting=!0;const N=A.scene;N.globe.depthTestAgainstTerrain=!0;const W=async()=>{A.terrainProvider=await Cesium.CesiumTerrainProvider.fromIonAssetId(2670083,{requestVertexNormals:!0})};W();const K=[2669366,2669368,2669363,2669376,2669354,2669355,2669356,2669357,2669358,2669359,2669360,2669361,2669370,2669371,2669372,2669373,2669374,2669375,2669377,2669378,2669379,2669380,2669382,2669383,2669384,2669385,2669386,2669387,2669388,2669389,2669390,2669391,2669392,2669393,2669394,2669395,2669396,2669397,2669398,2669399,2669400,2669401,2669403,2669405,2669406,2669407,2669408,2669409,2669410,2669411,2669412,2669413,2669414,2669415,2669416,2669417,2669418,2669489,2669490,2669491,2669492,2669493,2669494,2669495,2669496,2669498,2669500,2669501,2669502,2669503,2669504,2669506,2669507,2669509,2669510,2669511,2669513,2669514,2669515,2669516,2669517,2669518,2669519,2669522,2669523,2669524,2669525,2669526,2669527,2669528,2669529,2669531,2669533,2669534,2669535,2669537,2669539,2669540,2669541,2669542,2669543,2669544,2669545,2669546,2669547,2669548,2669549,2669551,2669552,2669553,2669554,2669555];function U(s,t){var e=parseInt(s.slice(1,3),16),i=parseInt(s.slice(3,5),16),n=parseInt(s.slice(5,7),16);return"rgba("+e+", "+i+", "+n+", "+t+")"}const D=(s,t)=>{let e=U(s,t);M.forEach(i=>{i.style=new Cesium.Cesium3DTileStyle({color:`color("${e}")`})})};let Z=280;const F=new R,_={color:"#ffffff",opacity:1};F.add(_,"opacity",0,1,.001).onChange(s=>{D(_.color,s)});F.addColor(_,"color").onChange(s=>{D(s,_.opacity)});let S=[];const M=[];try{S=K.map(async(s,t)=>{const e=await Cesium.IonResource.fromAssetId(s),i=await Cesium.Cesium3DTileset.fromUrl(e,{skipLevelOfDetail:!0,baseScreenSpaceError:8e3,skipScreenSpaceErrorFactor:8,skipLevels:1,maximumScreenSpaceError:8}),n=i.asset.extras;return Cesium.defined(n)&&Cesium.defined(n.ion)&&Cesium.defined(n.ion.defaultStyle)&&(i.style=new Cesium.Cesium3DTileStyle(n.ion.defaultStyle)),M.push(i),A.scene.primitives.add(i)});try{Promise.all(S)}catch(s){console.error("promise-all",s)}}catch(s){console.log(s)}setTimeout(()=>A.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(127.147117,37.511847,800),orientation:{heading:Cesium.Math.toRadians(Z),pitch:Cesium.Math.toRadians(-35),roll:0}}),5e3);
2 changes: 1 addition & 1 deletion sample/cesium3DReconSeoulColor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
}
</script>
<script type="module" crossorigin src="./assets/index-3dc8d1b4.js"></script>
<script type="module" crossorigin src="./assets/index-2f28c849.js"></script>
</head>
<body>
<!-- <div id="info">
Expand Down
23 changes: 12 additions & 11 deletions sample/cesium3dReconSeoulWhiteBox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@
<script type="module" >
Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlZjExOWQwMC1kYzAxLTRkMWItODlkYi1lZTBlZDMwODUxMDkiLCJpZCI6MTc0MDU5LCJpYXQiOjE3MDI0Mjk2OTd9.kXkbjmi5g_uc2C1W792H1eyzEYFcD7MJ2btivj4For0";
const viewer = new Cesium.Viewer("app", {
// animation: false,
// skyBox: false,
// // 응답이 있어야 rendering update 되는 항목
// // requestRenderMode: true,
// baseLayerPicker: false,
// 응답이 있어야 rendering update 되는 항목
// requestRenderMode: true,
baseLayerPicker: false,
// geocoder: false,
// homeButton: false,
homeButton: false,
// infoBox: false,
// sceneModePicker: false,
sceneModePicker: false,
terrainShadows: true,
// selectionIndicator: false,
// // timeline: false,
// timeline: false,
// navigationHelpButton: false,
// navigationInstructionsInitiallyVisible: false,
// scene3DOnly: true,
// // 바닥 Image 설정
// // globe: false,
terrainShadows: true,

scene3DOnly: true,
// 바닥 Image 설정
// globe: false,
// terrain: Cesium.Terrain.fromWorldTerrain(),
contextOptions: {
webgl: {
// antialias: true, // 안티 앨리어싱 사용
Expand Down

0 comments on commit 5fb6675

Please sign in to comment.