diff options
-rw-r--r-- | platform/darwin/src/MGLOfflineStorage.h | 21 | ||||
-rw-r--r-- | platform/darwin/src/MGLOfflineStorage.mm | 8 |
2 files changed, 29 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLOfflineStorage.h b/platform/darwin/src/MGLOfflineStorage.h index b48f2ebf2c..2f869f6bde 100644 --- a/platform/darwin/src/MGLOfflineStorage.h +++ b/platform/darwin/src/MGLOfflineStorage.h @@ -341,6 +341,27 @@ MGL_EXPORT */ @property (nonatomic, readonly) unsigned long long countOfBytesCompleted; + +#pragma mark - Managing Ambient Cache + + +// JK FINISH DOC +/* + Sets the maximum ambient cache size in megabytes. The default maximum cache size is _ MB. To disable ambient caching, set the maximum ambient cache size to 0. + + This method should be called before using the database. + */ + +- (void)setMaximumAmbientCacheSize:(uint64_t)cacheSize; + +/* + Forces cache tiles to be invalidated and updated from the tile server. This ensures that the + */ + +- (void)invalidateAmbientCache { + +} + /* Inserts the provided resource into the ambient cache. diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm index 6effd8c3ce..b7f5531bb1 100644 --- a/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/darwin/src/MGLOfflineStorage.mm @@ -486,6 +486,14 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio _mbglFileSource->setOfflineMapboxTileCountLimit(maximumCount); } +#pragma mark - Ambient Cache management + +- (void)setMaximumAmbientCacheSize:(uint64_t)cacheSize { + + if ( ! cacheSize > 0 ) { /* give a warning*/ } ; + _mbglFileSource->setMaximumAmbientCacheSize(cacheSize, nil); // I should do something with the std::exception_ptr here but i don't know what +} + #pragma mark - - (unsigned long long)countOfBytesCompleted { |