[core] Add runtime API for setting tile prefetch delta for Source
New setPrefetchZoomDelta(optional<uint8_t> delta) method allow overriding default tile prefetch setting that is defined by the Map instance. The method can be moved to generic style specification if found to be useful for gl-js engine.
This commit is contained in:
@@ -73,6 +73,8 @@ public:
|
||||
SourceObserver* observer = nullptr;
|
||||
|
||||
virtual void loadDescription(FileSource&) = 0;
|
||||
void setPrefetchZoomDelta(optional<uint8_t> delta) noexcept;
|
||||
optional<uint8_t> getPrefetchZoomDelta() const noexcept;
|
||||
void dumpDebugLogs() const;
|
||||
|
||||
virtual bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const = 0;
|
||||
@@ -85,6 +87,9 @@ public:
|
||||
mapbox::base::TypeWrapper peer;
|
||||
|
||||
virtual mapbox::base::WeakPtr<Source> makeWeakPtr() = 0;
|
||||
|
||||
protected:
|
||||
virtual Mutable<Impl> createMutable() const noexcept = 0;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -50,6 +50,10 @@ public:
|
||||
mapbox::base::WeakPtr<Source> makeWeakPtr() override {
|
||||
return weakFactory.makeWeakPtr();
|
||||
}
|
||||
|
||||
protected:
|
||||
Mutable<Source::Impl> createMutable() const noexcept final;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ThreadPool> threadPool;
|
||||
std::unique_ptr<Actor<CustomTileLoader>> loader;
|
||||
|
||||
@@ -81,6 +81,9 @@ public:
|
||||
return weakFactory.makeWeakPtr();
|
||||
}
|
||||
|
||||
protected:
|
||||
Mutable<Source::Impl> createMutable() const noexcept final;
|
||||
|
||||
private:
|
||||
optional<std::string> url;
|
||||
std::unique_ptr<AsyncRequest> req;
|
||||
|
||||
@@ -33,6 +33,10 @@ public:
|
||||
mapbox::base::WeakPtr<Source> makeWeakPtr() override {
|
||||
return weakFactory.makeWeakPtr();
|
||||
}
|
||||
|
||||
protected:
|
||||
Mutable<Source::Impl> createMutable() const noexcept final;
|
||||
|
||||
private:
|
||||
optional<std::string> url;
|
||||
std::unique_ptr<AsyncRequest> req;
|
||||
|
||||
@@ -31,6 +31,9 @@ public:
|
||||
return weakFactory.makeWeakPtr();
|
||||
}
|
||||
|
||||
protected:
|
||||
Mutable<Source::Impl> createMutable() const noexcept final;
|
||||
|
||||
private:
|
||||
const variant<std::string, Tileset> urlOrTileset;
|
||||
std::unique_ptr<AsyncRequest> req;
|
||||
|
||||
@@ -30,6 +30,9 @@ public:
|
||||
return weakFactory.makeWeakPtr();
|
||||
}
|
||||
|
||||
protected:
|
||||
Mutable<Source::Impl> createMutable() const noexcept final;
|
||||
|
||||
private:
|
||||
const variant<std::string, Tileset> urlOrTileset;
|
||||
std::unique_ptr<AsyncRequest> req;
|
||||
|
||||
Reference in New Issue
Block a user