Java Code Examples for com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute#setOnRouteSelectionChangeListener()

The following examples show how to use com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute#setOnRouteSelectionChangeListener() . 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: NavigationMapRouteActivity.java    From graphhopper-navigation-android with MIT License 5 votes vote down vote up
@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.addOnMapLongClickListener(this);
  navigationMapRoute.setOnRouteSelectionChangeListener(this);
}
 
Example 2
Source File: DualNavigationMapActivity.java    From graphhopper-navigation-android with MIT License 4 votes vote down vote up
private void initMapRoute() {
  mapRoute = new NavigationMapRoute(mapView, mapboxMap);
  mapRoute.setOnRouteSelectionChangeListener(this);
}
 
Example 3
Source File: NavigationLauncherActivity.java    From graphhopper-navigation-android with MIT License 4 votes vote down vote up
private void initMapRoute() {
  mapRoute = new NavigationMapRoute(mapView, mapboxMap);
  mapRoute.setOnRouteSelectionChangeListener(this);
}
 
Example 4
Source File: NavigationLauncherActivity.java    From graphhopper-navigation-example with Apache License 2.0 4 votes vote down vote up
private void initMapRoute() {
    mapRoute = new NavigationMapRoute(mapView, mapboxMap);
    mapRoute.setOnRouteSelectionChangeListener(this);
}