diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-10-16 14:43:09 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-10-17 12:53:24 -0700 |
commit | 5a45976b7c72e9a9e1a43d57e5482b1dd9c1e98e (patch) | |
tree | a10f4b17b3ae8248710f93de2f7754e6f246f5a0 /platform/darwin/src/MGLOfflineStorage.h | |
parent | f510b577aadad43c2ade55c0be3f8289209d559f (diff) | |
download | qtlocation-mapboxgl-5a45976b7c72e9a9e1a43d57e5482b1dd9c1e98e.tar.gz |
[darwin] Add MGLOfflineStorage putResourceForURL
Useful for pre-warming the ambient cache
Diffstat (limited to 'platform/darwin/src/MGLOfflineStorage.h')
-rw-r--r-- | platform/darwin/src/MGLOfflineStorage.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLOfflineStorage.h b/platform/darwin/src/MGLOfflineStorage.h index d512c60845..5065e397d0 100644 --- a/platform/darwin/src/MGLOfflineStorage.h +++ b/platform/darwin/src/MGLOfflineStorage.h @@ -339,6 +339,26 @@ MGL_EXPORT */ @property (nonatomic, readonly) unsigned long long countOfBytesCompleted; +/* + * Insert the provided resource into the ambient cache + * This method mimics the caching that would take place if the equivalent + * resource were requested in the process of map rendering. + * Use this method to pre-warm the cache with resources you know + * will be requested. + * + * This call is asynchronous: the data may not be immediately available + * for in-progress requests, although subsequent requests should have + * access to the cached data. + * + * @param url The URL of the resource to insert + * @param data Response data to store for this resource. Data is expected to be uncompressed; internally, the cache will compress data as necessary. + * @param modified Optional "modified" response header + * @param expires Optional "expires" response header + * @param etag Optional "entity tag" response header + */ +-(void)putResourceWithUrl:(NSURL *)url data:(NSData *)data modified:(NSDate * _Nullable)modified expires:(NSDate * _Nullable)expires etag:(NSString * _Nullable)etag; + + @end /** |