1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include <mbgl/tile/tile.hpp>
#include <mbgl/tile/tile_observer.hpp>
#include <mbgl/renderer/query.hpp>
#include <mbgl/util/string.hpp>
#include <mbgl/util/logging.hpp>
namespace mbgl {
static TileObserver nullObserver;
Tile::Tile(Kind kind_, OverscaledTileID id_) : kind(kind_), id(std::move(id_)), observer(&nullObserver) {
}
Tile::~Tile() = default;
void Tile::setObserver(TileObserver* observer_) {
observer = observer_;
}
void Tile::cancel() {
}
void Tile::setTriedCache() {
triedOptional = true;
observer->onTileChanged(*this);
}
void Tile::dumpDebugLogs() const {
std::string kindString;
switch (kind) {
case Kind::Geometry: kindString = "Geometry"; break;
case Kind::Raster: kindString = "Raster"; break;
case Kind::RasterDEM: kindString = "RasterDEM"; break;
default: kindString = "Unknown"; break;
}
Log::Info(Event::General, "Tile::Kind: %s", kindString.c_str());
Log::Info(Event::General, "Tile::id: %s", util::toString(id).c_str());
Log::Info(Event::General, "Tile::renderable: %s", isRenderable() ? "yes" : "no");
Log::Info(Event::General, "Tile::complete: %s", isComplete() ? "yes" : "no");
}
void Tile::queryRenderedFeatures(
std::unordered_map<std::string, std::vector<Feature>>&,
const GeometryCoordinates&,
const TransformState&,
const std::vector<const RenderLayer*>&,
const RenderedQueryOptions&,
const mat4&) {}
float Tile::getQueryPadding(const std::vector<const RenderLayer*>&) {
return 0;
}
void Tile::querySourceFeatures(
std::vector<Feature>&,
const SourceQueryOptions&) {}
} // namespace mbgl
|