diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-09-15 22:01:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 22:01:09 -0700 |
commit | 9ef65440b6bfd2c8da17d2613f8c967682cc0ef9 (patch) | |
tree | 52b5508cae9fe76548b9efee15268d2da1543080 /include | |
parent | 217c43d1255f36c7ef2b588a90b6c19ca176dce2 (diff) | |
download | qtlocation-mapboxgl-9ef65440b6bfd2c8da17d2613f8c967682cc0ef9.tar.gz |
[core] [android] - public api configurable base endpoint (#6309)
add runloop to test
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/storage/default_file_source.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/storage/online_file_source.hpp | 5 | ||||
-rw-r--r-- | include/mbgl/util/constants.hpp | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp index 235e738254..ab9c2bc6a0 100644 --- a/include/mbgl/storage/default_file_source.hpp +++ b/include/mbgl/storage/default_file_source.hpp @@ -29,6 +29,9 @@ public: bool supportsOptionalRequests() const override { return true; } + + void setAPIBaseURL(const std::string&); + std::string getAPIBaseURL() const; void setAccessToken(const std::string&); std::string getAccessToken() const; diff --git a/include/mbgl/storage/online_file_source.hpp b/include/mbgl/storage/online_file_source.hpp index 081beeeabc..9c7feceb47 100644 --- a/include/mbgl/storage/online_file_source.hpp +++ b/include/mbgl/storage/online_file_source.hpp @@ -1,6 +1,7 @@ #pragma once #include <mbgl/storage/file_source.hpp> +#include <mbgl/util/constants.hpp> namespace mbgl { @@ -9,6 +10,9 @@ public: OnlineFileSource(); ~OnlineFileSource() override; + void setAPIBaseURL(const std::string& t) { apiBaseURL = t; } + std::string getAPIBaseURL() const { return apiBaseURL; } + void setAccessToken(const std::string& t) { accessToken = t; } std::string getAccessToken() const { return accessToken; } @@ -20,6 +24,7 @@ private: class Impl; const std::unique_ptr<Impl> impl; std::string accessToken; + std::string apiBaseURL = mbgl::util::API_BASE_URL; }; } // namespace mbgl diff --git a/include/mbgl/util/constants.hpp b/include/mbgl/util/constants.hpp index 75a1ace5c5..e6e9f6e67d 100644 --- a/include/mbgl/util/constants.hpp +++ b/include/mbgl/util/constants.hpp @@ -45,6 +45,8 @@ constexpr UnitBezier DEFAULT_TRANSITION_EASE = { 0, 0, 0.25, 1 }; constexpr int DEFAULT_RATE_LIMIT_TIMEOUT = 5; +constexpr const char* API_BASE_URL = "https://api.mapbox.com"; + } // namespace util namespace debug { |