✨ Features and improvements
- Add an experimental C plugin API for custom style layer types, with an n-gon layer as example (#4612). Plugins register their layer types with
mln_plugin_register_v1. Only the new artifacts with a-with-plugin-apipostfix export the plugin API:android-sdk-with-plugin-api,android-sdk-opengl-with-plugin-api,android-sdk-vulkan-with-plugin-apiandandroid-sdk-vulkan-opengl-with-plugin-api, each also with a-debugartifact. See Plugin API (#4770). - Add
Style.setGlobalStateProperty()andStyle.getGlobalState()(also onMapSnapshotter) and theExpression.globalState()builder for theglobal-stateexpression and the rootstateproperty of the style. Layer visibility can now be an expression too, withPropertyFactory.visibility(Expression)andLayer.getVisibilityExpression()(#4516). - Add rendered feature introspection, mainly for testing apps. With
MapLibreMapOptions.featureInfoEnabled(true)(orapp:maplibre_featureInfoEnabled),RenderingStats.getRenderedFeatures()inOnDidFinishRenderingFrameWithStatsListenerreports which features each layer drew and where on screen, andMapLibreMap.getRenderedFeatureCount()counts them (#4460). - Support the
interpolate-labandinterpolate-hclexpressions for color ramps in perceptual color spaces. There are noExpressionbuilders for them yet; use them in style JSON or withExpression.raw()(#4668). - Add the
semiliteralexpression and theExpression.semiliteral()builder, so array properties such astext-offsetcan compute their elements with expressions. Converting expressions from JSON now also handles nested arrays and objects insideliteral(#4604). - Support SDF images in
fill-pattern. They are drawn in thefill-color, which can be data-driven (#4551). - Load PMTiles archives bundled in the APK
assets/directory withpmtiles://asset://...URLs. Asset requests now read only the requested byte range (#4602). - Load APK assets from
file:///android_asset/...URIs, the form used by WebView and Compose Multiplatform'sRes.getUri(), in addition toasset://URLs (#4501). - Add
LocationComponent.getUserLocation(), which returns the puck's current animated position, andgetUserLocationAnimationReferenceTime()andgetUserLocationAnimationDuration(), so other graphics such as a vanishing route line can animate in sync with the puck (#4740). - Make the set of available images copy-on-write, speeding up styles with many images and frequently updated sources (#4651).
🐞 Bug fixes
- Fix crashes, such as a SIGSEGV in
AskMessageImpl, whenqueryRenderedFeatures(),querySourceFeatures()or feature state calls race with theMapViewbeing detached or its renderer being reset (#4686). - With the Vulkan renderer, resizing a
SurfaceView-based map no longer blocks the UI thread until the render thread draws a frame, which could cause ANRs (#4705). - Make Vulkan swapchain and surface rebuilds recoverable: a failed rebuild is retried on the next frame, and a surface lost during presentation is recreated instead of throwing (#4730).
- Fix a crash when a
collatorcomparison gets text that is not valid UTF-8, such as a malformednameproperty in a vector tile. The comparison now evaluates to an error instead. Locales that are not valid UTF-8 no longer crashcollatorandnumber-formatexpressions either (#4745). - Fix a crash when an
ImageSourcelies wholly beyond the latitude limits of the map (#4753). - Fix a crash when querying a
CustomGeometrySourcebefore its first tile data arrives (#4718). - Size
line-patternimages like MapLibre GL JS. They were drawn about 1.7× bigger and stretched along the line (#4726). - Load
raster-demtiles at the rounded zoom level, like raster sources and MapLibre GL JS (#4650). - Fix the lighting of fill-extrusion walls on rotated maps (#4662).
- Fix the background layer disappearing after style changes (#4616).
- Fix changes to layer transition options, such as
setFillColorTransition(), and toStyle.setTransition()not being applied (#4677). - Fix the accuracy circle colors of the location indicator layer (used by
LocationComponentwithuseSpecializedLocationLayer) staying one update behind when they change with a transition (#4639). - Keep the camera pitch at or above the minimum pitch when large top padding is set, for example before the map has been laid out. The pitch could become negative and clip the lower part of the map (#4576).
- Extend the Vulkan workaround for
VK_ERROR_DEVICE_LOSTon Adreno 600 series GPUs from the location indicator to all texture sampling (#4666). - Fix invisible raster layers with OpenGL ES on Adreno 3xx GPUs (#4631).
- When a zoom-dependent property expression fails to evaluate, use the property's default value from the style specification, like MapLibre GL JS, instead of a zero value (#4516).
- Count all draw calls in
RenderingStats.totalDrawCallswith the Vulkan renderer. Before, only tile clipping mask draws were counted (#4719). - Detect OpenGL extensions with
glGetStringiwhen available, so they are found whereglGetString(GL_EXTENSIONS)fails, such as some Android emulator configurations (#4579).