You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
The mbgl::DatabaseFileSource::updateOfflineMetadata() method added in #6338 updates the offline region’s associated metadata in the offline database, but calling it effectively invalidates any mbgl::OfflineRegion the SDK has previously obtained and wrapped in a platform-specific object. Getting that region’s metadata continues to return the same old value without reflecting the change that has taken place in the offline database.
It’s very awkward for the iOS/macOS map SDK to tell developers that calling -[MGLOfflinePack setContext:completionHandler:], as in mapbox/mapbox-gl-native-ios#289, would cause the MGLOfflinePack.context property to become stale and that the only way to get the current context would be to reload the entire set of offline packs by calling -[MGLOfflineStorage reloadPacks] (which calls mbgl::DatabaseFileSource::listOfflineRegions() under the hood).
The mbgl::DatabaseFileSource::updateOfflineMetadata() method’s callback should accept a replacement mbgl::OfflineRegion with the updated metadata. The SDK could then update the MGLOfflinePack’s internal pointer to the mbgl::OfflineRegion with its replacement, and the SDK would remain internally consistent.
/cc @mapbox/gl-native @mapbox/maps-ios
The text was updated successfully, but these errors were encountered:
mapbox/mapbox-gl-native-ios#289 worked around this issue so that developers don’t need to work around it themselves. However, the workaround may not perform as well as if mbgl would return the updated region.
The
mbgl::DatabaseFileSource::updateOfflineMetadata()
method added in #6338 updates the offline region’s associated metadata in the offline database, but calling it effectively invalidates anymbgl::OfflineRegion
the SDK has previously obtained and wrapped in a platform-specific object. Getting that region’s metadata continues to return the same old value without reflecting the change that has taken place in the offline database.It’s very awkward for the iOS/macOS map SDK to tell developers that calling
-[MGLOfflinePack setContext:completionHandler:]
, as in mapbox/mapbox-gl-native-ios#289, would cause theMGLOfflinePack.context
property to become stale and that the only way to get the current context would be to reload the entire set of offline packs by calling-[MGLOfflineStorage reloadPacks]
(which callsmbgl::DatabaseFileSource::listOfflineRegions()
under the hood).The
mbgl::DatabaseFileSource::updateOfflineMetadata()
method’s callback should accept a replacementmbgl::OfflineRegion
with the updated metadata. The SDK could then update the MGLOfflinePack’s internal pointer to thembgl::OfflineRegion
with its replacement, and the SDK would remain internally consistent./cc @mapbox/gl-native @mapbox/maps-ios
The text was updated successfully, but these errors were encountered: