[android] - add binding integration for Map::setLatLngbounds, add example (#8622)

This commit is contained in:
Tobrun
2017-04-13 16:06:09 +02:00
committed by GitHub
parent 0810192163
commit 21f54cc506
10 changed files with 206 additions and 3 deletions

View File

@@ -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
//