File tree Expand file tree Collapse file tree 3 files changed +52
-5
lines changed
Expand file tree Collapse file tree 3 files changed +52
-5
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,12 @@ export class TilesRendererBase {
368368 }
369369
370370 // Overrideable
371+ dispatchEvent ( e ) {
372+
373+ // event to be overriden for dispatching via an event system
374+
375+ }
376+
371377 fetchData ( url , options ) {
372378
373379 return fetch ( url , options ) ;
@@ -590,11 +596,18 @@ export class TilesRendererBase {
590596
591597 } ) ;
592598
593- pr . catch ( err => {
599+ pr . catch ( error => {
594600
595- console . error ( err ) ;
601+ console . error ( error ) ;
596602 this . rootTileSet = null ;
597603
604+ this . dispatchEvent ( {
605+ type : 'load-error' ,
606+ tile : null ,
607+ error,
608+ uri : processedUrl ,
609+ } ) ;
610+
598611 } ) ;
599612
600613 return pr ;
@@ -785,7 +798,7 @@ export class TilesRendererBase {
785798 }
786799
787800 } )
788- . catch ( e => {
801+ . catch ( error => {
789802
790803 // if it has been unloaded then the tile has been disposed
791804 if ( signal . aborted ) {
@@ -794,7 +807,7 @@ export class TilesRendererBase {
794807
795808 }
796809
797- if ( e . name !== 'AbortError' ) {
810+ if ( error . name !== 'AbortError' ) {
798811
799812 parseQueue . remove ( tile ) ;
800813 downloadQueue . remove ( tile ) ;
@@ -812,10 +825,17 @@ export class TilesRendererBase {
812825 stats . failed ++ ;
813826
814827 console . error ( `TilesRenderer : Failed to load tile at url "${ tile . content . uri } ".` ) ;
815- console . error ( e ) ;
828+ console . error ( error ) ;
816829 tile . __loadingState = FAILED ;
817830 lruCache . setLoaded ( tile , true ) ;
818831
832+ this . dispatchEvent ( {
833+ type : 'load-error' ,
834+ tile,
835+ error,
836+ uri,
837+ } ) ;
838+
819839 } else {
820840
821841 lruCache . remove ( tile ) ;
Original file line number Diff line number Diff line change @@ -166,6 +166,19 @@ export class CesiumIonAuthPlugin {
166166
167167 } ) ;
168168
169+ // dispatch an error if we fail to refresh the token
170+ this . _tokenRefreshPromise
171+ . catch ( error => {
172+
173+ this . tiles . dispatchEvent ( {
174+ type : 'load-error' ,
175+ tile : null ,
176+ error,
177+ url,
178+ } ) ;
179+
180+ } ) ;
181+
169182 }
170183
171184 return this . _tokenRefreshPromise ;
Original file line number Diff line number Diff line change @@ -191,6 +191,20 @@ export class GoogleCloudAuthPlugin {
191191
192192 } ) ;
193193
194+ // dispatch an error if we fail to refresh the token
195+ this . _tokenRefreshPromise
196+ . catch ( error => {
197+
198+ this . tiles . dispatchEvent ( {
199+ type : 'load-error' ,
200+ tile : null ,
201+ error,
202+ rootURL,
203+ } ) ;
204+
205+ } ) ;
206+
207+
194208 }
195209
196210 return this . _tokenRefreshPromise ;
You can’t perform that action at this time.
0 commit comments