[android] - add binding integration for Map::setLatLngbounds, add example (#8622)
This commit is contained in:
@@ -19,6 +19,7 @@ import com.mapbox.mapboxsdk.annotations.PolylineOptions;
|
||||
import com.mapbox.mapboxsdk.constants.MapboxConstants;
|
||||
import com.mapbox.mapboxsdk.exceptions.InvalidMarkerPositionException;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.espresso.EspressoTestActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
@@ -107,6 +108,25 @@ public class MapboxMapTest {
|
||||
}));
|
||||
}
|
||||
|
||||
//
|
||||
// CameraForLatLngBounds
|
||||
//
|
||||
@Test
|
||||
public void testCameraForLatLngBounds() {
|
||||
ViewUtils.checkViewIsDisplayed(R.id.mapView);
|
||||
final MapboxMap mapboxMap = activity.getMapboxMap();
|
||||
onView(withId(R.id.mapView)).perform(new MapboxMapAction(new InvokeViewAction() {
|
||||
@Override
|
||||
public void onViewAction(UiController uiController, View view) {
|
||||
// set
|
||||
mapboxMap.setLatLngBoundsForCameraTarget(
|
||||
new LatLngBounds.Builder().include(new LatLng()).include(new LatLng(1, 1)).build());
|
||||
// reset
|
||||
mapboxMap.setLatLngBoundsForCameraTarget(null);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
//
|
||||
// MinZoomLevel
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user