android-v10.0.0-beta.18
Pre-release
Pre-release
pengdev
released this
22 Apr 20:40
·
1461 commits
to main
since this release
10.0.0-beta.18 - April 22, 2021
Breaking changes ⚠️
- Rename MapView plugin extension functions. (#272)
- mapView.getAnnotationPlugin() -> mapView.annotations
- mapView.getGesturesPlugin() -> mapView.gestures
- mapView.getOverlayPlugin() -> mapView.overlay() // using function here because of experimental annotation
- mapView.getLocationComponentPlugin() -> mapView.location
- mapView.getCameraAnimationsPlugin() -> mapView.camera
- mapView.getAttributionPlugin() -> mapView.attribution
- mapView.getCompassPlugin() -> mapView.compass
- mapView.getLogoPlugin() -> mapView.logo
- mapView.getScaleBarPlugin() -> mapView.scalebar
- Remove deprecated location plugin (#276)
- Add feature sdk initialisation (#269)
- Load the Mapbox Street style by default if user doesn't load any style before the onStart lifecycle event.
- Introduce
CredentialsManager
to manage mapbox access token, when allMapView
s should use same token could be handled by usingCredentialsManager.shared
static object. - Introduce
MapInitOptions
to replace MapboxMapOptions. When adding a map programmatically, client codes can be written in a following way
// set map options val mapOptions = MapOptions.Builder() .constrainMode(ConstrainMode.HEIGHT_ONLY) .glyphsRasterizationOptions( GlyphsRasterizationOptions.Builder() .rasterizationMode(GlyphsRasterizationMode.IDEOGRAPHS_RASTERIZED_LOCALLY) .build() ) .build() // set token and cache size for this particular map view val resourceOptions = ResourceOptions.Builder() .accessToken(getString(R.string.mapbox_access_token)) .cacheSize(75_000L) .build() // set initial camera position val initialCameraOptions = CameraOptions.Builder() .center(Point.fromLngLat(-122.4194, 37.7749)) .zoom(9.0) .build() val mapboxMapOptions = MapInitOptions(this, resourceOptions, mapOptions, initialCameraOptions, true) // create view programmatically customMapView = MapView(this, mapboxMapOptions)
Features ✨ and improvements 🏁
- High-level animations return cancelable interface (#262)
- Introduce OfflineManager API that manages style packs and produces tileset descriptors for the tile store.
- By default, users may download up to 250MB of data for offline use without incurring additional charges. This limit is subject to change during the beta.
- The new API replaces the deprecated OfflineRegionManager API. The OfflineManager API can be used to create offline style packs that contain style data, such as: style definition, sprites, fonts and other resources. Tileset descriptors created by the OfflineManager API are used to create tile packs via TileStore API. Mobile maps SDKs use tile packs for rendering map content. Example of how to use API is presented in a following snippet (pseudocode):
// 1. Get an instance of OfflineManager.
val offlineManager = OfflineManager(map.getResourceOptions())
// 2. Create a tile region with tiles for Streets
TilesetDescriptorOptions tilesetOptions(
"mapbox://styles/mapbox/streets-v11",
0, // min zoom
5, // max zoom
);
// Creation of a tileset descriptor WILL implicitly create a style package for provided StylePackLoadOptions.
tilesetOptions.stylePackOptions = StylePackLoadOptions(GlyphsRasterizationMode.AllGlyphsRasterizedLocally);
val descriptor = offlineManager.createTilesetDescriptor(tilesetOptions);
val tileStore = TileStore.getInstance();
TileRegionLoadOptions tileRegionLoadOptions(geometry, [descriptor]);
tileStore.loadTileRegion("my_region", tileRegionLoadOptions,
onProgressCallback(result) {
// Handle TileRegionLoadProgress result
},
onFinishedCallback(result) {
if (result) {
// Handle TileRegion result
} else {
// Handle TileRegionError
}
}
);
- Add offline activity example. (#259)
- Load the Mapbox Street style by default if user doesn't load any style before the onStart lifecycle event(#248)
Bug fixes 🐞
- Keep CompassPlugin enabled/disabled state after other properties update (#252)
- Fix disabling logo in xml. (#273)
- Introduce StyleInterface that include the current display's pixel ratio, and fix Style#addImage to take the correct pixel ratio from display. (#228)
- Properly reset anchor after some gestures。 (#279)
- Remove animator cancel listeners logic duplicating end listeners logic. (#280)
Dependencies
- Bump gl-native to v10.0.0-beta.20, common to v11.0.1 (#261)