summaryrefslogtreecommitdiff
path: root/include/mbgl/storage
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-23 18:25:36 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-24 13:38:14 -0800
commit065cda83fab02aea85573d9c2d78e9121296582d (patch)
tree8fab316922a052496e67aa49d968224ffbbf0fca /include/mbgl/storage
parent5cefaeb85716b21f2bbe57165a244844114b8dbe (diff)
downloadqtlocation-mapboxgl-065cda83fab02aea85573d9c2d78e9121296582d.tar.gz
[core] Limit total number of offline Mapbox tiles
Diffstat (limited to 'include/mbgl/storage')
-rw-r--r--include/mbgl/storage/default_file_source.hpp6
-rw-r--r--include/mbgl/storage/offline.hpp16
2 files changed, 22 insertions, 0 deletions
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp
index 3e839bbc18..93d6297651 100644
--- a/include/mbgl/storage/default_file_source.hpp
+++ b/include/mbgl/storage/default_file_source.hpp
@@ -94,6 +94,12 @@ public:
*/
void deleteOfflineRegion(OfflineRegion&&, std::function<void (std::exception_ptr)>);
+ /*
+ * Changing or bypassing this limit without permission from Mapbox is prohibited
+ * by the Mapbox Terms of Service.
+ */
+ void setOfflineMapboxTileCountLimit(uint64_t) const;
+
// For testing only.
void put(const Resource&, const Response&);
void goOffline();
diff --git a/include/mbgl/storage/offline.hpp b/include/mbgl/storage/offline.hpp
index 2bc286dbab..a3153adc28 100644
--- a/include/mbgl/storage/offline.hpp
+++ b/include/mbgl/storage/offline.hpp
@@ -150,6 +150,22 @@ public:
* re-executes the user-provided implementation on the main thread.
*/
virtual void responseError(Response::Error) {}
+
+ /*
+ * Implement this method to be notified when the limit on the number of Mapbox
+ * tiles stored for offline regions has been reached.
+ *
+ * Once the limit has been reached, the SDK will not download further offline
+ * tiles from Mapbox APIs until existing tiles have been removed. Contact your
+ * Mapbox sales representative to raise the limit.
+ *
+ * This limit does not apply to non-Mapbox tile sources.
+ *
+ * Note that this method will be executed on the database thread; it is the
+ * responsibility of the SDK bindings to wrap this object in an interface that
+ * re-executes the user-provided implementation on the main thread.
+ */
+ virtual void mapboxTileCountLimitExceeded(uint64_t /* limit */) {}
};
class OfflineRegion {