From 84b85737fab97a2ba0eb90ba504ec23ddceafffa Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Fri, 10 Jan 2025 00:07:59 +0900 Subject: [PATCH] Simplify ion demo --- example/ionLunar.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/example/ionLunar.js b/example/ionLunar.js index e5ca32a8..26c0aec9 100644 --- a/example/ionLunar.js +++ b/example/ionLunar.js @@ -13,20 +13,9 @@ import { WebGLRenderer, PerspectiveCamera, } from 'three'; -import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js'; let controls, scene, camera, renderer, tiles; -const apiKey = localStorage.getItem( 'ionApiKey' ) ?? import.meta.env.VITE_ION_KEY ?? 'put-your-api-key-here'; -const params = { - - apiKey: apiKey, - reload: reinstantiateTiles, - -}; - -window.ENV = import.meta.env; - init(); animate(); @@ -40,10 +29,8 @@ function reinstantiateTiles() { } - localStorage.setItem( 'ionApiKey', params.apiKey ); - tiles = new TilesRenderer(); - tiles.registerPlugin( new CesiumIonAuthPlugin( { apiToken: params.apiKey, assetId: '2684829', autoRefreshToken: true } ) ); + tiles.registerPlugin( new CesiumIonAuthPlugin( { apiToken: import.meta.env.VITE_ION_KEY, assetId: '2684829', autoRefreshToken: true } ) ); tiles.registerPlugin( new TileCompressionPlugin() ); tiles.registerPlugin( new UpdateOnChangePlugin() ); tiles.registerPlugin( new TilesFadePlugin() ); @@ -79,13 +66,6 @@ function init() { onWindowResize(); window.addEventListener( 'resize', onWindowResize, false ); - // GUI - const gui = new GUI(); - gui.width = 300; - gui.add( params, 'apiKey' ); - gui.add( params, 'reload' ); - gui.close(); - } function onWindowResize() {