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 /src/mbgl/style/source.cpp | |
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 'src/mbgl/style/source.cpp')
-rw-r--r-- | src/mbgl/style/source.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mbgl/style/source.cpp b/src/mbgl/style/source.cpp index 51a3c80089..42ad367d66 100644 --- a/src/mbgl/style/source.cpp +++ b/src/mbgl/style/source.cpp @@ -43,6 +43,18 @@ optional<uint8_t> Source::getPrefetchZoomDelta() const noexcept { return baseImpl->getPrefetchZoomDelta(); } +void Source::setMinimumTileUpdateInterval(Duration interval) noexcept { + if (getMinimumTileUpdateInterval() == interval) return; + auto newImpl = createMutable(); + newImpl->setMinimumTileUpdateInterval(interval); + baseImpl = std::move(newImpl); + observer->onSourceChanged(*this); +} + +Duration Source::getMinimumTileUpdateInterval() const noexcept { + return baseImpl->getMinimumTileUpdateInterval(); +} + void Source::setMaxOverscaleFactorForParentTiles(optional<uint8_t> overscaleFactor) noexcept { if (getMaxOverscaleFactorForParentTiles() == overscaleFactor) return; auto newImpl = createMutable(); |