Preloading map tiles fails for locally provided style.json
Environment
- Android OS version: Any
- Devices affected: Any
- Maps SDK Version: 10.8.1
Observed behavior and steps to reproduce
For my usecase, I am shipping a style bundled with the app which I am using to render the map. This all works fine, but I would like to prefetch tiles related to this style. I have been pretty much following the instructions provided here to do so.
Instead of setting a mapbox://... style url in order do prefetch data, I am using a local url asset://styles.json. The map renders just fine with this URI, but for prefetching, I only get an error in the console. [type: TilesetDescriptor, message: Failed to resolve tileset descriptors: Failed to load style.]
val tilesetDescriptor = offlineManager.createTilesetDescriptor(
TilesetDescriptorOptions.Builder()
.styleURI("asset://style.json")
.stylePackOptions(stylePackLoadOptions)
.minZoom(0)
.maxZoom(4)
.build()
)
Expected behavior
Tile/ stylepack prefetching works the same for remotely available styles or locally provided styles.
Additional links and references
I have created a sample project demonstrating the issue.
The locally provided style (style.json) is 100% the same style as the default Satellite style. I downloaded it via mapbox studio.