File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3031,7 +3031,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
30313031 }
30323032 }
30333033
3034- _getMapStyle ( input : any ) : any {
3034+ _getMapStyle ( input = 'streets' ) : any {
30353035 if ( Trace . isEnabled ( ) ) {
30363036 CLog ( CLogTypes . info , '_getMapStyle(): top with input:' , input ) ;
30373037 }
@@ -3044,7 +3044,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
30443044 } else if ( input . startsWith ( '~/' ) ) {
30453045 return 'file://' + path . join ( knownFolders . currentApp ( ) . path , input . replace ( '~/' , '' ) ) ;
30463046 } else {
3047- let key = Object . keys ( MapStyle ) [ Object . values ( MapStyle ) . indexOf ( input ) ] ;
3047+ let key = Object . keys ( MapStyle ) [ Object . values ( MapStyle ) . indexOf ( input as any ) ] ;
30483048 // on android STREETS is defined as MAPBOX_STREETS field
30493049 if ( key === 'STREETS' ) {
30503050 key = 'MAPBOX_STREETS' ;
Original file line number Diff line number Diff line change @@ -1101,7 +1101,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
11011101 reject ( 'No bridge available' ) ;
11021102 return ;
11031103 }
1104- const styleStr = typeof style === 'string' ? style : ( style as any ) . toString ( ) ;
1104+ const styleStr = ( typeof style === 'string' ? style : ( style as any ) . toString ( ) ) ?? 'streets' ;
11051105 b . setStyle ( styleStr , ( success : boolean , error ?: any ) => {
11061106 if ( success ) resolve ( ) ;
11071107 else reject ( error && error . localizedDescription ? error . localizedDescription : error || 'Error setting style' ) ;
You can’t perform that action at this time.
0 commit comments