File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -429,15 +429,16 @@ export class Style extends Evented {
429429 const request = await this . map . _requestManager . transformRequest ( url , ResourceType . Style ) ;
430430 this . _loadStyleRequest = new AbortController ( ) ;
431431 const abortController = this . _loadStyleRequest ;
432- getJSON < StyleSpecification > ( request , this . _loadStyleRequest ) . then ( ( response ) => {
432+ try {
433+ const response = await getJSON < StyleSpecification > ( request , this . _loadStyleRequest ) ;
433434 this . _loadStyleRequest = null ;
434435 this . _load ( response . data , options , previousStyle ) ;
435- } ) . catch ( ( error ) => {
436+ } catch ( error ) {
436437 this . _loadStyleRequest = null ;
437438 if ( error && ! abortController . signal . aborted ) { // ignore abort
438439 this . fire ( new ErrorEvent ( error ) ) ;
439440 }
440- } ) ;
441+ }
441442 }
442443
443444 loadJSON ( json : StyleSpecification , options : StyleSetterOptions & StyleSwapOptions = { } , previousStyle ?: StyleSpecification ) {
You can’t perform that action at this time.
0 commit comments