MapboxGL.offlineManager.createPack Android Crash
Describe the bug I'm trying to save and offline region so users can surf the map without a connection, currently taking the visible bounds of the screen and save them as the pack, the problem is that I have no logs from react native it just crash and when I call getPacks() I can find the pack there (of course not fully installed).
After Looking at android logcat I found it's something related to threading and bad memory usage by Mapbox.
this is my code:
MapboxGL.offlineManager.createPack(
{
name: this.state.offlineMapsModalText,
styleURL: this.props.styleUrl,
minZoom: 14,
maxZoom: 20,
bounds: [r[0], r[1]],
},
progressListener,
errorListener
)
Versions (please complete the following information):
- Platfrom: Android
- Device: Galaxy A8+
- OS: Android 9.0
- SDK Version 28
- React Native Version 0.59.4
If you ask for a too large size, the pack will crash. Make sure you limit it. I don’t have any good numbers, so try small first and then increase size. Reopen ticket if the issue still persists with a small area.
Update: Max zoom 20 is way outside what is possible. Do something like minzoom 10, maxzoom 14.