private AirMapViewBuilder getWebMapViewBuilder ( ) { if ( context != null ) { try { ApplicationInfo ai = context . getPackageManager ( ) . getApplicationInfo ( context . getPackageName ( ) , PackageManager . GET_META_DATA ) ; Bundle bundle = ai . metaData ; String accessToken = bundle . getString ( "com.mapbox.ACCESS_TOKEN" ) ; String mapId = bundle . getString ( "com.mapbox.MAP_ID" ) ; if ( ! TextUtils . isEmpty ( accessToken ) && ! TextUtils . isEmpty ( mapId ) ) { return new MapboxWebMapViewBuilder ( accessToken , mapId ) ; } } catch ( PackageManager . NameNotFoundException e ) { Log . e ( TAG , "Failed to load Mapbox access token and map id" , e ) ; } } return new WebAirMapViewBuilder ( ) ; }
Decides what the Map Web provider should be used and generates a builder for it .