@@ -49,6 +49,26 @@ import {
4949
5050export * from './common' ;
5151
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+
5272function _getLocation ( loc : globalAndroid . location . Location ) {
5373 if ( loc === null ) {
5474 return null ;
@@ -285,7 +305,6 @@ export class MapboxView extends MapboxViewBase {
285305 if ( this . telemetry === false ) {
286306 try {
287307 com . mapbox . mapboxsdk . Mapbox . getTelemetry ( ) . setUserTelemetryRequestState ( false ) ;
288- console . error ( 'telemtry disabled!' ) ;
289308 } catch ( err ) {
290309 console . error ( 'telemtry' , err ) ;
291310 }
@@ -1357,7 +1376,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
13571376 if ( cached ) {
13581377 markerOptions . setIcon ( cached ) ;
13591378 } 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.` ) ;
13611380 }
13621381 } else if ( marker . icon . startsWith ( 'http' ) ) {
13631382 if ( marker . iconDownloaded !== null ) {
@@ -1381,7 +1400,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
13811400 if ( cached ) {
13821401 markerOptions . setIcon ( cached ) ;
13831402 } 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 } '.` ) ;
13851404 }
13861405 }
13871406 marker . android = this . _mapboxMapInstance . addMarker ( markerOptions ) ;
@@ -2244,7 +2263,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
22442263 } ,
22452264
22462265 mapboxTileCountLimitExceeded : ( limit ) => {
2247- console . log ( `dl mapboxTileCountLimitExceeded: ${ limit } ` ) ;
2266+ console . warn ( `dl mapboxTileCountLimitExceeded: ${ limit } ` ) ;
22482267 }
22492268 } )
22502269 ) ;
@@ -2971,34 +2990,33 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
29712990 return renderMode ;
29722991 }
29732992
2974- _convertCameraMode ( mode : any ) : UserLocationCameraMode {
2975-
2993+ _convertCameraMode ( mode : any ) : UserLocationCameraMode {
29762994 const modeRef = com . mapbox . mapboxsdk . location . modes . CameraMode ;
29772995
29782996 switch ( mode ) {
29792997 case modeRef . NONE :
2980- return " NONE" ;
2998+ return ' NONE' ;
29812999
29823000 case modeRef . NONE_COMPASS :
2983- return " NONE_COMPASS" ;
3001+ return ' NONE_COMPASS' ;
29843002
29853003 case modeRef . NONE_GPS :
2986- return " NONE_GPS" ;
3004+ return ' NONE_GPS' ;
29873005
29883006 case modeRef . TRACKING :
2989- return " TRACKING" ;
3007+ return ' TRACKING' ;
29903008
29913009 case modeRef . TRACKING_COMPASS :
2992- return " TRACKING_COMPASS" ;
3010+ return ' TRACKING_COMPASS' ;
29933011
29943012 case modeRef . TRACKING_GPS :
2995- return " TRACKING_GPS" ;
3013+ return ' TRACKING_GPS' ;
29963014
29973015 case modeRef . TRACKING_GPS_NORTH :
2998- return " TRACKING_GPS_NORTH" ;
3016+ return ' TRACKING_GPS_NORTH' ;
29993017 }
30003018
3001- return " NONE" ;
3019+ return ' NONE' ;
30023020 }
30033021
30043022 _fineLocationPermissionGranted ( ) {
@@ -3399,7 +3417,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
33993417 resolve ( marker ) ;
34003418 } ,
34013419 ( e ) => {
3402- console . log ( `Download failed for ' ${ marker . icon } ' with error: ${ e } ` ) ;
3420+ console . error ( `Download failed for ' ${ marker . icon } ' with error: ${ e } ` ) ;
34033421 resolve ( marker ) ;
34043422 }
34053423 ) ;
@@ -3427,22 +3445,22 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
34273445 const screenLocation = this . _mapboxMapInstance . getProjection ( ) . toScreenLocation ( mapboxPoint ) ;
34283446 return { x : Utils . layout . toDeviceIndependentPixels ( screenLocation . x ) , y : Utils . layout . toDeviceIndependentPixels ( screenLocation . y ) } ;
34293447 }
3430- projectBack ( screenCoordinate : { x : number , y : number } ) : LatLng {
3448+ projectBack ( screenCoordinate : { x : number ; y : number } ) : LatLng {
34313449 const pointf = new android . graphics . PointF ( screenCoordinate . x , screenCoordinate . y ) ;
34323450 const coordinate = this . _mapboxMapInstance . getProjection ( ) . fromScreenLocation ( pointf ) ;
34333451 return {
34343452 lat : coordinate . getLatitude ( ) ,
34353453 lng : coordinate . getLongitude ( )
3436- }
3454+ } ;
34373455 }
34383456
34393457 getUserLocationCameraMode ( nativeMap ?: any ) : UserLocationCameraMode {
34403458 if ( ! this . _mapboxMapInstance ) {
3441- return " NONE" ;
3459+ return ' NONE' ;
34423460 }
34433461
34443462 if ( ! this . _locationComponent ) {
3445- return " NONE" ;
3463+ return ' NONE' ;
34463464 }
34473465
34483466 return this . _convertCameraMode ( this . _locationComponent . getCameraMode ( ) ) ;
0 commit comments