Skip to content

Commit

Permalink
Bump gl-native to 10.0.0-rc.8, common to 18.0.0 (#604)
Browse files Browse the repository at this point in the history
* Bump gl-native to 10.0.0-rc.8, common to 18.0.0

* Fix test cases

* Update points
  • Loading branch information
Kevin Li authored Sep 1, 2021
1 parent 76c6279 commit 4f6ae4b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For the full license terms, please see the Mapbox Terms of Service at https://ww
## Additional Mapbox Maps Android licenses
Mapbox Maps Android uses portions of the Android App Startup Runtime.

URL: [https://developer.android.com/jetpack/androidx/releases/startup#1.0.0](https://developer.android.com/jetpack/androidx/releases/startup#1.0.0)
URL: [https://developer.android.com/jetpack/androidx/releases/startup#1.1.0](https://developer.android.com/jetpack/androidx/releases/startup#1.1.0)

License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ class RestrictBoundsActivity : AppCompatActivity() {
private val INFINITE_BOUNDS: CameraBoundsOptions = CameraBoundsOptions.Builder()
.bounds(
CoordinateBounds(
Point.fromLngLat(170.0202020, -20.0),
Point.fromLngLat(190.0, 20.0),
Point.fromLngLat(0.0, 0.0),
Point.fromLngLat(0.0, 0.0),
true
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CustomLayerActivity : AppCompatActivity() {
Style.MAPBOX_STREETS
) {
mapboxMap.setCamera(
CameraOptions.Builder().center(Point.fromLngLat(-243.60947, 39.91448)).zoom(10.0).build()
CameraOptions.Builder().center(Point.fromLngLat(116.39053, 39.91448)).zoom(10.0).build()
)
initFab()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class NativeCustomLayerActivity : AppCompatActivity() {
Style.MAPBOX_STREETS
) {
mapboxMap.setCamera(
CameraOptions.Builder().center(Point.fromLngLat(-243.60947, 39.91448)).zoom(10.0)
CameraOptions.Builder().center(Point.fromLngLat(116.39053, 39.91448)).zoom(10.0)
.build()
)
initFab()
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ object Versions {
const val mapboxGestures = "0.7.0"
const val mapboxJavaServices = "5.4.1"
const val mapboxBase = "0.5.0"
const val mapboxGlNative = "10.0.0-rc.7.2"
const val mapboxCommon = "17.1.0"
const val mapboxGlNative = "10.0.0-rc.8"
const val mapboxCommon = "18.0.0"
const val mapboxAndroidCore = "5.0.0"
const val mapboxAndroidTelemetry = "8.1.0"
const val androidxCore = "1.3.1"
Expand Down
27 changes: 17 additions & 10 deletions sdk/src/androidTest/java/com/mapbox/maps/OfflineTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ class OfflineTest {
offlineManager.createTilesetDescriptor(
TilesetDescriptorOptions.Builder()
.styleURI(STYLE)
.minZoom(ZOOM.toInt().toByte())
.maxZoom(ZOOM.toInt().toByte())
// Make the zoom range lager to make sure the download process not complete to fast.
.minZoom((ZOOM - 5).toInt().toByte())
.maxZoom((ZOOM + 5).toInt().toByte())
.build()
)
)
Expand Down Expand Up @@ -303,6 +304,7 @@ class OfflineTest {
}
switchAirplaneMode()
verifyAirplaneModeEnabled()
// Make the zoom lever one more larger to make sure all the tiles are downloaded.
prepareMapView(
observer,
listOf(
Expand Down Expand Up @@ -353,7 +355,8 @@ class OfflineTest {
MapEvents.MAP_LOADED,
MapEvents.STYLE_LOADED,
MapEvents.MAP_LOADING_ERROR
)
),
ZOOM + 1
)
try {
// map loaded, style loaded
Expand Down Expand Up @@ -419,9 +422,11 @@ class OfflineTest {
}
switchAirplaneMode()
verifyAirplaneModeEnabled()
// Show map with the zoom level larger than download range to trigger loading error
prepareMapView(
observer,
listOf(MapEvents.MAP_IDLE, MapEvents.MAP_LOADING_ERROR)
listOf(MapEvents.MAP_IDLE, MapEvents.MAP_LOADING_ERROR),
ZOOM + 3
)
try {
// we do not throw timeout exception and verify we have exactly 1 IDLE event after timeout
Expand Down Expand Up @@ -451,9 +456,11 @@ class OfflineTest {
}
}
OfflineSwitch.getInstance().isMapboxStackConnected = false
// Set zoom 1 larger to make sure all tiles are download.
prepareMapView(
observer,
listOf(MapEvents.MAP_IDLE)
listOf(MapEvents.MAP_IDLE),
ZOOM + 1
)
try {
// we wait for whole time and verify we hit exactly one IDLE event
Expand Down Expand Up @@ -524,10 +531,10 @@ class OfflineTest {
.metadata(Value(STYLE_PACK_METADATA))
.build()
)
// set min zoom twice less in order to make sure tile in loaded map view
// set min and max zoom in range [zoom-2, zoom+2] to make sure tile in loaded map view
// will be fully visible and not somewhere on tile edge
.minZoom((ZOOM.toInt() / 2).toByte())
.maxZoom(ZOOM.toInt().toByte())
.minZoom((ZOOM - 2).toInt().toByte())
.maxZoom((ZOOM + 2).toInt().toByte())
.build()
)
)
Expand All @@ -550,7 +557,7 @@ class OfflineTest {
}
}

private fun prepareMapView(observer: Observer, eventList: List<String>) {
private fun prepareMapView(observer: Observer, eventList: List<String>, zoom: Double = ZOOM) {
var mapboxMap: MapboxMap
rule.scenario.onActivity {
it.runOnUiThread {
Expand All @@ -562,7 +569,7 @@ class OfflineTest {
context = context,
cameraOptions = CameraOptions.Builder()
.center(TOKYO)
.zoom(ZOOM)
.zoom(zoom)
.build()
)
)
Expand Down

0 comments on commit 4f6ae4b

Please sign in to comment.