Skip to content

Commit

Permalink
Adjust google tiles renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jan 12, 2024
1 parent 6978e1b commit 3495700
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/three/renderers/GoogleTilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const GoogleTilesRendererMixin = base => class extends base {
this.lruCache.maxSize = 5000;
this.errorTarget = 40;

this.onLoadTileSet = tileset => {
const onLoadCallback = () => {

// find the session id in the first sub tile set
let session;
Expand Down Expand Up @@ -60,12 +60,13 @@ const GoogleTilesRendererMixin = base => class extends base {

};

// clear the callback once the root is loaded
this.onLoadTileSet = null;
this.removeEventListener( 'load-tile-set', onLoadCallback );

};

this.onTileVisibilityChange = ( scene, tile, visible ) => {
this.addEventListener( 'load-tile-set', onLoadCallback );

this.addEventListener( 'tile-visibility-change', ( scene, tile, visible ) => {

const copyright = tile.cached.metadata.asset.copyright || '';
if ( visible ) {
Expand All @@ -78,7 +79,7 @@ const GoogleTilesRendererMixin = base => class extends base {

}

};
} );

}

Expand Down

0 comments on commit 3495700

Please sign in to comment.