diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2019-01-21 18:34:46 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2019-01-22 11:29:40 +0100 |
commit | 99e35f0c6e995c5d39ea96e779659e3b31f9e5e2 (patch) | |
tree | cd00965d45b2539efd96840df4396a01853ba744 /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt | |
parent | 4b254dc99430ff6ce16bc767d7c9f1555ddf527e (diff) | |
download | qtlocation-mapboxgl-99e35f0c6e995c5d39ea96e779659e3b31f9e5e2.tar.gz |
[android] restore location layer visibility with new "layer-below"
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt index 44126647c0..248e8dc481 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationLayerControllerTest.kt @@ -388,6 +388,29 @@ class LocationLayerControllerTest : EspressoTest() { executeComponentTest(componentAction) } + @Test + fun applyStyle_layerBelow_restoreLayerVisibility() { + val componentAction = object : LocationComponentAction.OnPerformLocationComponentAction { + override fun onLocationComponentAction(component: LocationComponent, mapboxMap: MapboxMap, + uiController: UiController, context: Context) { + component.activateLocationComponent(context, mapboxMap.style!!,false) + component.isLocationComponentEnabled = true + component.forceLocationUpdate(location) + mapboxMap.waitForLayer(uiController, location, FOREGROUND_LAYER) + uiController.loopMainThreadForAtLeast(150) + + component.applyStyle(LocationComponentOptions.builder(context).layerBelow("road-label").build()) + + assertThat(mapboxMap.isLayerVisible(FOREGROUND_LAYER), `is`(true)) + assertThat(mapboxMap.isLayerVisible(BACKGROUND_LAYER), `is`(true)) + assertThat(mapboxMap.isLayerVisible(SHADOW_LAYER), `is`(true)) + assertThat(mapboxMap.isLayerVisible(ACCURACY_LAYER), `is`(true)) + assertThat(mapboxMap.isLayerVisible(BEARING_LAYER), `is`(false)) + } + } + executeComponentTest(componentAction) + } + @After override fun afterTest() { super.afterTest() |