Skip to content

android-v10.0.0-beta.20

Pre-release
Pre-release
Compare
Choose a tag to compare
@pengdev pengdev released this 20 May 17:46
· 1420 commits to main since this release
ee6d2d2

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 to OfflineSwitch
  • Remove TileLoadOptions from TileRegionLoadOptions. networkRestriction and acceptExpired can now be specified directly in TileRegionLoadOptions.
  • Add totalBytes and transferredBytes 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 the source 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 by MapboxMap.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 existing CameraState 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 and end 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 and tile-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 and SourceDataLoaded 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.

Dependencies

  • Update telemetry (v7.0.1) and core (v4.0.1) dependencies to latest major version releases (#337)
  • Bump gl-native to v10.0.0-beta.22 and common to v12.0.0. (#338)