@@ -49,6 +49,26 @@ import {
49
49
50
50
export * from './common' ;
51
51
52
+ let libraryLoadedOverloaded = false ;
53
+ function overrideLibraryLoader ( ) {
54
+ try {
55
+ if ( true && ! libraryLoadedOverloaded ) {
56
+ @NativeClass
57
+ class LibraryLoader extends com . mapbox . mapboxsdk . LibraryLoader {
58
+ load ( name ) {
59
+ java . lang . System . loadLibrary ( name ) ;
60
+ }
61
+ }
62
+ com . mapbox . mapboxsdk . LibraryLoader . setLibraryLoader ( new LibraryLoader ( ) ) ;
63
+ libraryLoadedOverloaded = true ;
64
+ }
65
+ } catch ( error ) {
66
+ console . error ( error ) ;
67
+ }
68
+ }
69
+
70
+ overrideLibraryLoader ( ) ;
71
+
52
72
function _getLocation ( loc : globalAndroid . location . Location ) {
53
73
if ( loc === null ) {
54
74
return null ;
@@ -285,7 +305,6 @@ export class MapboxView extends MapboxViewBase {
285
305
if ( this . telemetry === false ) {
286
306
try {
287
307
com . mapbox . mapboxsdk . Mapbox . getTelemetry ( ) . setUserTelemetryRequestState ( false ) ;
288
- console . error ( 'telemtry disabled!' ) ;
289
308
} catch ( err ) {
290
309
console . error ( 'telemtry' , err ) ;
291
310
}
@@ -1357,7 +1376,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
1357
1376
if ( cached ) {
1358
1377
markerOptions . setIcon ( cached ) ;
1359
1378
} else {
1360
- console . log ( `No icon found for this device density for icon ' ${ marker . icon } '. Falling back to the default icon.` ) ;
1379
+ console . warn ( `No icon found for this device density for icon ' ${ marker . icon } '. Falling back to the default icon.` ) ;
1361
1380
}
1362
1381
} else if ( marker . icon . startsWith ( 'http' ) ) {
1363
1382
if ( marker . iconDownloaded !== null ) {
@@ -1381,7 +1400,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
1381
1400
if ( cached ) {
1382
1401
markerOptions . setIcon ( cached ) ;
1383
1402
} else {
1384
- console . log ( `Marker icon not found, using the default instead. Requested path: '" + ${ marker . iconPath } '.` ) ;
1403
+ console . warn ( `Marker icon not found, using the default instead. Requested path: '" + ${ marker . iconPath } '.` ) ;
1385
1404
}
1386
1405
}
1387
1406
marker . android = this . _mapboxMapInstance . addMarker ( markerOptions ) ;
@@ -2244,7 +2263,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
2244
2263
} ,
2245
2264
2246
2265
mapboxTileCountLimitExceeded : ( limit ) => {
2247
- console . log ( `dl mapboxTileCountLimitExceeded: ${ limit } ` ) ;
2266
+ console . warn ( `dl mapboxTileCountLimitExceeded: ${ limit } ` ) ;
2248
2267
}
2249
2268
} )
2250
2269
) ;
@@ -2971,34 +2990,33 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
2971
2990
return renderMode ;
2972
2991
}
2973
2992
2974
- _convertCameraMode ( mode : any ) : UserLocationCameraMode {
2975
-
2993
+ _convertCameraMode ( mode : any ) : UserLocationCameraMode {
2976
2994
const modeRef = com . mapbox . mapboxsdk . location . modes . CameraMode ;
2977
2995
2978
2996
switch ( mode ) {
2979
2997
case modeRef . NONE :
2980
- return " NONE" ;
2998
+ return ' NONE' ;
2981
2999
2982
3000
case modeRef . NONE_COMPASS :
2983
- return " NONE_COMPASS" ;
3001
+ return ' NONE_COMPASS' ;
2984
3002
2985
3003
case modeRef . NONE_GPS :
2986
- return " NONE_GPS" ;
3004
+ return ' NONE_GPS' ;
2987
3005
2988
3006
case modeRef . TRACKING :
2989
- return " TRACKING" ;
3007
+ return ' TRACKING' ;
2990
3008
2991
3009
case modeRef . TRACKING_COMPASS :
2992
- return " TRACKING_COMPASS" ;
3010
+ return ' TRACKING_COMPASS' ;
2993
3011
2994
3012
case modeRef . TRACKING_GPS :
2995
- return " TRACKING_GPS" ;
3013
+ return ' TRACKING_GPS' ;
2996
3014
2997
3015
case modeRef . TRACKING_GPS_NORTH :
2998
- return " TRACKING_GPS_NORTH" ;
3016
+ return ' TRACKING_GPS_NORTH' ;
2999
3017
}
3000
3018
3001
- return " NONE" ;
3019
+ return ' NONE' ;
3002
3020
}
3003
3021
3004
3022
_fineLocationPermissionGranted ( ) {
@@ -3399,7 +3417,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
3399
3417
resolve ( marker ) ;
3400
3418
} ,
3401
3419
( e ) => {
3402
- console . log ( `Download failed for ' ${ marker . icon } ' with error: ${ e } ` ) ;
3420
+ console . error ( `Download failed for ' ${ marker . icon } ' with error: ${ e } ` ) ;
3403
3421
resolve ( marker ) ;
3404
3422
}
3405
3423
) ;
@@ -3427,22 +3445,22 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
3427
3445
const screenLocation = this . _mapboxMapInstance . getProjection ( ) . toScreenLocation ( mapboxPoint ) ;
3428
3446
return { x : Utils . layout . toDeviceIndependentPixels ( screenLocation . x ) , y : Utils . layout . toDeviceIndependentPixels ( screenLocation . y ) } ;
3429
3447
}
3430
- projectBack ( screenCoordinate : { x : number , y : number } ) : LatLng {
3448
+ projectBack ( screenCoordinate : { x : number ; y : number } ) : LatLng {
3431
3449
const pointf = new android . graphics . PointF ( screenCoordinate . x , screenCoordinate . y ) ;
3432
3450
const coordinate = this . _mapboxMapInstance . getProjection ( ) . fromScreenLocation ( pointf ) ;
3433
3451
return {
3434
3452
lat : coordinate . getLatitude ( ) ,
3435
3453
lng : coordinate . getLongitude ( )
3436
- }
3454
+ } ;
3437
3455
}
3438
3456
3439
3457
getUserLocationCameraMode ( nativeMap ?: any ) : UserLocationCameraMode {
3440
3458
if ( ! this . _mapboxMapInstance ) {
3441
- return " NONE" ;
3459
+ return ' NONE' ;
3442
3460
}
3443
3461
3444
3462
if ( ! this . _locationComponent ) {
3445
- return " NONE" ;
3463
+ return ' NONE' ;
3446
3464
}
3447
3465
3448
3466
return this . _convertCameraMode ( this . _locationComponent . getCameraMode ( ) ) ;
0 commit comments