[android] Expose pre-fetching zoom delta. (#15769)
* [android] Expose pre-fetching zoom delta. * [android] Fix Clang format. * [android] Add MapboxMap unit test. * [android] Add prefetching zoom delta into MapboxMapOptions. * [android] Deprecate setPrefetchesTiles to migrate to setPrefetchZoomDelta. * [android] Deprecate getPrefetchesTiles() and migrate to setPrefetchZoomDelta(). * [android] Add unit test to NativeMapViewTest. * [android] Add IntRange annotation to getPrefetchZoomDelta.
This commit is contained in:
@@ -167,6 +167,16 @@ public class MapboxMapOptionsTest {
|
||||
assertFalse(new MapboxMapOptions().setPrefetchesTiles(false).getPrefetchesTiles());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPrefetchZoomDelta() {
|
||||
// Default value
|
||||
assertEquals(4, new MapboxMapOptions().getPrefetchZoomDelta());
|
||||
|
||||
// Check mutations
|
||||
assertEquals(5, new MapboxMapOptions().setPrefetchZoomDelta(5).getPrefetchZoomDelta());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCrossSourceCollisions() {
|
||||
// Default value
|
||||
|
||||
@@ -126,6 +126,18 @@ class MapboxMapTest {
|
||||
verify { nativeMapView.prefetchTiles = true }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testGetPrefetchZoomDelta() {
|
||||
every { nativeMapView.prefetchZoomDelta } answers { 3 }
|
||||
assertEquals(3, mapboxMap.prefetchZoomDelta)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSetPrefetchZoomDelta() {
|
||||
mapboxMap.prefetchZoomDelta = 2
|
||||
verify { nativeMapView.prefetchZoomDelta = 2 }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testCameraForLatLngBounds() {
|
||||
val bounds = LatLngBounds.Builder().include(LatLng()).include(LatLng(1.0, 1.0)).build()
|
||||
|
||||
Reference in New Issue
Block a user