Skip to content

Commit d6609c2

Browse files
committed
Fix #1595
1 parent 2398961 commit d6609c2

1 file changed

Lines changed: 10 additions & 17 deletions

File tree

example/three/googleMapsExample.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const params = {
3434

3535
orthographic: false,
3636

37-
optimizedLoadStrategy: false,
37+
loadAncestors: true,
3838
loadSiblings: true,
3939

4040
enableCacheDisplay: false,
@@ -62,7 +62,6 @@ function reinstantiateTiles() {
6262
}
6363

6464
tiles = new TilesRenderer();
65-
tiles.lruCache.minSize = 0;
6665
tiles.registerPlugin( new CesiumIonAuthPlugin( { apiToken: import.meta.env.VITE_ION_KEY, assetId: '2275207', autoRefreshToken: true } ) );
6766
tiles.registerPlugin( new TileCompressionPlugin() );
6867
tiles.registerPlugin( new UpdateOnChangePlugin() );
@@ -73,8 +72,6 @@ function reinstantiateTiles() {
7372
// We use unpkg here but in practice should be provided by the application.
7473
dracoLoader: new DRACOLoader().setDecoderPath( 'https://unpkg.com/three@0.153.0/examples/jsm/libs/draco/gltf/' )
7574
} ) );
76-
tiles.optimizedLoadStrategy = params.optimizedLoadStrategy;
77-
tiles.loadSiblings = params.loadSiblings;
7875

7976
if ( params.useFadePlugin ) {
8077

@@ -169,28 +166,22 @@ function init() {
169166
} );
170167

171168
const mapsOptions = gui.addFolder( 'Google Photorealistic Tiles' );
172-
if ( new URLSearchParams( window.location.search ).has( 'showOptimizedSettings' ) ) {
169+
mapsOptions.add( params, 'useBatchedMesh' ).listen();
170+
mapsOptions.add( params, 'useFadePlugin' ).listen();
171+
mapsOptions.add( params, 'loadAncestors' ).listen();
172+
mapsOptions.add( params, 'loadSiblings' ).listen();
173+
mapsOptions.add( params, 'errorTarget', 5, 100, 1 ).onChange( () => {
173174

174-
params.optimizedLoadStrategy = true;
175-
tiles.optimizedLoadStrategy = true;
176-
mapsOptions.add( params, 'optimizedLoadStrategy' ).listen();
177-
mapsOptions.add( params, 'loadSiblings' ).listen();
175+
tiles.getPluginByName( 'UPDATE_ON_CHANGE_PLUGIN' ).needsUpdate = true;
178176

179-
}
177+
} );
180178

181-
mapsOptions.add( params, 'useBatchedMesh' ).listen();
182-
mapsOptions.add( params, 'useFadePlugin' ).listen();
183179
mapsOptions.add( params, 'reload' );
184180

185181
const exampleOptions = gui.addFolder( 'Example Options' );
186182
exampleOptions.add( params, 'displayTopoLines' ).listen();
187183
exampleOptions.add( params, 'enableCacheDisplay' );
188184
exampleOptions.add( params, 'enableRendererStats' );
189-
exampleOptions.add( params, 'errorTarget', 5, 100, 1 ).onChange( () => {
190-
191-
tiles.getPluginByName( 'UPDATE_ON_CHANGE_PLUGIN' ).needsUpdate = true;
192-
193-
} );
194185

195186
// add stats
196187
statsContainer = document.createElement( 'div' );
@@ -361,6 +352,8 @@ function animate() {
361352
// update tiles
362353
camera.updateMatrixWorld();
363354
tiles.errorTarget = params.errorTarget;
355+
tiles.loadSiblings = params.loadSiblings;
356+
tiles.loadAncestors = params.loadAncestors;
364357
tiles.update();
365358

366359
renderer.render( scene, camera );

0 commit comments

Comments
 (0)