[android] - restore LatLngBounds conversion, add regression test (#9324)

This commit is contained in:
Tobrun
2017-06-21 15:43:02 +02:00
committed by GitHub
parent 651e70aec7
commit d47eab05f6
2 changed files with 44 additions and 4 deletions

View File

@@ -0,0 +1,40 @@
package com.mapbox.mapboxsdk.testapp.geometry;
import android.support.test.espresso.UiController;
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.testapp.action.MapboxMapAction;
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
import com.mapbox.mapboxsdk.testapp.activity.feature.QueryRenderedFeaturesBoxHighlightActivity;
import org.junit.Test;
/**
* Instrumentation test to validate integration of LatLngBounds
*/
public class LatLngBoundsTest extends BaseActivityTest {
@Override
protected Class getActivityClass() {
return QueryRenderedFeaturesBoxHighlightActivity.class;
}
@Test
public void testLatLngBounds() {
// regression test for #9322
validateTestSetup();
MapboxMapAction.invoke(mapboxMap, new MapboxMapAction.OnInvokeActionListener() {
@Override
public void onInvokeAction(UiController uiController, MapboxMap mapboxMap) {
LatLngBounds bounds = new LatLngBounds.Builder()
.include(new LatLng(48.8589506, 2.2773457))
.include(new LatLng(47.2383171, -1.6309316))
.build();
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 0));
}
});
}
}