Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deps] Bump gl-native to v10.0.0-beta.17, common to v10.0.2, minSdkVersion to 21, and address breaking changes. #176

Merged
merged 12 commits into from
Mar 18, 2021
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ app/src/main/res/values/developer-config.xml
app/src/androidTest/java/com/mapbox/maps/testapp/activity
sdk/src/androidTest/res/values/developer-config.xml
extension-style-app/src/main/res/values/developer-config.xml
sdk/src/main/res/values/developer-config.xml
node_modules/
10 changes: 7 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,19 @@ License: [BSD](https://opensource.org/licenses/BSD-2-Clause)

===========================================================================

Mapbox Maps Android uses portions of the OkHttp.
Mapbox Maps Android uses portions of the okhttp.

License: [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)
URL: [https://square.github.io/okhttp/](https://square.github.io/okhttp/)

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

===========================================================================

Mapbox Maps Android uses portions of the Okio.

License: [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)
URL: [https://github.com/square/okio/](https://github.com/square/okio/)

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 @@ -15,7 +15,7 @@ import com.mapbox.maps.plugin.annotation.generated.SymbolManager
import com.mapbox.maps.plugin.annotation.generated.SymbolOptions
import com.mapbox.maps.plugin.annotation.generated.createSymbolManager
import com.mapbox.maps.plugin.annotation.getAnnotationPlugin
import com.mapbox.maps.plugin.delegates.listeners.OnMapLoadingFinishedListener
import com.mapbox.maps.plugin.delegates.listeners.OnMapLoadedListener
import com.mapbox.maps.testapp.BaseMapTest
import com.mapbox.maps.testapp.examples.annotation.AnnotationUtils
import org.junit.Assert
Expand All @@ -30,7 +30,7 @@ import java.util.concurrent.TimeoutException
*/
@RunWith(AndroidJUnit4::class)
@LargeTest
class UpdateAnnotationTest : BaseMapTest(), OnMapLoadingFinishedListener {
class UpdateAnnotationTest : BaseMapTest(), OnMapLoadedListener {
private lateinit var runnable: Runnable
private var index = 0
private val latch = CountDownLatch(AnnotationUtils.STYLES.size * 3)
Expand All @@ -39,7 +39,7 @@ class UpdateAnnotationTest : BaseMapTest(), OnMapLoadingFinishedListener {

@Test
fun testUpdateAnnotation() {
mapboxMap.addOnMapLoadingFinishedListener(this)
mapboxMap.addOnMapLoadedListener(this)

rule.scenario.onActivity {
val handler = Handler(it.mainLooper)
Expand Down Expand Up @@ -97,7 +97,7 @@ class UpdateAnnotationTest : BaseMapTest(), OnMapLoadingFinishedListener {
}
}

override fun onMapLoadingFinished() {
override fun onMapLoaded() {
latch.countDown()
rule.scenario.onActivity {
it.runOnUiThread {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GestureActivityTest : BaseMapTest() {
rule.scenario.onActivity {
it.runOnUiThread {
// zoom in so we can move vertically
mapboxMap.jumpTo(CameraOptions.Builder().zoom(4.0).build())
mapboxMap.setCamera(CameraOptions.Builder().zoom(4.0).build())
initialCameraPosition = mapboxMap.getCameraOptions(null)
mapView.getGesturesPlugin().quickZoomEnabled = false
}
Expand Down Expand Up @@ -128,7 +128,7 @@ class GestureActivityTest : BaseMapTest() {
rule.scenario.onActivity {
it.runOnUiThread {
// zoom in so we can move vertically
mapboxMap.jumpTo(CameraOptions.Builder().zoom(4.0).build())
mapboxMap.setCamera(CameraOptions.Builder().zoom(4.0).build())
initialCameraPosition = mapboxMap.getCameraOptions(null)
mapView.getGesturesPlugin().quickZoomEnabled = false
}
Expand Down Expand Up @@ -164,7 +164,7 @@ class GestureActivityTest : BaseMapTest() {
var initialZoom: Double? = null
rule.scenario.onActivity {
it.runOnUiThread {
mapboxMap.jumpTo(CameraOptions.Builder().zoom(4.0).build())
mapboxMap.setCamera(CameraOptions.Builder().zoom(4.0).build())
initialZoom = mapboxMap.getCameraOptions(null).zoom
}
}
Expand Down Expand Up @@ -235,7 +235,7 @@ class GestureActivityTest : BaseMapTest() {
fun doubleTap_interrupted_moveStillEnabled() {
rule.scenario.onActivity {
it.runOnUiThread {
mapboxMap.jumpTo(CameraOptions.Builder().zoom(4.0).build())
mapboxMap.setCamera(CameraOptions.Builder().zoom(4.0).build())
}
}

Expand All @@ -252,7 +252,7 @@ class GestureActivityTest : BaseMapTest() {
rule.scenario.onActivity {
it.runOnUiThread {
// zoom in so we can move vertically
mapboxMap.jumpTo(CameraOptions.Builder().zoom(4.0).build())
mapboxMap.setCamera(CameraOptions.Builder().zoom(4.0).build())
initialCameraPosition = mapboxMap.getCameraOptions(null)
mapView.getGesturesPlugin().quickZoomEnabled = false
}
Expand Down Expand Up @@ -286,7 +286,7 @@ class GestureActivityTest : BaseMapTest() {
fun quickZoom_roundTripping() {
rule.scenario.onActivity {
it.runOnUiThread {
mapboxMap.jumpTo(CameraOptions.Builder().zoom(3.0).build())
mapboxMap.setCamera(CameraOptions.Builder().zoom(3.0).build())
}
}
onView(withId(R.id.mapView)).perform(quickScale(300f, withVelocity = false, duration = 750L))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ObservableExtensionTest : BaseMapTest() {
rule.scenario.onActivity {
it.runOnUiThread {
mapboxMap.subscribeResourceRequest(observer)
mapboxMap.jumpTo(
mapboxMap.setCamera(
CameraOptions.Builder().center(Point.fromLngLat(0.0, 0.0)).zoom(16.0).build()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class MapOverlayPluginTest : BaseMapTest() {

mapOverlayPlugin.reframe {
assertNotNull(it)
mapboxMap.jumpTo(it!!)
mapboxMap.setCamera(it!!)
val currentCameraOptions = mapboxMap.getCameraOptions(EdgeInsets(0.0, 0.0, 0.0, 0.0))
assertEquals(currentCameraOptions.center!!.latitude(), it.center!!.latitude(), 0.01)
assertEquals(currentCameraOptions.center!!.longitude(), it.center!!.longitude(), 0.01)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AddOneMarkerSymbolActivity : AppCompatActivity() {
setContentView(R.layout.activity_simple_map)

mapView.getMapboxMap().also {
it.jumpTo(
it.setCamera(
CameraOptions.Builder()
.center(Point.fromLngLat(LONGITUDE, LATITUDE))
.zoom(8.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CameraPredefinedAnimatorsActivity : AppCompatActivity() {
cameraAnimationsPlugin = mapView.getCameraAnimationsPlugin()
mapboxMap.loadStyle(
style(Style.MAPBOX_STREETS) {
mapboxMap.jumpTo(START_CAMERA_POSITION)
mapboxMap.setCamera(START_CAMERA_POSITION)
}
)
initSpinner()
Expand All @@ -61,7 +61,7 @@ class CameraPredefinedAnimatorsActivity : AppCompatActivity() {

override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
stopAnimation()
mapboxMap.jumpTo(START_CAMERA_POSITION)
mapboxMap.setCamera(START_CAMERA_POSITION)
when (position) {
0 -> {
CameraAnimatorsFactory.setDefaultAnimatorOptions {
Expand Down Expand Up @@ -124,7 +124,7 @@ class CameraPredefinedAnimatorsActivity : AppCompatActivity() {
}

private fun resetCameraPosition() {
mapboxMap.jumpTo(START_CAMERA_POSITION)
mapboxMap.setCamera(START_CAMERA_POSITION)
}

private fun stopAnimation() {
Expand All @@ -135,7 +135,7 @@ class CameraPredefinedAnimatorsActivity : AppCompatActivity() {
private fun playAnimation(itemId: Int) {
stopAnimation()
when (itemId) {
R.id.menu_action_jump_to -> mapboxMap.jumpTo(START_CAMERA_POSITION)
R.id.menu_action_jump_to -> mapboxMap.setCamera(START_CAMERA_POSITION)
R.id.menu_action_ease_to -> mapboxMap.easeTo(
EASE_TO_TARGET_CAMERA_POSITION,
mapAnimationOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.mapbox.maps.extension.observable.subscribeResourceRequest
import com.mapbox.maps.extension.observable.unsubscribeResourceRequest
import com.mapbox.maps.plugin.compass.getCompassPlugin
import com.mapbox.maps.plugin.delegates.listeners.OnMapLoadErrorListener
import com.mapbox.maps.plugin.delegates.listeners.eventdata.MapLoadError
import com.mapbox.maps.plugin.delegates.listeners.eventdata.MapLoadErrorType
import com.mapbox.maps.plugin.scalebar.ScaleBarPlugin
import com.mapbox.maps.plugin.scalebar.getScaleBarPlugin
import com.mapbox.maps.testapp.R
Expand Down Expand Up @@ -38,7 +38,7 @@ class DebugModeActivity : AppCompatActivity() {
override fun notify(event: Event) {
Logger.i(
TAG,
"Type: ${event.type}\nValue: ${event.data.contents}\nBegin: ${event.begin}\nEnd: ${event.end}"
"Type: ${event.type}\nValue: ${event.data.contents}"
)
}
}
Expand Down Expand Up @@ -89,11 +89,11 @@ class DebugModeActivity : AppCompatActivity() {
}

private fun registerListeners(mapboxMap: MapboxMap) {
mapboxMap.addOnStyleLoadingFinishedListener {
Logger.i(TAG, "OnStyleLoadingFinishedListener")
mapboxMap.addOnStyleLoadedListener() {
Logger.i(TAG, "OnStyleLoadedListener")
}
mapboxMap.addOnStyleFullyLoadedListener {
Logger.i(TAG, "OnStyleFullyLoadedListener")
mapboxMap.addOnStyleDataLoadedListener {
Logger.i(TAG, "OnStyleDataLoadedListener: $it")
}
mapboxMap.addOnStyleImageMissingListener {
Logger.i(TAG, "OnStyleImageMissingListener: $it")
Expand All @@ -105,12 +105,12 @@ class DebugModeActivity : AppCompatActivity() {
Logger.i(TAG, "OnMapIdleListener")
}
mapboxMap.addOnMapLoadErrorListener(object : OnMapLoadErrorListener {
override fun onMapLoadError(mapLoadError: MapLoadError, description: String) {
Logger.i(TAG, "OnMapLoadErrorListener: $mapLoadError, $description")
override fun onMapLoadError(mapLoadErrorType: MapLoadErrorType, description: String) {
Logger.i(TAG, "OnMapLoadErrorListener: $mapLoadErrorType, $description")
}
})
mapboxMap.addOnMapLoadingFinishedListener {
Logger.i(TAG, "OnMapLoadingFinishedListener")
mapboxMap.addOnMapLoadedListener {
Logger.i(TAG, "OnMapLoadedListener")
}
mapboxMap.addOnCameraChangeListener {
Logger.i(TAG, "OnCameraChangeListener")
Expand All @@ -130,10 +130,10 @@ class DebugModeActivity : AppCompatActivity() {
"OnSourceAddedListener: $it"
)
}
mapboxMap.addOnSourceChangeListener {
mapboxMap.addOnSourceDataLoadedListener { id, type, loaded, tileID ->
Logger.i(
TAG,
"OnSourceChangeListener: $it"
"OnSourceDataLoadedListener: $id, $type, $loaded, $tileID"
)
}
mapboxMap.addOnSourceRemovedListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DistanceExpressionActivity : AppCompatActivity() {
val circle = TurfTransformation.circle(center, RADIUS, TurfConstants.UNIT_METERS)

// Setup camera position above Georgetown
mapView.getMapboxMap().jumpTo(CameraOptions.Builder().center(center).zoom(16.0).build())
mapView.getMapboxMap().setCamera(CameraOptions.Builder().center(center).zoom(16.0).build())

mapView.getMapboxMap().loadStyle(
style(Style.MAPBOX_STREETS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FillExtrusionActivity : AppCompatActivity() {
setContentView(R.layout.activity_fill_extrusion)
val mapboxMap = (mapView as MapView).getMapboxMap()

mapboxMap.jumpTo(
mapboxMap.setCamera(
CameraOptions.Builder()
.center(Point.fromLngLat(-74.0066, 40.7135))
.pitch(45.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class GeoJsonLayerInStackActivity : AppCompatActivity() {
}
)

mapboxMap.jumpTo(
mapboxMap.setCamera(
CameraOptions.Builder()
.center(Point.fromLngLat(-84.381546, 33.749909))
.zoom(8.471903)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GesturesActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gestures)
mapboxMap = mapView.getMapboxMap()
mapboxMap.jumpTo(
mapboxMap.setCamera(
CameraOptions.Builder()
.center(Point.fromLngLat(-0.11968, 51.50325))
.zoom(15.0)
Expand Down Expand Up @@ -239,7 +239,7 @@ class GesturesActivity : AppCompatActivity() {
focalPointLatLng = Point.fromLngLat(-0.12968, 51.50325)
// TODO add marker
// marker = mapboxMap.addMarker(MarkerOptions().position(focalPointLatLng))
mapboxMap.jumpTo(CameraOptions.Builder().center(focalPointLatLng).zoom(16.0).build())
mapboxMap.setCamera(CameraOptions.Builder().center(focalPointLatLng).zoom(16.0).build())
recalculateFocalPoint()
} else {
// TODO add marker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class InsetMapActivity : AppCompatActivity(), OnCameraChangeListener {
.bearing(mainCameraPosition.bearing)
.center(mainCameraPosition.center)
.build()
insetMapboxMap.jumpTo(insetCameraPosition)
insetMapboxMap.setCamera(insetCameraPosition)
insetMapboxMap.getStyle { style -> updateInsetMapLineLayerBounds(style) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class LegacyOfflineActivity : AppCompatActivity() {
// create mapView
mapView = MapView(this@LegacyOfflineActivity).also { mapview ->
val mapboxMap = mapview.getMapboxMap()
mapboxMap.jumpTo(CameraOptions.Builder().zoom(zoom).center(point).build())
mapboxMap.setCamera(CameraOptions.Builder().zoom(zoom).center(point).build())
mapboxMap.loadStyleUri(styleUrl)
}
setContentView(mapView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LocationComponentActivity : AppCompatActivity() {
private lateinit var locationPermissionHelper: LocationPermissionHelper
private val onIndicatorPositionChangedListener = OnIndicatorPositionChangedListener {
// Jump to the current indicator position
mapView.getMapboxMap().jumpTo(CameraOptions.Builder().center(it).build())
mapView.getMapboxMap().setCamera(CameraOptions.Builder().center(it).build())
// Set the gestures plugin's focal point to the current indicator location.
mapView.getGesturesPlugin().focalPoint = mapView.getMapboxMap().pixelForCoordinate(it)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,21 @@ class LocationComponentAnimationActivity : AppCompatActivity() {

// however on third emit we will emit location almost immediately using custom animator options for single location update
if (delta >= 0.002f && delta < 0.003) {
locationConsumer?.onLocationUpdated(Point.fromLngLat(POINT_LNG + delta, POINT_LAT + delta)) {
locationConsumer?.onLocationUpdated(
Point.fromLngLat(
POINT_LNG + delta,
POINT_LAT + delta
)
) {
duration = 100
}
} else {
locationConsumer?.onLocationUpdated(Point.fromLngLat(POINT_LNG + delta, POINT_LAT + delta))
locationConsumer?.onLocationUpdated(
Point.fromLngLat(
POINT_LNG + delta,
POINT_LAT + delta
)
)
}
locationConsumer?.onBearingUpdated(BEARING + delta * 10000.0 * 5)
delta += 0.001f
Expand Down Expand Up @@ -86,7 +96,7 @@ class LocationComponentAnimationActivity : AppCompatActivity() {
loadStyleUri(
Style.MAPBOX_STREETS
) {
jumpTo(
setCamera(
CameraOptions.Builder()
.zoom(14.0)
.center(Point.fromLngLat(POINT_LNG, POINT_LAT))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class LocationTrackingActivity : AppCompatActivity() {
private lateinit var locationPermissionHelper: LocationPermissionHelper

private val onIndicatorBearingChangedListener = OnIndicatorBearingChangedListener {
mapView.getMapboxMap().jumpTo(CameraOptions.Builder().bearing(it).build())
mapView.getMapboxMap().setCamera(CameraOptions.Builder().bearing(it).build())
}

private val onIndicatorPositionChangedListener = OnIndicatorPositionChangedListener {
mapView.getMapboxMap().jumpTo(CameraOptions.Builder().center(it).build())
mapView.getMapboxMap().setCamera(CameraOptions.Builder().center(it).build())
mapView.getGesturesPlugin().focalPoint = mapView.getMapboxMap().pixelForCoordinate(it)
}

Expand All @@ -57,7 +57,7 @@ class LocationTrackingActivity : AppCompatActivity() {
}

private fun onMapReady() {
mapView.getMapboxMap().jumpTo(
mapView.getMapboxMap().setCamera(
CameraOptions.Builder()
.zoom(14.0)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MultiMapActivity : AppCompatActivity() {
) {
val fragment = supportFragmentManager.findFragmentById(fragmentId) as MapFragment
fragment.getMapAsync {
it.jumpTo(cameraOptions)
it.setCamera(cameraOptions)
it.loadStyleUri(styleId)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PolygonHolesActivity : AppCompatActivity() {
with(mapView.getMapboxMap()) {
// TODO attributionTintColor(RED_COLOR) missing
// TODO compassFadesWhenFacingNorth missing
jumpTo(
setCamera(
CameraOptions.Builder()
.center(Point.fromLngLat(55.3089185, 25.255377))
.zoom(13.0)
Expand Down
Loading