[core] remove SourceInfo dependency from *TileData
This commit is contained in:
committed by
John Firebaugh
parent
aac6b00dd0
commit
1ff317c1cd
@@ -4,6 +4,7 @@
|
||||
#include <mbgl/storage/response.hpp>
|
||||
#include <mbgl/storage/file_source.hpp>
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
#include <mbgl/util/url.hpp>
|
||||
|
||||
#include <utility>
|
||||
|
||||
@@ -177,11 +178,12 @@ util::ptr<const GeometryTileFeature> VectorTileLayer::getFeature(std::size_t i)
|
||||
return std::make_shared<VectorTileFeature>(features.at(i), *this);
|
||||
}
|
||||
|
||||
VectorTileMonitor::VectorTileMonitor(const SourceInfo& source, const TileID& id, float pixelRatio)
|
||||
: url(source.tileURL(id, pixelRatio)) {
|
||||
VectorTileMonitor::VectorTileMonitor(const TileID& tileID_, const std::string& urlTemplate_)
|
||||
: tileID(tileID_), urlTemplate(urlTemplate_) {
|
||||
}
|
||||
|
||||
std::unique_ptr<FileRequest> VectorTileMonitor::monitorTile(const GeometryTileMonitor::Callback& callback) {
|
||||
const std::string url = util::templateTileURL(urlTemplate, tileID);
|
||||
return util::ThreadContext::getFileSource()->request({ Resource::Kind::Tile, url }, [callback, this](Response res) {
|
||||
if (res.data && data == res.data) {
|
||||
// We got the same data again. Abort early.
|
||||
|
||||
Reference in New Issue
Block a user