mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

Preloading map tiles fails for locally provided style.json

Open florianPOLARSTEPS opened this issue 3 years ago • 0 comments

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.

florianPOLARSTEPS avatar Oct 20 '22 11:10 florianPOLARSTEPS