[core] Merge LiveTileData into VectorTileData
To encapsulate the differences, this introduces an abstract GeometryTileMonitor class, with concrete VectorTileMonitor and AnnotationTileMonitor implementations, and makes pbf parsing for VectorTile data happen lazily in getLayer, since we want that to happen on the worker thread, rather than when VectorTile is created. Fixes #2792
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/annotation/annotation_tile.hpp>
|
||||
#include <mbgl/util/constants.hpp>
|
||||
#include <mbgl/map/map_data.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -25,4 +26,13 @@ util::ptr<GeometryTileLayer> AnnotationTile::getLayer(const std::string& name) c
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AnnotationTileMonitor::AnnotationTileMonitor(const TileID& id, MapData& data)
|
||||
: tile(data.getAnnotationManager()->getTile(id)) {
|
||||
}
|
||||
|
||||
Request* AnnotationTileMonitor::monitorTile(std::function<void (std::exception_ptr, std::unique_ptr<GeometryTile>)> callback) {
|
||||
callback(nullptr, std::move(tile));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user