diff --git a/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/MapboxNavigation.java b/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/MapboxNavigation.java index 788741930a7..e5ee22eba00 100644 --- a/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/MapboxNavigation.java +++ b/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/MapboxNavigation.java @@ -414,6 +414,16 @@ public void setConsiderTraffic(boolean disableTraffic) { } } + /** + * Get the currently used {@link MapboxNavigationOptions}, if one isn't set, the default values will be used. + * + * @return the set MapboxNavigationOptions object + * @since 0.3.0 + */ + public MapboxNavigationOptions getMapboxNavigationOptions() { + return options; + } + /* * Service methods */ diff --git a/navigation/libandroid-navigation/src/test/java/com/mapbox/services/android/navigation/v5/MapboxNavigationTest.java b/navigation/libandroid-navigation/src/test/java/com/mapbox/services/android/navigation/v5/MapboxNavigationTest.java index 3d1ee26d617..bb5a047f950 100644 --- a/navigation/libandroid-navigation/src/test/java/com/mapbox/services/android/navigation/v5/MapboxNavigationTest.java +++ b/navigation/libandroid-navigation/src/test/java/com/mapbox/services/android/navigation/v5/MapboxNavigationTest.java @@ -2,6 +2,8 @@ import android.content.Context; +import junit.framework.Assert; + import org.junit.Test; import org.mockito.Mockito; @@ -14,4 +16,13 @@ public void sanityTest() { MapboxNavigation navigation = new MapboxNavigation(Mockito.mock(Context.class), "pk.XXX"); assertNotNull("should not be null", navigation); } + + @Test + public void getMapboxNavigationOptions_currentOptionDoesReturn() { + MapboxNavigationOptions options = new MapboxNavigationOptions(); + options.setManeuverZoneRadius(19.9999); + MapboxNavigation navigation = new MapboxNavigation(Mockito.mock(Context.class), "pk.XXX", options); + double actualValue = navigation.getMapboxNavigationOptions().getManeuverZoneRadius(); + Assert.assertEquals(19.9999, actualValue, BaseTest.DELTA); + } } \ No newline at end of file