Closed wen-kai closed 2 years ago
additionally it appears the following methods are not implemented for Android (https://github.com/rnmapbox/maps/blob/main/android/rctmgl/src/main/java-v10/com/mapbox/rctmgl/modules/RCTMGLOfflineModule.kt#L333).
for a useable experience it seems at least createPack and deletePack should be functional.
we were finally able to get createPack to consistently work for Android. a few strange observations:
createPack
resolves immediately rather than resolving when the download is complete. we ended up wrapping createPack
in a promise that resolves when the updateProgressCallback status.state === 'complete'.MapView
is rendered prior to calling createPack
. Our app allows users to download regions on a screen without a rendered Map, so as a hack we render a MapView
component off-screen for non-map views.Added implementation for deletePack
for Android v10 here:
https://github.com/rnmapbox/maps/pull/2074
@wen-kai I've managed to get a single pack working offline on Android following your instructions, but I still have the issue that after re-load there is no meta-data attached to the pack. I want to download multiple packs and be able to enumerate them but the name property disappears after re-load still. Did you figure this out?
Describe the bug
Offline downloading of packs does not work on Android, but it does work on iOS. On Android, after calling
OfflineManager.createPack
for multiple regions it appears there is only a single pack returned inOfflineManager.getPacks()
. This pack appears to lack any metadata or identifier (name), and does not actually load the supposedly downloaded tiles when the map is rendered in the downloaded region's bounds & zoom level.Android offline mode maps is currently an unusable experience on v10. iOS works as expected.
To Reproduce
state.showMap
to true in example below)Actual: Empty map is rendered for downloaded region/zoom level. Expected: Map of downloaded region/zoom level is rendered.
Example:
Expected behavior
Map of downloaded region/zoom level is rendered. Downloaded Pack should include specified metadata and identifier.
Actual behavior
Empty map is rendered for the downloaded region/zoom level. getPacks() only shows a single pack which doesn't reflect the parameters of the pack.
Versions (please complete the following information):
Additional context
Works as expected on iOS.
Thank you for the awesome efforts building up this incredible library!