diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-04-20 12:19:35 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-04-20 21:54:31 +0300 |
commit | 9a698fe3b1a64777835d4d5409c1ff5c43ea2aee (patch) | |
tree | c25c004e9dbbcf81202939d258c2ed5b9872d123 /include | |
parent | 3c6ccfbb5d7a80e266eda4fa41ae35cf8f625f0d (diff) | |
download | qtlocation-mapboxgl-9a698fe3b1a64777835d4d5409c1ff5c43ea2aee.tar.gz |
[core] Introduce Source::setMinimumTileUpdateInterval API
The `Source::setMinimumTileUpdateInterval()` method sets the minimum tile update interval, which is used to throttle the tile update network requests.
Default value is `Duration::zero()`.
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/style/source.hpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/mbgl/style/source.hpp b/include/mbgl/style/source.hpp index 32b15bdf47..a1650ad06a 100644 --- a/include/mbgl/style/source.hpp +++ b/include/mbgl/style/source.hpp @@ -1,9 +1,9 @@ #pragma once -#include <mbgl/util/noncopyable.hpp> -#include <mbgl/util/optional.hpp> -#include <mbgl/util/immutable.hpp> #include <mbgl/style/types.hpp> +#include <mbgl/util/chrono.hpp> +#include <mbgl/util/immutable.hpp> +#include <mbgl/util/optional.hpp> #include <mapbox/std/weak.hpp> #include <mapbox/util/type_wrapper.hpp> @@ -40,8 +40,11 @@ struct LayerTypeInfo; * * auto vectorSource = std::make_unique<VectorSource>("my-vector-source"); */ -class Source : public mbgl::util::noncopyable { +class Source { public: + Source(const Source&) = delete; + Source& operator=(const Source&) = delete; + virtual ~Source(); // Check whether this source is of the given subtype. @@ -76,6 +79,14 @@ public: void setPrefetchZoomDelta(optional<uint8_t> delta) noexcept; optional<uint8_t> getPrefetchZoomDelta() const noexcept; + // If the given source supports loading tiles from a server, + // sets the minimum tile update interval, which is used to + // throttle the tile update network requests. + // + // Default value is `Duration::zero()`. + void setMinimumTileUpdateInterval(Duration) noexcept; + Duration getMinimumTileUpdateInterval() const noexcept; + // Sets a limit for how much a parent tile can be overscaled. // // When a set of tiles for a current zoom level is being rendered and some of the |