Releases: mapbox/mapbox-maps-android
android-v10.0.0-rc.8
10.0.0-rc.8 September 8, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Breaking changes ⚠️
- In offline mode (set by either mapbox::common::OfflineSwitch API or on platform side), the error notifications are send if the required resources are not present locally. The volatile tiles are not considered to be required in offline.(#604)
- Adapt setBounds to gl-js behavior: constraining of coordinates and zoom level is now stricter to prevent out of bounds map area to be visible in the viewport.(#604)
- Add HTTP interceptor API - for anyone who is using HttpServiceInterface; there is a new method called setInterceptor that should be overridden(#604)
Features ✨ and improvements 🏁
- Make 3D puck always over (in front of) 3D layers (buildings, landmarks, custom layer) but behind hill (terrain). (#601)
- Integrate value marshalling performance improvement (#606)
- Introduce drag layer/source for annotation plugin to improve drag performance. (#582)
- Update prefetch zoom delta documentation to match actual behavior (#609)
- Add support for the index-of and slice expressions (#616)
- Improve collision detection by using runtime calculated sizes for collision boxes. Previously collision boxes' sizes are constant, they are calculated during symbol layout time by using constant zoom level(#604)
- Improve collision detection by using runtime calculated pixelated sizes for collision circles. Previously collision circles' sizes are constant, they are calculated during symbol layout time by using constant zoom level(#604)
- Implement 'promoteId' feature for geojson and vector sources. The feature allows to promote feature's property to a feature id, so that promoted id can be used with FeatureState API.(#604)
- Enable instant transitions for data driven paint layer properties(#604)
Bug fixes 🐞
- Use touch focal point to calculate the correct scroll displacement when the map is pitched. (#593)
- Use touch focal point to calculate the correct fling displacement. (#599)
- Allow geojson source to initialise with empty data. (#602)
- Preserve EGL setup on renderer stop. This fixes full map reloading when map is brought out from background. (#598)
- Fix issue with camera animators ordering on Android 6 and lower by revisiting overall approach of applying accumulated camera changes. (#597)
- Enable update bitmap for annotations (#615)
- Fix volatile tiles disappearing on "not modified" response(#604)
- Prioritize addition of a persistent layer whose id is used for other persistent layer positions(#604)
- Only do line breaking process for point placement labels. And if text-max-width is 0, still do general ideographic beaking checks for point labels.(#604)
- Fix collision box's 'dynamicVerticesExt' updating in placement stage(#604)
- Trigger map redraw when feature state changes (#604)
Dependencies
- Bump gl-native to 10.0.0-rc.8, common to 18.0.0 (#604)
android-v10.0.0-rc.7
10.0.0-rc.7 August 25, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Breaking changes ⚠️
- Remove the expression getter/setters for source properties. (#568)
Features ✨ and improvements 🏁
- Add generateId property for GeoJsonSource. (#538)
- Add default value to improve usability of FeatureState API. (#588)
- Add Style#moveStyleLayer(layerId: String, layerPosition: LayerPosition?): Expected<String, None> API (#563)
- Allow using combination of line-dasharray and line-gradient for line layer. (#563)
Bug fixes 🐞
- Remove strong ref dependency in snapshotter that was leading to a memory leak if Snapshotter#destroy was not called explicitly. (#571)
- Fix get annotation enum property crash (#579)
- Fix rendering issue for round line-join in line gradients (#565)
- A fix of the layer paint property evaluation while transitioning from a data-driven value. It snaps immediately to the new value thus preventing of drawing stale data during the animation.(#563)
- Reduced memory consumption when using raster layers by deleting CPU side tile bitmap copy after uploading to GPU texture.(#563)
- Fix crash on Android when using tile requests delay API(#563)
Dependencies
android-v10.0.0-rc.6
10.0.0-rc.6 August 11, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Breaking changes ⚠️
- Update extension function signatures making them easier to use from Java. (#539)
- Rename
mapView#overlay()
tomapView#mapboxOverlay
. (#539)
Features ✨ and improvements 🏁
- Support adding 9-patch images to the style. (#536)
- Outdated data for volatile sources gets hidden if cannot be updated due to no Internet connection. (#543)
Bug fixes 🐞
- Fix several memory leaks: clean up OnFpsChangeListener on render thread destroy / introduce Snapshotter#destroy method that must be called in Activity#onDestroy (#546)
- Add layer and source check when creating annotations and init them if not initiated before which creates
AnnotationManager
before loading style. (#549) - Fix error messages returned by
Style#removeStyleSource
method. (#543) - Store persistent layer's LayerPosition, so that layer can be re-added to correct position if LayerPosition.above or LayerPosition.at is used. (#543)
Dependencies
android-v10.0.0-rc.5
10.0.0-rc.5 July 28, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Breaking changes ⚠️
- Improve camera API consumption from java programming language by adding
CameraAnimationsUtils
andgetCamera
JvmName annotations. (#495) - Rename
AttributionView#setOnClickListener
tosetViewOnClickListener
to avoid overloading the Android SDK method. Results in compilation on Android P and above. Adjust codebase to changes in enforced nullability of Android SDK code. (#497) - Get rid of using reflection when creating plugins which should decrease
MapView
startup time if plugins are enabled. (#519)
Features ✨ and improvements 🏁
- Add
showLogo
andshowAttributes
config for snapshotter which are defaulted to true. User can now hide logo and attributions in a snapshotter by changing this config (#496) - Add lifecycle plugin so there is no need to call
onStart
/onStop
/onDestroy
/onLowMemory
methods explicitly, if the appcompact 1.3.0+ is used. (#485) - Add a minimum Android Auto test app and an optional Android Auto extension that provide convenient extension function to initialise the MapSurface from a Car App Session. (#488)
- Add lint check for lifecycle methods (#516)
Bug fixes 🐞
- Fix issues with MapView#snapshot methods that could cause black snapshot or ANR in some cases. (#508)
android-v10.0.0-rc.4
10.0.0-rc.4 July 14, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Features ✨ and improvements 🏁
- Add new param to allow users localize selected layers. (#461)
- Add API to control logging for animation plugin and disable debug logs by default. (#474)
- Introduce option to use continuous rendering for scale bar. Continuous render mode will fix gfxinfo profiling. (#458)
- Add shortest bearing path option for animators. (#473)
- Add modelTranslation support for LocationPuck3D (#493)
- Add default parameters to coordinate conversion functions of MapCameraManagerDelegate#cameraForCoordinates, MapCameraManagerDelegate#cameraForCoordinateBounds and MapCameraManagerDelegate#cameraForGeometry. This overloads the functions to have a more simple API surface for developers to hook into. (#491)
- Support text-writing-mode property for line symbol-placement text labels (#1766)
Note: This change will bring following changes for CJK text block:- For vertical CJK text, all the characters including Latin and Numbers will be vertically placed now. Previously, Latin and Numbers are horizontally placed.
- For horizontal CJK text, it may have a slight horizontal shift due to the anchor shift.
- Session SKU generation is now available
- Add getSKUTokenIfValid to get a SKU token for a SKU identifier if it exists and is not expired, return empty string if not.
- Allow filtering of log messages by categories.
- Expose isFiltered for checking logging category settings
Bug fixes 🐞
- Fix flyTo crash when using single-pixel paddings. (#478)
- Fixed regression in map gestures on devices with Android 6 and lower. (#484)
- Fix overwriting sync geojson data with getSourceAs by async. (#482)
- Clean up network listener after http file source gets out of scope
- Fix line-center anchor calculation when the anchor is very near to the line geometry point
- Fix crash when a Feature State API is used with dedicated rendering thread
- Fix threading issues in HTTP file source
- Fix volatile tilesets handling
Dependencies
- Update gl-native to v10.0.0-rc.5 and common to v16.0.0. (#487)
android-v10.0.0-rc.3
10.0.0-rc.3 June 30, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Breaking changes ⚠️
- Perform annotation click synchronously and change AnnotationManagerImpl#queryMapForFeatures function to be synchronous. (#455)
API change:
// async
fun queryMapForFeatures(screenCoordinate: ScreenCoordinate, callback: QueryAnnotationCallback<T>)
||
\/
// sync
fun queryMapForFeatures(screenCoordinate: ScreenCoordinate): T?
Features ✨ and improvements 🏁
- Introduce static MapboxMap.clearData(resourceOptions: ResourceOptions, callback: AsyncOperationResultCallback) API and MapboxMap#clearData(callback: AsyncOperationResultCallback), Snapshotter#clearData(callback: AsyncOperationResultCallback) APIs. (#442)
- Optimise the Style#getLayer and Style#getSource APIs' performance. (#449)
- MapEvents#MAP_LOADING_ERROR events now include source and tile information where appropriate. New fields would allow developers to understand what source or tile has failed to load and the reason for a failure. (#442)
Bug fixes 🐞
- Fix dropping annotation source updates if those were emitted rapidly without handler. (#441)
- Fix raster/v1 terrain tiles fetch failures caused by appending pixel ratio to the URLs when tile size is equal to 512. (#442)
- Fixed an issue that the LayerPosition is not persisted across the style change, when using persistent layer based annotation plugin and location component plugin. (#442)
- Disable MapboxTelemetryInitProvider if the telemetry is disabled via app's manifest reducing startup time. (#457)
Dependencies
android-v10.0.0-rc.2
10.0.0-rc.2 June 23, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Features ✨ and improvements 🏁
- Introduce experimental
Style#addPersistentLayer
,Layer#isPersistent
,Style#addPersistentStyleLayer
,Style#addPersistentStyleCustomLayer
andStyle#isStyleLayerPersistent
APIs, so that the tagged layer and its associated resources would remain when a style is reloaded. This improves performance of Annotation and Location Component Plugin during the style change. (#368, #422) - Add Localization API to apply languages to the style by provided locale. (#379)
- Reduce unnecessary render cache texture updates by introducing a small delay after zoom has changed.
- Save and read application state on a background thread, to avoid delays (~3-5ms) on the main thread.
Bug fixes 🐞
- Introduce size check for render cache. (#425)
- Fix memory leak on render destroy. (#426)
- Changes the visibility of jsonObject in annotation to protected, fix ConcurrentModificationException (#427)
- Fix camera deadlock use-case. (#439)
- Tileset descriptor resolving fixes:
- Operation completes even if the offline manager instance gets out of scope
- Fixes leaking TilesetResolverObserver instance
- Fixes possible crash on cancellation of pending style pack download operation
- Fix text rendering when both 'text-rotate' and 'text-offset' are set.
- Fix Android 12 compatibility to support pending intents mutability.
Dependencies
android-v10.0.0-rc.1
10.0.0-rc.1 June 10, 2021
The Mapbox Maps SDK for Android has moved to release candidate status and is now ready for production use.
Breaking changes ⚠️
- Rename setter for
Light
object fromadd
toset
. This matches API from GL-JS and clarifies there is only 1 Light object. (#387) - Rename setter for
Terrain
object fromadd
toset
. (#391) - Remove
CacheManager
. In the following releases, an API to control temporary map data may be provided. (#399) - Remove
ResourceOptions::cacheSize
andDefaultAmbientCacheSize
constant. (#399) - Replace
ResourceOptions::cachePath
withResourceOptions::dataPath
that accepts a folder in which the map stores offline style packages and temporary map data. (#399) - Rename
TileStore::getInstance()
toTileStore::create()
. (#399) - Remove the
MapView#setRenderCache
andMapSurface#setRenderCache
API and replaced them with experimentalMapboxMap#setRenderCacheOptions
andMapboxMap#getRenderCacheOptions
APIs. (#401) - Change the default
ResourceOptions#dataPath
to${context.filesDir.absolutePath}/.mapbox/map_data/
and the database name fromambient_cache.db
tomap_data.db
. (#403)
Features ✨ and improvements 🏁
- The amount of the unique maps tile packs used in the offline regions is capped by the maximum amount equal to 750. The tile region loading is not be performed if it would cause exceeding of the tile pack limit. (#399)
Bug fixes 🐞
- Fix a typo in
MapboxMapUtils
jvm name. (#396) - Fix an issue that vertical text was not positioned correctly if the
text-offset
property was used. (#399) - Emit
MapLoadingError
when an empty token is provided for accessing Mapbox data sources. Before the fix, the application may crash if an empty token was provided and map tries to load data from Mapbox data source. (#399) - Create folder structure for provided
ResourceOptions#dataPath
when a provided folder doesn't exist. Before the fix, map expected the folder to exist, and in case it didn't, it was difficult to report an error to the application. (#399) - Do not emit
MapLoadingError
when an empty URL is set to GeoJSON source. (#399) - Avoid packaging
gms-play-services-location
by default as part of the Android SDK. (#399) - Fix an issue that causes public resource definitions not generated in public.txt file. (#404)
Dependencies
- Bump gl-native to v10.0.0-rc.1, common to v14.0.1 (#399)
android-v10.0.0-beta.21
10.0.0-beta.21- June 3, 2021
Breaking changes ⚠️
- Align load style functions for MapboxMap and Snapshotter. (#371)
Snapshotter.setUri(uri: String) -> Snapshotter.setStyleUri(styleUri: String)
Snapshotter.getUri()-> Snapshotter.getStyleUri()
Snapshotter.setJson(styleJson: String) -> Snapshotter.setStyleJson(styleJson: String)
Snapshotter.getJson()-> Snapshotter.getStyleJson()
MapboxMap.loadStyleJSON(styleJson: String) -> MapboxMap.loadStyleJson(styleJson: String)
- Change the default ambient cache path to
.mapbox/maps/ambient_cache.db
(#373) - Move text-font property from PointAnnotation to PointAnnotationManager (#375)
- Remove CredentialsManager in favour of ResourceOptionsManager (#365)
- Introduce separate minZoom/maxZoom fields into CustomGeometrySourceOptions API instead of the formerly used "zoomRange"
Features ✨ and improvements 🏁
- Rework setPrefetchZoomDelta to reduce loading of expensive tiles and optimize zoom use-case (#1850)
- Send billing event when Map is loaded
Bug fixes 🐞
- Fixed an issue that causes OnStyleLoaded callback not fired when there's a sprite loading error. (#358)
- Update map camera on first animator update. (#352)
- Fix crash due to missing access token (#365)
- Call style loaded callback if data set directly to geojson. (#377)
- Geojson async data parsing: fixes and improvements. (#380)
- Fix terrain transparency issue when a sky layer is not used
- Make style pack resources immutable protecting the style pack from getting out of sync in case the style is updated remotely
Dependencies
android-v10.0.0-beta.20
10.0.0-beta.20 - May 20, 2021
Breaking changes ⚠️
- Introduce ResourceOptionsManager to configure the default resource options, and removed the xml configuration options for cache path and tile store path. (#339)
- Rename default ambient cache database to mapbox/maps/ambient_cache.db (#314)
- Remove the usage of asset path from the codebase, as it is not useful in Android Maps SDK. (#334)
- Rename
NetworkConnectivity
toOfflineSwitch
- Remove
TileLoadOptions
fromTileRegionLoadOptions
.networkRestriction
andacceptExpired
can now be specified directly inTileRegionLoadOptions
. - Add
totalBytes
andtransferredBytes
to TileStoreLoadResult MapboxMap.setBounds
return type changed from Void to Expected- Expose tileset version for sources that use TileJSON metadata
- ResourceRequest
offline-data
boolean field is replaced with thesource
string field, which whether the response came from network, cache or tile store. - Remove
Style.getStyleGeoJSONSourceClusterLeaves
,Style.getStyleGeoJSONSourceClusterExpansionZoom
,Style.getStyleGeoJSONSourceClusterChildren
. All those can be fully replaced byMapboxMap.queryFeatureExtensions
.
Parsing geojson on a worker thread. (#327)
If preparing geojson with DSL functions new logic is introduced.
/**
* DSL function for [GeoJsonSource] performing parsing using background thread.
* Immediately returns [GeoJsonSource] with no data set and starts preparing actual data
* using a worker thread.
*
* If using runtime styling:
*
* loadStyle(style(Style.DARK) {
* +geoJsonSource(id) {
* featureCollection(collection)
* }
* ...
* }
*
* compositing style will be performed correctly under the hood and
* [Style.OnStyleLoaded] will be emitted in correct moment of time when all sources are parsed.
*
* If creating geojson sources for already loaded Style please consider using overloaded
* geoJsonSource(String, GeoJsonSource.Builder.() -> Unit, onGeoJsonParsed: (GeoJsonSource) -> Unit) function
* and use fully prepared [GeoJsonSource] in onGeoJsonParsed callback.
*/
fun geoJsonSource(
id: String,
block: GeoJsonSource.Builder.() -> Unit
): GeoJsonSource
/**
* DSL function for [GeoJsonSource] performing parsing using a worker thread.
* Immediately returns [GeoJsonSource] with no data set,
* fully parsed [GeoJsonSource] is returned in [onGeoJsonParsed] callback.
*
* Using this method means that it is user's responsibility to proceed with adding this source,
* layers or other style objects in [onGeoJsonParsed] callback.
*/
fun geoJsonSource(
id: String,
block: GeoJsonSource.Builder.() -> Unit,
onGeoJsonParsed: (GeoJsonSource) -> Unit
): GeoJsonSource
If updating existing GeoJsonSource
from some Style
overloaded functions are introduced:
/**
* Add a FeatureCollection to the GeojsonSource.
* If [onDataParsed] is provided and not null - data will be loaded in async mode.
* Otherwise method will be synchronous.
*
* @param value the feature collection
* @param onDataParsed optional callback notifying when data is parsed on a worker thread
*/
fun featureCollection(
value: FeatureCollection,
onDataParsed: ((GeoJsonSource) -> Unit)? = null
)
Similar functions are introduced for feature
and geometry
.
Features ✨ and improvements 🏁
- Add a
cameraOptions(cameraState, builderBlock)
inline method that helps mutate an existingCameraState
object. (#317) - Add selected state handling to annotation plugin (#316)
- Add API for disabling vertical/horizontal scroll gestures (#319)
- Introduce API to enable render cache feature that could bring up rendering performance improvement. (#326)
- Add
removeAnnotationManager
API. (#330) - Improve terrain's rendering performance
- Set
begin
andend
timestamps for StyleLoaded and MapLoaded events, so that developers could check how much time it takes to load style and map, respectively - Added
tile-requests-delay
andtile-network-requests-delay
runtime source properties - an API for tile requests delay - Introduce MapOptions.optimizeForTerrain option that allow style rendering optimizations for terrain rendering
- The
text-line-height
is now data-driven property - MapLoaded, StyleLoaded and StyleDataLoaded events now contain begin and end timestamps reflecting the effective duration timespan
- When line lablels are inside the flip state retaining range (+/- 5 degrees around the vertical direction), the lables' flip state will be kept the same
- Improve rendering quality of fill outlines when using render cache
Bug fixes 🐞
- Fix scalebar doesn't refresh issue. (#331)
- Trigger nested high-level animator listener correctly. (#335)
- Make compass visible when camera was mutated while compass was disabled. (#322)
- Enable LocationComponent automatically when style loaded; fix null island location puck (#333)
- Fix crash if the belowLayerId doesn't exist on the current style (#330)
- Fixed an issue that style pack download cancels pending tileset descriptor resolving, now tile region loading and style pack loading can work in parallel.
- Fixed the excessive network usage during map browsing caused by losing of the expiration date and the etag for the cached files
- Fix excessive network usage for delayed tile requests
- On style pack update we reset only glyphs and only when the updated options require less glyphs than currently available and we make sure ambient cache size limit is never exceeded
- Emit
StyleDataLoaded
andSourceDataLoaded
synchronously if possible, so that developers could modify style and sources before map starts rendering style - Fix occasional Adreno 640 and 620 driver warnings and deadlock when terrain is used
- Fix rendering order of transparent terrain proxy tiles
Known issues
When using this release, the merged Manifest comes with an unnecessary WRITE_SETTINGS
permission declaration. You can ignore that permission and not request it or add this to your Manifest file as a workaround:
<uses-permission android:name="android.permission.WRITE_SETTINGS" tools:node="remove"/>
This permission declaration will be removed in future releases.