Skip to content

Commit

Permalink
Remove load index from TilesRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jan 9, 2025
1 parent e6cc699 commit 1f0cae0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/base/TilesRendererBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ export class TilesRendererBase {

} else {

return this.invokeOnePlugin( plugin => plugin.parseTile && plugin.parseTile( content, parseTile, extension, uri ) );
return this.invokeOnePlugin( plugin => plugin.parseTile && plugin.parseTile( content, parseTile, extension, uri, signal ) );

}

Expand Down
10 changes: 2 additions & 8 deletions src/three/TilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ export class TilesRenderer extends TilesRendererBase {

tile.cached = {

_loadIndex: 0,
transform,
transformInverse,

Expand All @@ -571,18 +570,15 @@ export class TilesRenderer extends TilesRendererBase {

}

async parseTile( buffer, tile, extension, uri ) {
async parseTile( buffer, tile, extension, uri, abortSignal ) {

const cached = tile.cached;
cached._loadIndex ++;

const uriSplits = uri.split( /[\\/]/g );
uriSplits.pop();
const workingPath = uriSplits.join( '/' );
const fetchOptions = this.fetchOptions;

const manager = this.manager;
const loadIndex = cached._loadIndex;
let promise = null;

const cachedTransform = cached.transform;
Expand Down Expand Up @@ -697,7 +693,7 @@ export class TilesRenderer extends TilesRendererBase {
} );

// exit early if a new request has already started
if ( cached._loadIndex !== loadIndex ) {
if ( abortSignal.aborted ) {

return;

Expand Down Expand Up @@ -859,8 +855,6 @@ export class TilesRenderer extends TilesRendererBase {

}

cached._loadIndex ++;

}

setTileVisible( tile, visible ) {
Expand Down

0 comments on commit 1f0cae0

Please sign in to comment.