Skip to content

Commit c37d79c

Browse files
author
farfromrefug
committed
fix(android): default style to streets like ios
1 parent ed8e1a6 commit c37d79c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ui-mapbox/index.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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';

src/ui-mapbox/index.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)