From 1f0cae0e82b4bb7d258bd0d36afaa33799ce7ca0 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Thu, 9 Jan 2025 19:39:15 +0900 Subject: [PATCH] Remove load index from TilesRenderer --- src/base/TilesRendererBase.js | 2 +- src/three/TilesRenderer.js | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/base/TilesRendererBase.js b/src/base/TilesRendererBase.js index df94d038..7c71b3f5 100644 --- a/src/base/TilesRendererBase.js +++ b/src/base/TilesRendererBase.js @@ -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 ) ); } diff --git a/src/three/TilesRenderer.js b/src/three/TilesRenderer.js index 237e6b75..4c3a1bc2 100644 --- a/src/three/TilesRenderer.js +++ b/src/three/TilesRenderer.js @@ -546,7 +546,6 @@ export class TilesRenderer extends TilesRendererBase { tile.cached = { - _loadIndex: 0, transform, transformInverse, @@ -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; @@ -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; @@ -859,8 +855,6 @@ export class TilesRenderer extends TilesRendererBase { } - cached._loadIndex ++; - } setTileVisible( tile, visible ) {