mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

MGLOfflinePackObserver

Open mateuszmackowiak opened this issue 6 years ago • 3 comments

The main issue for us is that we do not receive a callback on when the offline maps states are loaded. When referencing [MGLOfflineStorage sharedOfflineStorage] for the first time it calls internally reloadPacks method witch is asynchronous with no callback. I know that we can observer the packages by KVO and the for all packages we can request refreshProgress and then once again observer with KVO the state but synchronising it all is problematic and without proper memory management and removal of kvo observers it will crush.

I have made a pull request that extends the MGLOfflineStorageDelegate with an optional method - (void)didReloadPackagesForOfflineStorage:(MGLOfflineStorage *)storage; that should inform clearly what was loaded.

mateuszmackowiak avatar Oct 24 '19 09:10 mateuszmackowiak

@mateuszmackowiak thanks for the PR - we will review. FYI we're in the process of transitioning the iOS/macOS code to a separate repo, so please bear with us.

julianrex avatar Oct 31 '19 21:10 julianrex

Apologies for the delay - @mateuszmackowiak are you still interested in this feature? ~If so, can you please recreate it in http://github.com/mapbox/mapbox-gl-native-ios?~ /cc @1ec5

~Closing this as not-actionable in this repo.~

Update: We will create a new PR on your behalf.

julianrex avatar Mar 09 '20 14:03 julianrex

Hi, I don't see the PR in the new repo? Should I create it?

mateuszmackowiak avatar Apr 08 '20 13:04 mateuszmackowiak