diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2019-06-20 16:23:57 -0700 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2019-07-09 15:03:39 -0700 |
commit | 104713054e03303c2c2489390db28136f31d540a (patch) | |
tree | 88280ea3019145db0348288c9b2eb97bdf5de5c6 | |
parent | 18f7e4b84d761623a825498398ef58b79ee39ecd (diff) | |
download | qtlocation-mapboxgl-104713054e03303c2c2489390db28136f31d540a.tar.gz |
[ios] initial implementation for setMaximumCacheSize
-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 { |