use of com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute in project mapbox-navigation-android by mapbox.
the class MockNavigationActivity method onMapReady.
@Override
public void onMapReady(MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, null);
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.NAVIGATION);
navigationMapRoute = new NavigationMapRoute(navigation, mapView, mapboxMap);
mapboxMap.addOnMapClickListener(this);
Snackbar.make(mapView, "Tap map to place waypoint", BaseTransientBottomBar.LENGTH_LONG).show();
locationEngine = new MockLocationEngine(1000, 50, true);
mapboxMap.setLocationSource(locationEngine);
newOrigin();
}
use of com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute in project mapbox-navigation-android by mapbox.
the class NavigationViewActivity method initMapRoute.
private void initMapRoute() {
mapRoute = new NavigationMapRoute(mapView, mapboxMap);
mapRoute.setOnRouteSelectionChangeListener(this);
}
use of com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute in project mapbox-navigation-android by mapbox.
the class NavigationView method initRoute.
/**
* Initializes the {@link NavigationMapRoute} to be used to draw the
* route.
*/
private void initRoute() {
int routeStyleRes = ThemeSwitcher.retrieveNavigationViewStyle(getContext(), R.attr.navigationViewRouteStyle);
mapRoute = new NavigationMapRoute(null, mapView, map, routeStyleRes);
}
use of com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute in project mapbox-navigation-android by mapbox.
the class NavigationMapRouteActivity method onMapReady.
@Override
public void onMapReady(MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
navigationMapRoute = new NavigationMapRoute(null, mapView, mapboxMap, "admin-3-4-boundaries-bg");
Gson gson = new GsonBuilder().registerTypeAdapterFactory(DirectionsAdapterFactory.create()).create();
DirectionsResponse response = gson.fromJson(loadJsonFromAsset(DIRECTIONS_RESPONSE), DirectionsResponse.class);
navigationMapRoute.addRoute(response.routes().get(0));
mapboxMap.setOnMapLongClickListener(this);
navigationMapRoute.setOnRouteSelectionChangeListener(this);
}
Aggregations