diff --git a/CHANGELOG.md b/CHANGELOG.md index 599c1cd5e6..c766726a23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,13 +20,29 @@ mapView.location2.puckBearingEnabled = true mapView.location2.puckBearingEnabled = false ``` * Add support for custom widgets rendered on top of the map. ([#1036](https://github.com/mapbox/mapbox-maps-android/pull/1036)) +* Improve rendering performance by coalescing map updates when possible. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Add `StyleManager::hasStyleImage` API that checks whether an image is in the style or not. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Improve Snapshotter performance by using a lightweight scheduler instead of platform runloop. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Map now waits on sprite sheet loading before rendering. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Improve map rendering performance by avoiding calculations for all the non-transitional style layer paint properties. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Enable using of tile pack scheme from TileJSON. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Improve map rendering performance by decreasing de/allocations in map placement code. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Avoid style layer properties transition calculation when `TransitionOptions::duration` is set to 0. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Enable tile packs for DEM terrain tiles, it includes both Offline API and `TileStoreUsageMode::ReadAndUpdate` resource option. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Render tiles with partial content while the glyph dependencies are loading. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Canonicalize URLs and enable Offline API usage for the 3dtiles/v1 tiles. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) ## Bug fixes 🐞 * Fix skipping / crashing user events scheduled on a render thread with `MapView#queueEvent`. ([#1068](https://github.com/mapbox/mapbox-maps-android/pull/1068)) * Fix location puck not being shown if map is created without initial style (e.g. MapInitOptions.styleUri == null) and then loaded asynchronously. ([#1114](https://github.com/mapbox/mapbox-maps-android/pull/1114)) * Fix crash within location plugin that happens when style is reloaded simultaneously with location plugin updates. ([#1112](https://github.com/mapbox/mapbox-maps-android/pull/1112)) +* Fix screen coordinate queries when using zero pitch and high zoom values. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Avoid possible crash at program exit caused by dummy tracer accessed after the destruction. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Fix crash for the case when a map event is handled by an Observer of a destructed map. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) +* Fix shimmering artifact when pitched raster tiles with compressed textures are rendered. ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) ## Dependencies +* Bump gl-native to 10.4.0-beta.1, mapbox-common to v21.2.0-beta.1 ([#1160](https://github.com/mapbox/mapbox-maps-android/pull/1160)) * Update android gradle plugin to v7.0.4, gradle version to v7.0.2, Gradle licence plugin to 0.8.80, Kotlin gradle plugin to 1.5.31, Jacoco to 0.8.7. ([#1118](https://github.com/mapbox/mapbox-maps-android/pull/1118)) # 10.3.0 February 10, 2022 diff --git a/LICENSE.md b/LICENSE.md index e19973620a..f6be2c9798 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -62,7 +62,7 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens Mapbox Maps Android uses portions of the Android Support Library compat. -URL: [https://developer.android.com/jetpack/androidx/releases/core#1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0) +URL: [https://developer.android.com/jetpack/androidx/releases/core#1.6.0](https://developer.android.com/jetpack/androidx/releases/core#1.6.0) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -84,6 +84,14 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== +Mapbox Maps Android uses portions of the Experimental annotation. + +URL: [https://developer.android.com/jetpack/androidx/releases/annotation#1.1.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.1.0) + +License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Maps Android uses portions of the Gson. License: [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -122,6 +130,14 @@ License: [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENS =========================================================================== +Mapbox Maps Android uses portions of the Kotlin Stdlib Jdk8. + +URL: [https://kotlinlang.org/](https://kotlinlang.org/) + +License: [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Maps Android uses portions of the Mapbox Android Commmon OkHttp SDK. URL: [https://github.com/mapbox/mapbox-sdk-common](https://github.com/mapbox/mapbox-sdk-common) @@ -194,14 +210,6 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== -Mapbox Maps Android uses portions of the org.jetbrains.kotlin:kotlin-stdlib-jdk8. - -URL: [https://kotlinlang.org/](https://kotlinlang.org/) - -License: [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - -=========================================================================== - Mapbox Maps Android uses portions of the VersionedParcelable. URL: [http://developer.android.com/tools/extras/support-library.html](http://developer.android.com/tools/extras/support-library.html) diff --git a/android-auto-app/build.gradle.kts b/android-auto-app/build.gradle.kts index b929ce5ebb..8c587c5f2b 100644 --- a/android-auto-app/build.gradle.kts +++ b/android-auto-app/build.gradle.kts @@ -31,10 +31,11 @@ android { } } - if (buildFromSource.toBoolean()) { - packagingOptions { - pickFirst("**/libc++_shared.so") + packagingOptions { + if (buildFromSource.toBoolean()) { + jniLibs.pickFirsts.add("**/libc++_shared.so") } + jniLibs.pickFirsts.add("**/libmapbox-common.so") } } diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 28108a2543..6ed332baf1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -54,13 +54,13 @@ android { javaMaxHeapSize = "4g" } - if (buildFromSource.toBoolean()) { packagingOptions { - pickFirst("**/libc++_shared.so") - pickFirst("**/libmapbox-common.so") + if (buildFromSource.toBoolean()) { + jniLibs.pickFirsts.add("**/libc++_shared.so") + } + jniLibs.pickFirsts.add("**/libmapbox-common.so") } } -} dependencies { implementation(project(":sdk")) diff --git a/buildSrc/src/main/kotlin/Project.kt b/buildSrc/src/main/kotlin/Project.kt index bd2981ab7a..9c671dd33b 100644 --- a/buildSrc/src/main/kotlin/Project.kt +++ b/buildSrc/src/main/kotlin/Project.kt @@ -84,8 +84,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.3.2" - const val mapboxCommon = "21.1.0" + const val mapboxGlNative = "10.4.0-beta.1" + const val mapboxCommon = "21.2.0-beta.1" const val mapboxAndroidCore = "5.0.0" const val mapboxAndroidTelemetry = "8.1.0" const val androidxCore = "1.3.1" diff --git a/extension-style-app/build.gradle.kts b/extension-style-app/build.gradle.kts index da1589e7d0..43cbbf4fca 100644 --- a/extension-style-app/build.gradle.kts +++ b/extension-style-app/build.gradle.kts @@ -31,10 +31,11 @@ android { } } - if (buildFromSource.toBoolean()) { - packagingOptions { - pickFirst("**/libc++_shared.so") + packagingOptions { + if (buildFromSource.toBoolean()) { + jniLibs.pickFirsts.add("**/libc++_shared.so") } + jniLibs.pickFirsts.add("**/libmapbox-common.so") } } diff --git a/sdk/api/sdk.api b/sdk/api/sdk.api index a54b11fee6..26ea19fd6a 100644 --- a/sdk/api/sdk.api +++ b/sdk/api/sdk.api @@ -397,6 +397,7 @@ public final class com/mapbox/maps/Style : com/mapbox/maps/extension/style/Style public fun getStyleTerrainProperty (Ljava/lang/String;)Lcom/mapbox/maps/StylePropertyValue; public fun getStyleTransition ()Lcom/mapbox/maps/TransitionOptions; public fun getStyleURI ()Ljava/lang/String; + public fun hasStyleImage (Ljava/lang/String;)Z public fun invalidateStyleCustomGeometrySourceRegion (Ljava/lang/String;Lcom/mapbox/maps/CoordinateBounds;)Lcom/mapbox/bindgen/Expected; public fun invalidateStyleCustomGeometrySourceTile (Ljava/lang/String;Lcom/mapbox/maps/CanonicalTileID;)Lcom/mapbox/bindgen/Expected; public fun isStyleLayerPersistent (Ljava/lang/String;)Lcom/mapbox/bindgen/Expected; diff --git a/sdk/build.gradle.kts b/sdk/build.gradle.kts index 7fbc427bc9..59c10e55fe 100644 --- a/sdk/build.gradle.kts +++ b/sdk/build.gradle.kts @@ -38,7 +38,9 @@ android { targetCompatibility = JavaVersion.VERSION_1_8 } } - + packagingOptions { + jniLibs.pickFirsts.add("**/libmapbox-common.so") + } sourceSets { // limit amount of exposed library resources getByName("main").res.srcDirs("src/main/res-public") diff --git a/sdk/src/main/java/com/mapbox/maps/NativeMapImpl.kt b/sdk/src/main/java/com/mapbox/maps/NativeMapImpl.kt index 61652a722d..6f5b369c91 100644 --- a/sdk/src/main/java/com/mapbox/maps/NativeMapImpl.kt +++ b/sdk/src/main/java/com/mapbox/maps/NativeMapImpl.kt @@ -377,6 +377,10 @@ internal class NativeMapImpl(private val map: MapInterface) : return map.removeStyleImage(imageId) } + override fun hasStyleImage(imageId: String): Boolean { + return map.hasStyleImage(imageId) + } + override fun queryRenderedFeatures( shape: MutableList, options: RenderedQueryOptions, diff --git a/sdk/src/main/java/com/mapbox/maps/Style.kt b/sdk/src/main/java/com/mapbox/maps/Style.kt index 8c79661e51..614de001aa 100644 --- a/sdk/src/main/java/com/mapbox/maps/Style.kt +++ b/sdk/src/main/java/com/mapbox/maps/Style.kt @@ -527,6 +527,17 @@ class Style internal constructor( override fun removeStyleImage(imageId: String): Expected = styleManagerRef.call { this.removeStyleImage(imageId) } + /** + * Checks whether an image exists. + * + * @param imageId The identifier of the image. + * + * @return True if image exists, false otherwise. + */ + override fun hasStyleImage(imageId: String): Boolean { + return styleManagerRef.call { this.hasStyleImage(imageId) } + } + /** * Gets style layer properties. * diff --git a/sdk/src/test/java/com/mapbox/maps/NativeMapTest.kt b/sdk/src/test/java/com/mapbox/maps/NativeMapTest.kt index 9337e68ea3..baf2003c5e 100644 --- a/sdk/src/test/java/com/mapbox/maps/NativeMapTest.kt +++ b/sdk/src/test/java/com/mapbox/maps/NativeMapTest.kt @@ -316,6 +316,13 @@ class NativeMapTest { verify { map.removeStyleImage("foo") } } + @Test + fun hasStyleImage() { + val nativeMap = NativeMapImpl(map) + nativeMap.hasStyleImage("foo") + verify { map.hasStyleImage("foo") } + } + @Test fun addStyleCustomGeometrySource() { val value = mockk() diff --git a/sdk/src/test/java/com/mapbox/maps/StyleTest.kt b/sdk/src/test/java/com/mapbox/maps/StyleTest.kt index 9c0fdfa6df..ace6d16d52 100644 --- a/sdk/src/test/java/com/mapbox/maps/StyleTest.kt +++ b/sdk/src/test/java/com/mapbox/maps/StyleTest.kt @@ -61,6 +61,12 @@ class StyleTest { verify { nativeMap.removeStyleImage("id") } } + @Test + fun hasImage() { + style.hasStyleImage("id") + verify { nativeMap.hasStyleImage("id") } + } + @Test fun addBitmap() { val bitmap: Bitmap = mockk(relaxed = true)