Java Code Examples for com.mapbox.mapboxsdk.maps.MapView#getContext()

The following examples show how to use com.mapbox.mapboxsdk.maps.MapView#getContext() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NavigationMapboxMap.java    From graphhopper-navigation-android with MIT License 5 votes vote down vote up
private void initializeLocationLayer(MapView mapView, MapboxMap map) {
  Context context = mapView.getContext();
  int locationLayerStyleRes = ThemeSwitcher.retrieveNavigationViewStyle(context,
    R.attr.navigationViewLocationLayerStyle);
  locationLayer = new LocationLayerPlugin(mapView, map, null, locationLayerStyleRes);
  locationLayer.setRenderMode(RenderMode.GPS);
}
 
Example 2
Source File: NavigationMapboxMap.java    From graphhopper-navigation-android with MIT License 5 votes vote down vote up
private void initializeWayname(MapView mapView, MapboxMap mapboxMap,
                               MapLayerInteractor layerInteractor, MapPaddingAdjustor paddingAdjustor) {
  initializeStreetsSource(mapboxMap);
  WaynameLayoutProvider layoutProvider = new WaynameLayoutProvider(mapView.getContext());
  WaynameFeatureFinder featureInteractor = new WaynameFeatureFinder(mapboxMap);
  initializeWaynameLayer(layerInteractor);
  mapWayname = new MapWayname(layoutProvider, layerInteractor, featureInteractor, paddingAdjustor);
}
 
Example 3
Source File: MapPaddingAdjustor.java    From graphhopper-navigation-android with MIT License 5 votes vote down vote up
private int calculateTopPaddingDefault(MapView mapView) {
  Context context = mapView.getContext();
  Resources resources = context.getResources();
  int mapViewHeight = mapView.getHeight();
  int bottomSheetHeight = (int) resources.getDimension(R.dimen.summary_bottomsheet_height);
  return mapViewHeight - (bottomSheetHeight * BOTTOMSHEET_PADDING_MULTIPLIER);
}
 
Example 4
Source File: NavigationMapboxMap.java    From graphhopper-navigation-android with MIT License 4 votes vote down vote up
private void initializeRoute(MapView mapView, MapboxMap map) {
  Context context = mapView.getContext();
  int routeStyleRes = ThemeSwitcher.retrieveNavigationViewStyle(context, R.attr.navigationViewRouteStyle);
  mapRoute = new NavigationMapRoute(null, mapView, map, routeStyleRes);
}
 
Example 5
Source File: DraggableAnnotationController.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@SuppressLint("ClickableViewAccessibility")
DraggableAnnotationController(MapView mapView, MapboxMap mapboxMap) {
  this(mapView, mapboxMap, new AndroidGesturesManager(mapView.getContext(), false),
    mapView.getScrollX(), mapView.getScrollY(), mapView.getMeasuredWidth(), mapView.getMeasuredHeight());
}