@@ -1428,7 +1428,15 @@ export class ImageOverlay {
14281428
14291429 }
14301430
1431- return this . downloadQueue . add ( { priority : - performance . now ( ) } , ( ) => fetch ( url , options ) ) ;
1431+ const item = { priority : - performance . now ( ) } ;
1432+ const promise = this . downloadQueue . add ( item , ( ) => fetch ( url , options ) ) ;
1433+ if ( options . signal ) {
1434+
1435+ options . signal . addEventListener ( 'abort' , ( ) => this . downloadQueue . remove ( item ) , { once : true } ) ;
1436+
1437+ }
1438+
1439+ return promise ;
14321440
14331441 }
14341442
@@ -2102,7 +2110,16 @@ export class CesiumIonOverlay extends TiledImageOverlay {
21022110
21032111 }
21042112
2105- return this . downloadQueue . add ( { priority : - performance . now ( ) } , ( ) => this . auth . fetch ( url , options ) ) ;
2113+ // TODO: we should provide a better way to sort these
2114+ const item = { priority : - performance . now ( ) } ;
2115+ const promise = this . downloadQueue . add ( item , ( ) => this . auth . fetch ( url , options ) ) ;
2116+ if ( options . signal ) {
2117+
2118+ options . signal . addEventListener ( 'abort' , ( ) => this . downloadQueue . remove ( item ) , { once : true } ) ;
2119+
2120+ }
2121+
2122+ return promise ;
21062123
21072124 }
21082125
@@ -2176,7 +2193,15 @@ export class GoogleMapsOverlay extends TiledImageOverlay {
21762193
21772194 }
21782195
2179- return this . downloadQueue . add ( { priority : - performance . now ( ) } , ( ) => this . auth . fetch ( url , options ) ) ;
2196+ const item = { priority : - performance . now ( ) } ;
2197+ const promise = this . downloadQueue . add ( item , ( ) => this . auth . fetch ( url , options ) ) ;
2198+ if ( options . signal ) {
2199+
2200+ options . signal . addEventListener ( 'abort' , ( ) => this . downloadQueue . remove ( item ) , { once : true } ) ;
2201+
2202+ }
2203+
2204+ return promise ;
21802205
21812206 }
21822207
0 commit comments