Add runtime API for setting tile prefetch delta for Source class (#184)

* Add runtime API for setting tile prefetch delta for Source class

* Use Integer as param.

* Update gl native submodule.
This commit is contained in:
Kevin Li
2020-02-25 09:24:04 +08:00
committed by GitHub
parent 18264df98d
commit 2e9f02140c
3 changed files with 50 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ import com.mapbox.mapboxsdk.testapp.activity.style.GridSourceActivity.ID_GRID_LA
import com.mapbox.mapboxsdk.testapp.activity.style.GridSourceActivity.ID_GRID_SOURCE
import com.mapbox.mapboxsdk.testapp.utils.TestingAsyncUtils
import org.junit.Assert
import org.junit.Assert.*
import org.junit.Test
class CustomGeometrySourceTest : BaseTest() {
@@ -66,4 +67,20 @@ class CustomGeometrySourceTest : BaseTest() {
}.count() == THREAD_POOL_LIMIT)
}
}
@Test
fun sourceZoomDeltaTest() {
validateTestSetup()
invoke(mapboxMap) { uiController, mapboxMap ->
mapboxMap.prefetchZoomDelta = 3
mapboxMap.style!!.getSource(ID_GRID_SOURCE)!!.let {
assertNull(it.prefetchZoomDelta)
it.prefetchZoomDelta = 5
assertNotNull(it.prefetchZoomDelta)
assertEquals(5, it.prefetchZoomDelta!!)
it.prefetchZoomDelta = null
assertNull(it.prefetchZoomDelta)
}
}
}
}